Search Results

Search found 187 results on 8 pages for 'ev'.

Page 8/8 | < Previous Page | 4 5 6 7 8 

  • CodePlex Daily Summary for Wednesday, May 12, 2010

    CodePlex Daily Summary for Wednesday, May 12, 2010New ProjectsAMP (Adamo Media Player): AMP is a custom media player that specializes in large media collections! Change the way you manage your media!BoogiePartners: BoogiePartners provides a loose collection of utilities or extensions for Boogie and SpecSharp developers.C# Developer Utility Library: Collection of helpful code functions including zero-config rolling file logging, parameter validation, reflection & object construction, I18N count...Commerce Server 2009 Orders using Pipelines in a Console Application: Using Commerce Server 2009 outside of a Web Application this project show how to create dummy Orders using Pipelines in a NON WEB CONTEXT, an examp...CRM Queue Manager C#: CRM 4 Queue Manager written in C#. Based on the original VB.Net CRM Queue Manager with some changes, additions and feature changes. Converts emai...DbBuilder: This is a tool indended for creation of MS SQL database from scratch, incremental updates, management of redeployable objects, etc. using scripted ...DbNetData: A collection of cross vendor database interface classes for .NET written in C# providing a consistent and simplified way of accessing SQL Server,Or...Deploy Workflow Manager: Kick off a workflow associated with a SharePoint List on all list items at once. SharePoint Designer Workflows will also be included. This projec...DigiLini - digital on screen ruler: Handy desktop tool for everyone who does ever do something graphical on his computer. There is an sizable horizontal and vertial ruler. You can pos...Dynamic Grid Data Type for Umbraco: The Dynamic Grid Data Type for Umbraco is a custom ASCX/C# control that was created to store tabular data as an Umbraco "Data Type". There's an abi...FlashPlus: An extension for Google Chrome and a bookmarklet for Internet Explorer and Firefox, this project makes media content on browsers more usable. This...Flat Database: Simple project making it really quick and easy, to implement a simple flat-file database for an application.Flood Watch Spam Control: Flood watch is a C# based application meant to help prevent site black listings. This application monitors outbound smtp streams, if a stream excee...Gamebox: gameboxKill Bill: Kill Bill covers the areas of customers, suppliers, products, sales and administration divided into modules which together form the system for the ...KND Decoder: Der KND Decoder konvertiert die lästigen Zahlenwerte, in den Java Dateien vom Knuddels Applet, zu lesbaren Strings. Die neue dekodier Methode wurde...Moonbeam: D3D11 FrameworkSite Defender: Add-on for blogs or anywhere else there could be people spamming your website.sMODfix: -Stringzilla: A string formatting classes designed for .NET 4 to enable named string formatting and conditional string formatting options based upon bound data c...The CQRS Kitchen: The CQRS Kitchen is an example application build with Silverlight 4 that demonstrates how to implement a CQRS / Event Sourcing application with the...XELF Framework for XNA / .NET: XELF Framework for XNA / .NET  XNA Game Studioおよび.NET Framework用のライブラリ・フレームワークとしてXELFが開発したC#ソースコードを含むプロジェクトです。  現在は、「XELF.Framework」のWindows用XNA G...xxxxxxxxx: xxxxxxxNew ReleasesASP.NET MVC 2 - CommonLibrary.CMS: CommonLibrary CMS - Alpha: CommonLibrary CMSA simple yet powerful CMS system in ASP.NET MVC 2 using C# 3.5. ActiveRecord based support for Blogs, Widgets, Pages, Parts, Ev...ASP.NET MVC Extensions: v1.0 RTM: v1.0 RTMAWS SimpleDB Browser: Release 2: Miscellaneous fixes from the Alpha release. Built to work with the released version of the .Net Framework 4.0.BIDS Helper: 1.4.3.0: This release addresses the following issues: For some people the BIDS Helper extensions to the Project Properties page for the SSIS Deploy plugin w...Bojinx: Bojinx Core V4.5.13: Fixes / Enhancements: Sequencer now accepts Commands directly without using events. Command queue now accepts both events and commands EventBu...CF-Soft: TestCases_DROP1: TestCases_DROP1CodePlex Runtime Intelligence Integration: PreEmptive.Attributes distributable: Contains a signed redistributable version of the PreEmptive.Attributes.dll library that non .NET 4 applications can use support in-code instrumenta...Convection Game Engine (Basic Edition): Convection Basic (44772): Compiled version of Convection Basic change set 44772.CRM Queue Manager C#: Initial release: Initial release of the CRM Queue Manager in C#. Release includes both the installer as well as the latest source code in zippped format. Running...DbNetData: DbNetData.1.0: Initial releaseDigiLini - digital on screen ruler: DigiLini 1.0: First stable version.Facturator - Create invoices easy and fast: Facturator.zip: current stable versionFlat Database: Initial Release: This is the working initial release of FlatDBKharaPOS: MSDN Magazine Sample: This is the release that supports the MSDN magazine article "Enterprise Patterns with WCF RIA Services. Some of the project was affected by the upg...Let's Up: 1.1 (Build 100511): - Add short and long break feature.Mesopotamia Experiment: Mesopotamia 1.2.88: Primarly bug fixes... Bug Fixes - fixed bug in synapse mutating whereby new ones were of one side only eg, source or target - fixed bug in screen ...NodeXL: Network Overview, Discovery and Exploration for Excel: NodeXL Class Libraries, version 1.0.1.123: The NodeXL class libraries can be used to display network graphs in .NET applications. To include a NodeXL network graph in a WPF desktop or Windo...NodeXL: Network Overview, Discovery and Exploration for Excel: NodeXL Excel 2007 Template, version 1.0.1.123: The NodeXL Excel 2007 template displays a network graph using edge and vertex lists stored in an Excel 2007 workbook. What's NewThis version makes...Over Store: OverStore 1.18.0.0: Version number is increased. New callback events added: Persisting and Persisted, which are raised on actually writing object data into the stora...Reusable Library: V1.0.7: A collection of reusable abstractions for enterprise application developerReusable Library Demo: V1.0.5: A demonstration of reusable abstractions for enterprise application developerRuntime Intelligence Endpoint Starter Kit: Runtime Intelligence Endpoint Starter Kit 20100511: Added crossdomain policy files so Silverlight applications can send usage data from anywhere.Scorm2CC: SCORM2CC Release 0.12.0.58711 net-2.0 Alpha: SCORM2CC Release 0.12.0.58711 net-2.0 AlphaShake - C# Make: Shake v0.1.14: Updated API to match with the current documentation.SharePoint LogViewer: SharePoint Log Viewer 2.6: This is a maintenance release. It has bug several fixes.Site Directory for SharePoint 2010 (from Microsoft Consulting Services, UK): v1.4: As 1.3 with the following changes Addition of a 'Site Data' webpart Site Directory can now be a site collection root or sub-site Scan job now ...sMODfix: sMODfix v1.0: Basic Versionsmtp4dev: smtp4dev 2.0: Smtp4dev 2.0 is powered by a completely re-written server component and now offers SSL/TLS and AUTH support.SocialScapes: SocialScapes Sidebar 1.0: The SocialScapes Sidebar is the first release of the new SocialScapes suite. There will be more modules to come along with a complete data aggrega...SSIS Multiple Hash: Multiple Hash V1.2: This is version 1.2 of the Multiple Hash SSIS Component. It supports SQL 2005 and SQL 2008, although you have to download the correct install pack...Surfium: Beta build: Somehow testedTerminals: Terminals 1.9a - RDP6 Support: The major change in this release is that Terminals has been upgraded to require RDP Client 6 to be installed for creating RDP connections. Backward...TFS Compare: Release 3.0: This release provides a new feature - the ability to navigate back and forth between document differences. Also, this release provides support for...VCC: Latest build, v2.1.30511.0: Automatic drop of latest buildyoutubeFisher: youtubeFisher v2.0: What's new new method of youtube parameters capturing HD 720p video support full-HD 1080p video support add Cancel option to stop file downl...Most Popular ProjectsWBFS ManagerRawrAJAX Control ToolkitMicrosoft SQL Server Product Samples: DatabaseSilverlight ToolkitWindows Presentation Foundation (WPF)patterns & practices – Enterprise LibraryMicrosoft SQL Server Community & SamplesPHPExcelASP.NETMost Active Projectspatterns & practices – Enterprise LibraryMirror Testing SystemRawrThe Information Literacy Education Learning Environment (ILE)Caliburn: An Application Framework for WPF and SilverlightwhiteBlogEngine.NETPHPExceljQuery Library for SharePoint Web ServicesTweetSharp

    Read the article

  • Context Sensitive JTable

    - by Geertjan
    Here's a plain old JTable on the NetBeans Platform. Whenever the toolbar button is clicked, information about the currently selected row is displayed in the status bar: Normally, the above would be achieved in NetBeans Platform applications via Nodes publishing their underlying business object when the selection changes. In this case, there are no Nodes at all. There's only a JTable and a DefaultTableModel, i.e., all pure Java Swing. So, how does it work? To follow the logic, it makes sense to create the example yourself, starting with the Stock object: public class Stock {     String name;     String desc;     public Stock() {     }     public Stock(String name, String desc) {         this.name = name;         this.desc = desc;     }     public String getDesc() {         return desc;     }     public String getName() {         return name;     }     public void setDesc(String desc) {         this.desc = desc;     }     public void setName(String name) {         this.name = name;     } } Next, create a new Window Component via the wizard and then rewrite the constructor as follows: public final class MyWindowTopComponent extends TopComponent {     private final InstanceContent ic = new InstanceContent();     public MyWindowTopComponent() {         initComponents();         //Statically create a few stocks,         //in reality these would come from a data source         //of some kind:         List<Stock> list = new ArrayList();         list.add(new Stock("AMZN", "Amazon"));         list.add(new Stock("BOUT", "About.com"));         list.add(new Stock("Something", "Something.com"));         //Create a JTable, passing the List above         //to a DefaultTableModel:         final JTable table = new JTable(StockTableModel (list));         //Whenever the mouse is clicked on the table,         //somehow construct a new Stock object //(or get it from the List above) and publish it:         table.addMouseListener(new MouseAdapter() {             @Override             public void mousePressed(MouseEvent e) {                 int selectedColumn = table.getSelectedColumn();                 int selectedRow = table.getSelectedRow();                 Stock s = new Stock();                 if (selectedColumn == 0) {                     s.setName(table.getModel().getValueAt(selectedRow, 0).toString());                     s.setDesc(table.getModel().getValueAt(selectedRow, 1).toString());                 } else {                     s.setName(table.getModel().getValueAt(selectedRow, 1).toString());                     s.setDesc(table.getModel().getValueAt(selectedRow, 0).toString());                 }                 ic.set(Collections.singleton(s), null);             }         });         JScrollPane scrollPane = new JScrollPane(table);         add(scrollPane, BorderLayout.CENTER);         //Put the dynamic InstanceContent into the Lookup:         associateLookup(new AbstractLookup(ic));     }     private DefaultTableModel StockTableModel (List<Stock> stockList) {         DefaultTableModel stockTableModel = new DefaultTableModel() {             @Override             public boolean isCellEditable(int row, int column) {                 return false;             }         };         Object[] columnNames = new Object[2];         columnNames[0] = "Symbol";         columnNames[1] = "Name";         stockTableModel.setColumnIdentifiers(columnNames);         Object[] rows = new Object[2];         ListIterator<Stock> stockListIterator = stockList.listIterator();         while (stockListIterator.hasNext()) {             Stock nextStock = stockListIterator.next();             rows[0] = nextStock.getName();             rows[1] = nextStock.getDesc();             stockTableModel.addRow(rows);         }         return stockTableModel;     }     ...     ...     ... And now, since you're publishing a new Stock object whenever the user clicks in the table, you can create loosely coupled Actions, like this: @ActionID(category = "Edit", id = "org.my.ui.ShowStockAction") @ActionRegistration(iconBase = "org/my/ui/Datasource.gif", displayName = "#CTL_ShowStockAction") @ActionReferences({     @ActionReference(path = "Menu/File", position = 1300),     @ActionReference(path = "Toolbars/File", position = 300) }) @Messages("CTL_ShowStockAction=Show Stock") public final class ShowStockAction implements ActionListener {     private final Stock context;     public ShowStockAction(Stock context) {         this.context = context;     }     @Override     public void actionPerformed(ActionEvent ev) {         StatusDisplayer.getDefault().setStatusText(context.getName() + " / " + context.getDesc());     } }

    Read the article

  • HTML Tidy in NetBeans IDE

    - by Geertjan
    First step in integrating HTML Tidy (via its JTidy implementation) into NetBeans IDE: The reason why I started doing this is because I want to integrate this into the pluggable analyzer functionality of NetBeans IDE that I recently blogged about, i.e., where the FindBugs functionality is found. So a logical first step is to get it working in an Action class, after which I can port it into the analyzer infrastructure: import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; import org.openide.awt.ActionID; import org.openide.awt.ActionReference; import org.openide.awt.ActionReferences; import org.openide.awt.ActionRegistration; import org.openide.cookies.EditorCookie; import org.openide.cookies.LineCookie; import org.openide.loaders.DataObject; import org.openide.text.Line; import org.openide.text.Line.ShowOpenType; import org.openide.util.Exceptions; import org.openide.util.NbBundle.Messages; import org.openide.windows.IOProvider; import org.openide.windows.InputOutput; import org.openide.windows.OutputEvent; import org.openide.windows.OutputListener; import org.openide.windows.OutputWriter; import org.w3c.tidy.Tidy; @ActionID(     category = "Tools", id = "org.jtidy.TidyAction") @ActionRegistration(     displayName = "#CTL_TidyAction") @ActionReferences({     @ActionReference(path = "Loaders/text/html/Actions", position = 150),     @ActionReference(path = "Editors/text/html/Popup", position = 750) }) @Messages("CTL_TidyAction=Run HTML Tidy") public final class TidyAction implements ActionListener {     private final DataObject context;     private final OutputWriter writer;     private EditorCookie ec = null;     public TidyAction(DataObject context) {         this.context = context;         ec = context.getLookup().lookup(org.openide.cookies.EditorCookie.class);         InputOutput io = IOProvider.getDefault().getIO("HTML Tidy", false);         io.select();         writer = io.getOut();     }     @Override     public void actionPerformed(ActionEvent ev) {         Tidy tidy = new Tidy();         try {             writer.reset();             StringWriter stringWriter = new StringWriter();             PrintWriter errorWriter = new PrintWriter(stringWriter);             tidy.setErrout(errorWriter);             tidy.parse(context.getPrimaryFile().getInputStream(), System.out);             String[] split = stringWriter.toString().split("\n");             for (final String string : split) {                 final int end = string.indexOf(" c");                 if (string.startsWith("line")) {                     writer.println(string, new OutputListener() {                         @Override                         public void outputLineAction(OutputEvent oe) {                             LineCookie lc = context.getLookup().lookup(LineCookie.class);                             int lineNumber = Integer.parseInt(string.substring(0, end).replace("line ", ""));                             Line line = lc.getLineSet().getOriginal(lineNumber - 1);                             line.show(ShowOpenType.OPEN, Line.ShowVisibilityType.FOCUS);                         }                         @Override                         public void outputLineSelected(OutputEvent oe) {}                         @Override                         public void outputLineCleared(OutputEvent oe) {}                     });                 }             }         } catch (IOException ex) {             Exceptions.printStackTrace(ex);         }     } } The string parsing above is ugly but gets the job done for now. A problem integrating this into the pluggable analyzer functionality is the limitation of its scope. The analyzer lets you select one or more projects, or individual files, but not a folder. So it doesn't work on folders in the Favorites window, for example, which is where I'd like to apply HTML Tidy, across multiple folders via the analyzer functionality. That's a bit of a bummer that I'm hoping to get around somehow.

    Read the article

  • Showing an Action on a TopComponent Node

    - by Geertjan
    Let's say you want to extend the tools in NetBeans IDE, specifically for TopComponents. When the user right-clicks in the Projects window (or Files window or Favorites window) on a Java class that extends TopComponent, a menu item should be available for branding the TopComponent. What "branding" entails is, at this stage, a secondary question. The primary question, from an implementation point of view, is "how do I create an action that is only shown when the user right-clicks on a TopComponent?" Here's the solution, in NetBeans IDE 7.2 (the "lazy" attribute, here set to false, is new in 7.2): import com.sun.source.tree.ClassTree; import com.sun.source.util.TreePathScanner; import java.awt.event.ActionEvent; import java.io.IOException; import javax.lang.model.element.Element; import javax.lang.model.element.TypeElement; import javax.swing.AbstractAction; import javax.swing.Action; import javax.swing.JOptionPane; import org.netbeans.api.java.source.CompilationController; import org.netbeans.api.java.source.CompilationInfo; import org.netbeans.api.java.source.JavaSource; import org.netbeans.api.java.source.JavaSource.Phase; import org.netbeans.api.java.source.Task; import org.openide.awt.ActionID; import org.openide.awt.ActionReference; import org.openide.awt.ActionReferences; import org.openide.awt.ActionRegistration; import org.openide.awt.DynamicMenuContent; import org.openide.loaders.DataObject; import org.openide.util.ContextAwareAction; import org.openide.util.Exceptions; import org.openide.util.Lookup; import org.openide.util.NbBundle.Messages; import org.openide.util.Utilities; @ActionID(     category = "Tools", id = "org.tc.customizer.BrandTopComponentAction") @ActionRegistration(     displayName = "#CTL_BrandTopComponentAction",     lazy = false) @ActionReferences({     @ActionReference(path = "Loaders/text/x-java/Actions", position = 150) }) @Messages("CTL_BrandTopComponentAction=Brand") public final class BrandTopComponentAction extends AbstractAction implements ContextAwareAction {     private final DataObject dobj;     public BrandTopComponentAction() {         this(Utilities.actionsGlobalContext());     }     public BrandTopComponentAction(Lookup context) {         super(Bundle.CTL_BrandTopComponentAction());         this.dobj = context.lookup(DataObject.class);         //Enable the menu item only if we're dealing with a TopComponent         JavaSource javaSource = JavaSource.forFileObject(dobj.getPrimaryFile());         try {             javaSource.runUserActionTask(new ScanForTopComponentTask(this), true);         } catch (IOException ex) {             Exceptions.printStackTrace(ex);         }         //Hide the menu item if it isn't enabled:         putValue(DynamicMenuContent.HIDE_WHEN_DISABLED, true);     }     @Override     public void actionPerformed(ActionEvent ev) {         JOptionPane.showMessageDialog(null, "Hurray, I am a TopComponent!");         //Now add your code for showing a dialog,         //where the dialog will display UI for branding the TopComponent somehow         //and retrieve those branding values         //and then change the TopComponent class accordingly.     }     @Override     public Action createContextAwareInstance(Lookup actionContext) {         return new BrandTopComponentAction(actionContext);     }     private static class ScanForTopComponentTask implements Task<CompilationController> {         private final BrandTopComponentAction action;         private ScanForTopComponentTask(BrandTopComponentAction action) {             this.action = action;         }         @Override         public void run(CompilationController compilationController) throws Exception {             compilationController.toPhase(Phase.ELEMENTS_RESOLVED);             new MemberVisitor(compilationController, action).scan(                     compilationController.getCompilationUnit(), null);         }     }     private static class MemberVisitor extends TreePathScanner<Void, Void> {         private CompilationInfo info;         private final AbstractAction action;         public MemberVisitor(CompilationInfo info, AbstractAction action) {             this.info = info;             this.action = action;         }         @Override         public Void visitClass(ClassTree t, Void v) {             Element el = info.getTrees().getElement(getCurrentPath());             if (el != null) {                 TypeElement te = (TypeElement) el;                 if (te.getSuperclass().toString().equals("org.openide.windows.TopComponent")){                     action.setEnabled(true);                 } else {                     action.setEnabled(false);                 }             }             return null;         }     } } The code above is the result of combining various tutorials found on the NetBeans Platform Learning Trail.

    Read the article

  • Problem receving in RXTX

    - by drhorrible
    I've been using RXTX for about a year now, without too many problems. I just started a new program to interact with a new piece of hardware, so I reused the connect() method I've used on my other projects, but I have a weird problem I've never seen before. The Problem The device works fine, because when I connect with hyperterminal, I send things and receive what I expect, and Serial Port Monitor(SPM) reflects this. However, when I run the simple hyperterminal-clone I wrote to diagnose the problem I'm having with my main app, bytes are sent, according to SPM, but nothing is received, and my SerialPortEventListener never fires. Even when I check for available data in the main loop, reader.ready() returns false. If I ignore this check, then I get an exception, details below. Relevant section of connect() method // Configure and open port port = (SerialPort) CommPortIdentifier.getPortIdentifier(name) .open(owner,1000) port.setSerialPortParams(baud, databits, stopbits, parity); port.setFlowControlMode(fc_mode); final BufferedReader br = new BufferedReader( new InputStreamReader( port.getInputStream(), "US-ASCII")); // Add listener to print received characters to screen port.addEventListener(new SerialPortEventListener(){ public void serialEvent(SerialPortEvent ev) { try { System.out.println("Received: "+br.readLine()); } catch (IOException e) { e.printStackTrace(); } } }); port.notifyOnDataAvailable(); Exception java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:268) at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306) at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158) at java.io.InputStreamReader.read(InputStreamReader.java:167) at java.io.BufferedReader.fill(BufferedReader.java:136) at java.io.BufferedReader.read(BufferedReader.java:157) at <my code> The big question (again) I think I've eliminated all possible hardware problems, so what could be wrong with my code, or the RXTX library? Edit: something interesting When I open hyperterminal after sending a bunch of commands from java that should have gotten responses, all of the responses appear immediately, as if they had been put in the buffer somewhere, but unavailable. Edit 2: Tried something new, same results I ran the code example found here, with the same results. No data came in, but when I switched to a new program, it came all at once. Edit 3 The hardware is fine, and even a different computer has the same problem. I am not using any sort of USB adapter. I've started using PortMon, too, and it's giving me some interesting results. Hyperterminal and RXTX are not using the same settings, and RXTX always polls the port, unlike HyperTerminal, but I still can't see what settings would affect this. As soon as I can isolate the configuration from the constant polling, I'll post my PortMon logs. Edit 4 Is it possible that some sort of Windows update in the last 3 months could have caused this? It has screwed up one of my MATLAB mex-based programs once. Edit 5 I've also noticed some things that are different between HyperTerminal, RXTX, and a separate program I found that communicates with the device (but doesn't do what I want, which is why I'm rolling my own program) HyperTerminal - set to no flow control, but Serial Port Monitor's RTS and DTR indicators are green Other program - not sure what settings it thinks it's using, but only SPM's RTS indicator is green RXTX - no matter what flow control I set, only SPM's CTS and DTR indicators are on. From Serial Port Monitor's help files (paraphrased): the indicators display the state of the serial control lines RTS - Request To Send CTS - Clear To Send DTR - Data Terminal Ready

    Read the article

  • jQuery not executed on page load

    - by Arild Sandberg
    I'm building an ajax upload with an editing function (rotate, zoom and crop), and I'm using guillotine by matiasgagliano (https://github.com/matiasgagliano/guillotine) for this. My problem is that after upload the user get redirected to the editing page through ajax, but when landing on that page I always have to refresh the page in browser for the image to load. I've tried auto-reloading, both through js and php, but that doesn't help, neither does adding a button to load the same url again. Only refresh from browser button (tested in several browsers) works. I've tried implementing jquery.turbolinks, but that stopped guillotine functions from working. I'm loading the guillotine.js in head section after jQuery, and have the function in bottom before body tag. Any tip or help would be appreciated. Thx Here is some of the code: HTML: <div class='frame'> <img id="id_picture" src="identifications/<?php echo $id_url; ?>" alt="id" /> </div> <div id='controls'> <a href='javascript:void(0)' id='rotate_left' title='<?php echo $word_row[434]; ?>'><i class='fa fa-rotate-left'></i></a> <a href='javascript:void(0)' id='zoom_out' title='<?php echo $word_row[436]; ?>'><i class='fa fa-search-minus'></i></a> <a href='javascript:void(0)' id='fit' title='<?php echo $word_row[438]; ?>'><i class='fa fa-arrows-alt'></i></a> <a href='javascript:void(0)' id='zoom_in' title='<?php echo $word_row[437]; ?>'><i class='fa fa-search-plus'></i></a> <a href='javascript:void(0)' id='rotate_right' title='<?php echo $word_row[435]; ?>'><i class='fa fa-rotate-right'></i></a> </div> Js: <script type='text/javascript'> jQuery(function() { var picture = $('#id_picture'); picture.guillotine({ width: 240, height: 180 }); picture.on('load', function(){ // Initialize plugin (with custom event) picture.guillotine({eventOnChange: 'guillotinechange'}); // Display inital data var data = picture.guillotine('getData'); for(var key in data) { $('#'+key).html(data[key]); } // Bind button actions $('#rotate_left').click(function(){ picture.guillotine('rotateLeft'); }); $('#rotate_right').click(function(){ picture.guillotine('rotateRight'); }); $('#fit').click(function(){ picture.guillotine('fit'); }); $('#zoom_in').click(function(){ picture.guillotine('zoomIn'); }); $('#zoom_out').click(function(){ picture.guillotine('zoomOut'); }); $('#process').click(function(){ $.ajax({ type: "POST", url: "scripts/process_id.php?id=<?php echo $emp_id; ?>&user=<?php echo $user; ?>", data: data, cache: false, success: function(html) { window.location = "<?php echo $finish_url; ?>"; } }); }); // Update data on change picture.on('guillotinechange', function(ev, data, action) { data.scale = parseFloat(data.scale.toFixed(4)); for(var k in data) { $('#'+k).html(data[k]); } }); }); }); </script>

    Read the article

  • GroupLayout: JScrollPane in TextArea is not working

    - by Dozent
    i'm new in java and recently started to develop an simple application. For the moment i have a problem with JScrollPanne, it's not able to scroll down (or up) when the text in textarea more than size of area. I have looked to some solutions, but all of them were for FlowLayot (GridLayout and BoxLayout), but not for GroupLayout. Here is the code: JPanel conent_p = new JPanel(); conent_p.setBorder(new TitledBorder(null, "", TitledBorder.LEADING, TitledBorder.TOP, null, null)); JLabel lblItemName = new JLabel("Item name:"); itemField = new JTextField(); itemField.setColumns(10); JLabel lblMxPrice = new JLabel("Max price:"); mpriceField = new JTextField(); mpriceField.setColumns(10); JLabel lblQuantity = new JLabel("Quantity:"); quanField = new JTextField(); quanField.setColumns(10); JLabel lblDelivery = new JLabel("Delivery:"); delivField = new JTextField(); delivField.setColumns(10); JLabel lblLogcat = new JLabel("LogCat:"); final JTextArea txtConsole = new JTextArea(); txtConsole.setEditable(false); txtConsole.setLineWrap(true); txtConsole.setWrapStyleWord(true); sbrText = new JScrollPane(txtConsole); sbrText.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); // Now create a new TextAreaOutputStream to write to our JTextArea control and wrap a // PrintStream around it to support the println/printf methods. PrintStream out = new PrintStream(new TextAreaOutputStream(txtConsole)); // redirect standard output stream to the TextAreaOutputStream System.setOut(out); // redirect standard error stream to the TextAreaOutputStream System.setErr(out); GroupLayout gl_conent_p = new GroupLayout(conent_p); gl_conent_p.setHorizontalGroup( gl_conent_p.createParallelGroup(Alignment.LEADING) .addGroup(gl_conent_p.createSequentialGroup() .addContainerGap() .addGroup(gl_conent_p.createParallelGroup(Alignment.LEADING) .addComponent(lblMxPrice, Alignment.TRAILING) .addComponent(lblItemName, Alignment.TRAILING) .addComponent(lblLogcat, Alignment.TRAILING)) .addGap(18) .addGroup(gl_conent_p.createParallelGroup(Alignment.LEADING) .addGroup(gl_conent_p.createSequentialGroup() .addGroup(gl_conent_p.createParallelGroup(Alignment.LEADING, false) .addComponent(itemField, GroupLayout.PREFERRED_SIZE, 365, GroupLayout.PREFERRED_SIZE) .addGroup(gl_conent_p.createSequentialGroup() .addComponent(mpriceField, GroupLayout.PREFERRED_SIZE, 80, GroupLayout.PREFERRED_SIZE) .addGap(18) .addComponent(lblQuantity) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(quanField, 0, 0, Short.MAX_VALUE) .addGap(18) .addComponent(lblDelivery) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(delivField, GroupLayout.PREFERRED_SIZE, 80, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED))) .addGap(100)) .addGroup(gl_conent_p.createSequentialGroup() .addComponent(txtConsole, GroupLayout.PREFERRED_SIZE, 345, GroupLayout.PREFERRED_SIZE) .addComponent(sbrText) .addContainerGap()))) ); gl_conent_p.setVerticalGroup( gl_conent_p.createParallelGroup(Alignment.LEADING) .addGroup(gl_conent_p.createSequentialGroup() .addContainerGap() .addGroup(gl_conent_p.createParallelGroup(Alignment.BASELINE) .addComponent(lblItemName) .addComponent(itemField, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)) .addGap(20) .addGroup(gl_conent_p.createParallelGroup(Alignment.LEADING) .addGroup(gl_conent_p.createParallelGroup(Alignment.BASELINE) .addComponent(lblDelivery) .addComponent(delivField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addGroup(gl_conent_p.createParallelGroup(Alignment.BASELINE) .addComponent(lblMxPrice) .addComponent(mpriceField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(lblQuantity) .addComponent(quanField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))) .addGap(55) .addGroup(gl_conent_p.createParallelGroup(Alignment.BASELINE) .addComponent(lblLogcat) .addComponent(txtConsole, GroupLayout.PREFERRED_SIZE, 200, GroupLayout.PREFERRED_SIZE) .addComponent(sbrText)) .addContainerGap()) ); conent_p.setLayout(gl_conent_p); getContentPane().add(conent_p, BorderLayout.NORTH); JButton btnBuy = new JButton("Buy"); btnBuy.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent ev) { try { String title = itemField.getText().trim(); String mprice = mpriceField.getText().trim(); String quantity = quanField.getText().trim(); String deliver = delivField.getText().trim(); Item_CONCEPT item = new Item_CONCEPT(); item.setName(title); item.setDelivery(Integer.parseInt(deliver)); item.setStartPrice(0); item.setMaxPrice(Integer.parseInt(mprice)); myAgent.existsSeller(item); Date date = new Date(); DateFormat df = new SimpleDateFormat("dd.MM.yy HH:mm"); System.out.println(df.format(date)+": Buyer orders an item: "+item.getName()); //Clearing all fields itemField.setText(""); quanField.setText(""); delivField.setText(""); //txtConsole.setText(""); mpriceField.setText(""); } catch (Exception e) { JOptionPane.showMessageDialog(BuyerGUI.this, "A field is filled incorrectly. "+e.getMessage()+" is invalid.", "Error", JOptionPane.ERROR_MESSAGE); } } } );![enter image description here][1]

    Read the article

  • No Method Error in Ruby

    - by JayG
    Hi, I currently have a Rails Apps that lets users drag and drop certain elements of the webpage and updates the application based on the users choice. This is done with the help of the Rails helpers and AJAX. However I keep running into a "NoMethodError" in Ruby. NoMethodError in ProjectsController#member_change undefined method `symbolize_keys' for nil:NilClass Here is the method that is being called. My trace says that error is occurring in this line: before = u.functions_for(r.authorizable_id) u.roles << r unless u.roles.include? r u.save flag_changed = true after = u.functions_for(r.authorizable_id) And here is the function being called def member_change flag_changed = false params['u'] =~ /role_(\d+)_user_(\d+)/ drag_role_id = $1 user_id = $2 params['r'] =~ /role_(\d+)/ drop_role_id = $1 if u=User.find(user_id) if r=Role.find(drop_role_id) if drag_role_id.to_i !=0 and old_r=Role.find(drag_role_id) if drag_role_id == drop_role_id #fom A to A => nothing happen flash.now[:warning] = _('No Operation...') elsif r.authorizable_id == old_r.authorizable_id #the same project? old_r.users.delete(u) unless old_r.valid? flash.now[:warning] = _('Group "Admin" CAN NOT be EMPTY.') old_r.users << u #TODO: better recovery member_edit #if flag_changed render :action => :member_edit, :layout => 'module_with_flash' return end old_r.save r.users << u unless r.users.include? u r.save flag_changed = true before = u.functions_for(r.authorizable_id) after = u.functions_for(r.authorizable_id) added = after - before removed = before - after added.each do |f| ApplicationController::send_msg(:function,:create, {:function_name => f.name, :user_id => u.id, :project_id => r.authorizable_id }) end removed.each do |f| ApplicationController::send_msg(:function,:delete, {:function_name => f.name, :user_id => u.id, :project_id => r.authorizable_id }) end flash.now[:notice] = _( 'Move User to Group' ) + " #{ r.name }" else flash.now[:warning] = _('You can\'t move User between Groups that belong to different Projects.') end else before = u.functions_for(r.authorizable_id) u.roles << r unless u.roles.include? r u.save flag_changed = true after = u.functions_for(r.authorizable_id) added = after - before added.each do |f| ApplicationController::send_msg(:function,:create, {:function_name => f.name, :user_id => u.id, :project_id => r.authorizable_id }) end flash.now[:notice] = _( 'Add User into Group' ) + " #{ r.name }" end else flash.now[:warn] = _( 'Group doesn\'t exist!' ) + ": #{ r.name }" end else flash.now[:warning] = _( 'User doesn\'t exist!' ) + ": #{ u.login }" end member_edit #if flag_changed render :action => :member_edit, :layout => 'module_with_flash' end and the JavaScript used to call the function jQuery('#RemoveThisMember').droppable({accept:'.RolesUsersSelection', drop:function(ev,ui){ if (confirm("This will remove User from this Group, are you sure?")) {jQuery.ajax({data:'u=' + encodeURIComponent(jQuery(ui.draggable).attr('id')), success:function(request){jQuery('#module_content').html(request);}, type:'post', url:'/of/projects/11/member_delete'});} }, hoverClass:'ProjectRoleDropDelete_active'}) Any ideas? Thanks,

    Read the article

  • CodePlex Daily Summary for Wednesday, May 26, 2010

    CodePlex Daily Summary for Wednesday, May 26, 2010New Projects3D File Manager: 3D File manager is an application that aims to show how could look file manager in 3D. It´s developed in C# and XNA frameworkAcies: Acies is a dungeon crawler game done with C# and XNA.ActiveWinery: The open source winery and vineyard application.CC.Yacht: CC.Yacht is a client/server yacht dice game written in C# .NET. It utilizes a net.tcp WCF duplex service for client/server communication.Community Forums NNTP bridge: Community project for accessing the MS Web-Forums via an open source NNTP newsserver (bridge).Dojo Timer: WPF timer for Coding Dojo meetings. Timer feito em WPF para Coding Dojo.GameFX - The Game Development Framework: The Game Development Framework (GameFX) is simply a set of libraries to be used as the foundation for any simple 2D tile-based game. It can be used...Greg Roberts MVC Extensions: Asp.Net MVC Extensions including JSONP ActionResult. Targeted for MVC 2 and .NET 4.0.IIS Deploy: Project to develop a tool that automates the deploy Web sites and WCF services in single server environments and clustered.MarkLogic Sample Authoring App for Word: The MarkLogic Authoring Sample App for Word lets authors enrich Word documents using Content Controls, associate and manage metadata with those Con...Mono.Addins: Mono.Addins is a framework for creating extensible applications, and for creating add-ins which extend applications.MPCLI: MPCLI is a library that brings the power of the GNU MP big numbers library to those who use CLS-compliant languages such as C#, F#, and Visual Basi...NTFS parser classes: This is a C++ library to help parsing an NTFS volume, as well as file records and attributes. It will facilitate much when handling NTFS filesystem...Oddworld Level Gen: A 2D platform game, with Oddworld : Abe's Oddysee asset. The game introduce a dynamic system to generate the next level according to the previous l...Page Action Web Part for SharePoint 2007: This Web Part for SharePoint 2007 allows you to perform actions (such as causing an "Access is denied", redirect to another web page, view content ...Piggy Bank: Piggy Bank is a web-based financial application targetted towards kids.Productivity Hub Solutions: The Productivity Hub 2010 is a customizable, on-premise training solution for technology products. Developed by RedTech for Microsoft, the Producti...PyQt port of TortoiseHg: PyQt port of TortoiseHg (aka TortoiseHg 2.0)Releaser™: This is my private project. Currently, I'm not going to support it publicly.SLManagers: SLManagers 用于动态加载组件 实现对程序不同的的管理Smith Async .NET Memcached Client: Async .NET Memcached Client is a fully asynchronous implementation of a memcached client. The advantage of a fully asynchronous client is that you...Tauck Public API: Tauck's public API allows for travel agencies and other parterners to use Tauck's product information in their websites and other systems. Virtualizing WrapPanel: Virtualizing WrapPanel improves performance when binding a ListBox/ListView to a large amount of data. It is written in C#New Releases3D File Manager: 3D File manager: 3D File managerAragon Online Client: Aragon Online Client: The executable version of the Aragon Online Client can be installed from the Aragon Online page: http://aragon-online.net/aoclient/publish.phpASP.NET MVC CMS ( Using CommonLibrary.NET ): CommonLibrary CMS Alpha 2: CommonLibrary CMSA simple yet powerful CMS system in ASP.NET MVC 2 using C# 3.5. ActiveRecord based support for Blogs, Widgets, Pages, Parts, Ev...BFBC2 PRoCon: PRoCon 0.5.1.8: It's not even funny anymore =\Code for Rapid C# Windows Development eBook: LLBLGen LINQPad Data Context Driver Ver 1.0.0.3: Second release of a Static LLBLGen Pro Data Context Driver for LINQPad For LLBLGen Pro versions 2.6 and 3.0 beta. Fixed 'connection string not ini...Community Forums NNTP bridge: Community Forums NNTP Bridge V01: This is the first release of the Community Forums NNTP Bridge to access the social and anwsers MS forums with a single, open sourcen NNTP Bridge.Community Forums NNTP bridge: Community Forums NNTP Bridge V02: This is the second release of the Community Forums NNTP Bridge to access the social and anwsers MS forums with a single, open sourcen NNTP Bridge. ...DDDSample.Net: 0.9: Release 0.9 contains two major improvements: Vanilla version (both Synch and Asynch) has been updated so its model more closely resembles Java orig...DEWD: DEWD for Umbraco: Alpha release of the package. Usable for simple SQL editing, but lacking some core features such as validation, user friendly error handling, confi...Dojo Timer: Dojo Timer v1: Primeira versão Dojo Timer.eXpress Persistent Objects (XPO) Toolkit: Samples: Video Channel Channel.zip sample shows how to build a video site using XPO and WCF Data Services. DevExpress Channel DevExpress Channel Browse ...F# Project Extender: V0.9.2.1 (VS2008,VS2010): F# project extender for Visual Studio 2008 and Visual Studio 2010. Fixed bugs: -Project extender 0.9.2.0 can't be loaded in VS2008 without SDKFeedback Form: Feedback Application: Installer of the projectFeedback Form: Feedback Form: .sln for Feedback Form ApplicationGameFX - The Game Development Framework: Version 1.0 (Beta): Project is Visual Studio 2008 solution. GameFX Source code and sample program. The sample program allows you to create maps of any size, and drop ...MarkLogic Sample Authoring App for Word: MarkLogic Sample Authoring App for Word 1.0-1: Initial release of the MarkLogic Sample Authoring App for Word. See the home page for an overview on functionality. Within the release you'll ...MarkLogic Toolkit for Word: MarkLogic Toolkit for Word 1.2-1: Release built in support of the MarkLogic Sample Authoring App for Word. Updates include: update to XQuery API to expose functions for working w...Microsoft SQL Server Community & Samples: SQL Server 2008R2 RTM: Microsoft SQL Server 2008R2 (RTM) This release contains sample code for Microsoft SQL Server 2008R2. For many of these samples you will also need...Microsoft SQL Server Product Samples: Analysis Services: SQL Server 2008R2 RTM: Microsoft SQL Server 2008R2 (RTM) This release is dedicated to the samples that ship for Microsoft SQL Server 2008R2. For many of these samples y...Microsoft SQL Server Product Samples: Data Programming: SQL Server 2008R2 RTM: Microsoft SQL Server 2008R2 (RTM) This release is dedicated to the samples that ship for Microsoft SQL Server 2008R2. For many of these samples y...Microsoft SQL Server Product Samples: Database: AdventureWorks 2008R2 RTM: Sample Databases for Microsoft SQL Server 2008R2 (RTM)This release is dedicated to the sample databases that ship for Microsoft SQL Server 2008R2. ...Microsoft SQL Server Product Samples: End to End: SQL Server 2008R2 RTM: Microsoft SQL Server 2008R2 (RTM) This release is dedicated to the samples that ship for Microsoft SQL Server 2008R2. For many of these samples y...Microsoft SQL Server Product Samples: Engine: SQL Server 2008R2 RTM: Microsoft SQL Server 2008R2 (RTM) This release is dedicated to the samples that ship for Microsoft SQL Server 2008R2. For many of these samples y...Microsoft SQL Server Product Samples: Integration Services: SQL Server 2008R2 RTM: Microsoft SQL Server 2008R2 (RTM) This release is dedicated to the samples that ship for Microsoft SQL Server 2008R2. For many of these samples y...Microsoft SQL Server Product Samples: Replication: SQL Server 2008R2 RTM: Microsoft SQL Server 2008R2 (RTM) This release is dedicated to the samples that ship for Microsoft SQL Server 2008R2. For many of these samples y...Microsoft SQL Server Product Samples: Reporting Services: SQL Server 2008R2 RTM: Microsoft SQL Server 2008R2 (RTM) This release is dedicated to the samples that ship for Microsoft SQL Server 2008R2. For many of these samples y...Microsoft SQL Server Product Samples: Scripts: SQL Server 2008R2 RTM: Microsoft SQL Server 2008R2 (RTM) This release is dedicated to the samples that ship for Microsoft SQL Server 2008R2. For many of these samples y...Microsoft SQL Server Product Samples: Service Broker: SQL Server 2008R2 RTM: Microsoft SQL Server 2008R2 (RTM) This release is dedicated to the samples that ship for Microsoft SQL Server 2008R2. For many of these samples y...Microsoft SQL Server Product Samples: XML: SQL Server 2008R2 RTM: Microsoft SQL Server 2008R2 (RTM) This release is dedicated to the samples that ship for Microsoft SQL Server 2008R2. For many of these samples y...NLog - Advanced .NET Logging: Nightly Build 2010.05.25.001: Changes since the last build:2010-05-24 23:08:47 Jarek Kowalski Fixed base constructor invocation to ensure consistency. Added tests for common wra...NTFS parser classes: NTFS parser lib 0.55: 0.55openrs: Revision 3: Things that have been added since last release: Vector expanding Dynamic vectors Vector put method chaining Basic ISAAC implementation Wor...Page Action Web Part for SharePoint 2007: Page Action Web Part v1.0.0.0: First release of the Page Action Web Part v1.0.0.0.Productivity Hub Solutions: Silverlight Bookshelf: The Silverlight Bookshelf component of the 2010 Productivity Hub provides 4 accordion-style vertical tabs dispalying Featured Video, Featured Conte...Productivity Hub Solutions: Silverlight Product Carousel: The Product Carousel Silverlight component provides a rich navigation experience to the home page of the 2010 Productivity Hub - presenting the pro...Rawr: Rawr 2.3.18: >Rawr3 Public Beta has been released! Click here for details.< - Fix for bug in parsing characters with certain abnormal characters in their data. ...Runtime Intelligence Data Visualizer: RI Data Visualizer Release 1: This release of the RI Data Visualizer contains both a WPF client that displays application usage data and a Silverlight client that displays featu...sGSHOPedit: sGSHOPedit v1.1a: Fixed: bug in parsing description from "itemextdesc.txt" Fixed: surface change event Fixed: range for numeric values Added: search featureSLManagers: SlManagers: 实现简单的组件动态下载 使用Mef技术Sudoku (Multiplayer in RnD): Sudoku (Multiplayer in RnD) 1.0.1.0 program: Sudoku project was to practice on C# by making a desktop application using some algorithm Idea: The basic idea of algorithm is from http://www.ac...Sudoku (Multiplayer in RnD): Sudoku (Multiplayer in RnD) 1.0.1.0 source: user-interface, multi-threading, formatting Sudoku project was to practice on C# by making a desktop application using some algorithm Idea: The...Tauck Public API: XML Package 1.0: Current Release of XML dataTeach.Net: Teach.Net 1.0 Alpha: First alpha version. It should work, but there's gonna be bugs. Also, no intellisense documentation (or any other sort of documentation) yet. I'm w...VCC: Latest build, v2.1.30525.0: Automatic drop of latest buildVista Media Center TCP/IP Controller: Win7 64 and 32 bit Alpha - button command fix: button command fix , button-play, button-pause, button-skip back, button-skip fwd. Confirmed works on x64. Has not been tested on x32XsltDb - DotNetNuke Module Universal Building Block: 01.01.21: ASP.NET controls TreeView and TextEditor usage Live demo site Attention This release requires DNN 5.2 or higher as it using Telerik classes.in...Most Popular ProjectsRawrWBFS ManagerAJAX Control ToolkitMicrosoft SQL Server Product Samples: DatabaseSilverlight ToolkitWindows Presentation Foundation (WPF)patterns & practices – Enterprise LibraryMicrosoft SQL Server Community & SamplesPHPExcelASP.NETMost Active ProjectsAStar.netpatterns & practices – Enterprise Librarypatterns & practices: Windows Azure Security GuidanceRawrSqlServerExtensionsMono.AddinsBlogEngine.NETGMap.NET - Great Maps for Windows Forms & PresentationCodeReviewCaliburn: An Application Framework for WPF and Silverlight

    Read the article

  • Branding Support for TopComponents

    - by Geertjan
    In yesterday's blog entry, you saw how a menu item can be created, in this case with the label "Brand", especially for Java classes that extend TopComponent: And, as you can see here, it's not about the name of the class, i.e., not because the class above is named "BlaTopComponent" because below the "Brand" men item is also available for the class named "Bla": Both the files BlaTopComponent.java and Bla.java have the "Brand" menu item available, because both extend the "org.openide.windows.TopComponent"  class, as shown yesterday. Now we continue by creating a new JPanel, with checkboxes for each part of a TopComponent that we consider to be brandable. In my case, this is the end result, at deployment, when the Brand menu item is clicked for the Bla class: When the user (who, in this case, is a developer) clicks OK, a constructor is created and the related client properties are added, depending on which of the checkboxes are clicked: public Bla() {     putClientProperty(TopComponent.PROP_SLIDING_DISABLED, false);     putClientProperty(TopComponent.PROP_UNDOCKING_DISABLED, true);     putClientProperty(TopComponent.PROP_MAXIMIZATION_DISABLED, false);     putClientProperty(TopComponent.PROP_CLOSING_DISABLED, true);     putClientProperty(TopComponent.PROP_DRAGGING_DISABLED, false); } At this point, no check is done to see whether a constructor already exists, nor whether the client properties are already available. That's for an upcoming blog entry! Right now, the constructor is always created, regardless of whether it already exists, and the client properties are always added. The key to all this is the 'actionPeformed' of the TopComponent, which was left empty yesterday. We start by creating a JDialog from the JPanel and we retrieve the selected state of the checkboxes defined in the JPanel: @Override public void actionPerformed(ActionEvent ev) {     String msg = dobj.getName() + " Branding";     final BrandTopComponentPanel brandTopComponentPanel = new BrandTopComponentPanel();     dd = new DialogDescriptor(brandTopComponentPanel, msg, true, new ActionListener() {         @Override         public void actionPerformed(ActionEvent e) {             Object result = dd.getValue();             if (DialogDescriptor.OK_OPTION == result) {                 isClosing = brandTopComponentPanel.getClosingCheckBox().isSelected();                 isDragging = brandTopComponentPanel.getDraggingCheckBox().isSelected();                 isMaximization = brandTopComponentPanel.getMaximizationCheckBox().isSelected();                 isSliding = brandTopComponentPanel.getSlidingCheckBox().isSelected();                 isUndocking = brandTopComponentPanel.getUndockingCheckBox().isSelected();                 JavaSource javaSource = JavaSource.forFileObject(dobj.getPrimaryFile());                 try {                     javaSource.runUserActionTask(new ScanTask(javaSource), true);                 } catch (IOException ex) {                     Exceptions.printStackTrace(ex);                 }             }         }     });     DialogDisplayer.getDefault().createDialog(dd).setVisible(true); } Then we start a scan process, which introduces the branding. We're already doing a scan process for identifying whether a class is a TopComponent. So, let's combine those two scans, branching out based on which one we're doing: private class ScanTask implements Task<CompilationController> {     private BrandTopComponentAction action = null;     private JavaSource js = null;     private ScanTask(JavaSource js) {         this.js = js;     }     private ScanTask(BrandTopComponentAction action) {         this.action = action;     }     @Override     public void run(final CompilationController info) throws Exception {         info.toPhase(Phase.ELEMENTS_RESOLVED);         if (action != null) {             new EnableIfTopComponentScanner(info, action).scan(                     info.getCompilationUnit(), null);         } else {             introduceBranding();         }     }     private void introduceBranding() throws IOException {         CancellableTask task = new CancellableTask<WorkingCopy>() {             @Override             public void run(WorkingCopy workingCopy) throws IOException {                 workingCopy.toPhase(Phase.RESOLVED);                 CompilationUnitTree cut = workingCopy.getCompilationUnit();                 TreeMaker treeMaker = workingCopy.getTreeMaker();                 for (Tree typeDecl : cut.getTypeDecls()) {                     if (Tree.Kind.CLASS == typeDecl.getKind()) {                         ClassTree clazz = (ClassTree) typeDecl;                         ModifiersTree methodModifiers = treeMaker.Modifiers(Collections.<Modifier>singleton(Modifier.PUBLIC));                         MethodTree newMethod =                                 treeMaker.Method(methodModifiers,                                 "<init>",                                 treeMaker.PrimitiveType(TypeKind.VOID),                                 Collections.<TypeParameterTree>emptyList(),                                 Collections.EMPTY_LIST,                                 Collections.<ExpressionTree>emptyList(),                                 "{ putClientProperty(TopComponent.PROP_SLIDING_DISABLED, " + isSliding + ");\n"+                                 "  putClientProperty(TopComponent.PROP_UNDOCKING_DISABLED, " + isUndocking + ");\n"+                                 "  putClientProperty(TopComponent.PROP_MAXIMIZATION_DISABLED, " + isMaximization + ");\n"+                                 "  putClientProperty(TopComponent.PROP_CLOSING_DISABLED, " + isClosing + ");\n"+                                 "  putClientProperty(TopComponent.PROP_DRAGGING_DISABLED, " + isDragging + "); }\n",                                 null);                         ClassTree modifiedClazz = treeMaker.addClassMember(clazz, newMethod);                         workingCopy.rewrite(clazz, modifiedClazz);                     }                 }             }             @Override             public void cancel() {             }         };         ModificationResult result = js.runModificationTask(task);         result.commit();     } } private static class EnableIfTopComponentScanner extends TreePathScanner<Void, Void> {     private CompilationInfo info;     private final AbstractAction action;     public EnableIfTopComponentScanner(CompilationInfo info, AbstractAction action) {         this.info = info;         this.action = action;     }     @Override     public Void visitClass(ClassTree t, Void v) {         Element el = info.getTrees().getElement(getCurrentPath());         if (el != null) {             TypeElement te = (TypeElement) el;             if (te.getSuperclass().toString().equals("org.openide.windows.TopComponent")) {                 action.setEnabled(true);             } else {                 action.setEnabled(false);             }         }         return null;     } }

    Read the article

  • Firefox and TinyMCE 3.4.9 won't play nice together

    - by Patricia
    I've submitted a bug to the tinyMCE people, but i'm hoping someone else has come across this and has a suitable workaround. Here's the situation: I've got a form with a tinyMCE control that i load into a jquery dialog. it works great the first time, then after they close it, and open a new one. any interaction with the tinyMCE control gives: "Node cannot be used in a document other than the one in which it was created" it also doesn't fill the control with the text it's supposed to be prepopulated with. In my jquery dialogs i have the following scripts in my beforeClose handler: if (typeof tinyMCE != 'undefined') { $(this).find(':tinymce').each(function () { var theMce = $(this); tinyMCE.execCommand('mceFocus', false, theMce.attr('id')); tinyMCE.execCommand('mceRemoveControl', false, theMce.attr('id')); $(this).remove(); }); } and here's my tinyMCE setup script: $('#' + controlId).tinymce({ script_url: v2ScriptPaths.TinyMCEPath, mode: "none", elements: controlId, theme: "advanced", plugins: "paste", paste_retain_style_properties: "*", theme_advanced_toolbar_location: "top", theme_advanced_buttons1: "bold, italic, underline, strikethrough, separator, justifyleft, justifycenter, justifyright, justifyfull, indent, outdent, separator, undo, redo, separator, numlist, bullist, hr, link, unlink,removeformat", theme_advanced_buttons2: "fontsizeselect, forecolor, backcolor, charmap, pastetext,pasteword,selectall, sub, sup", theme_advanced_buttons3: "", language: v2LocalizedSettings.languageCode, gecko_spellcheck : true, onchange_callback: function (editor) { tinyMCE.triggerSave(); }, setup: function (editor) { editor.onInit.add(function (editor, event) { if (typeof v2SetInitialContent == 'function') { v2SetInitialContent(); } }) } }); is there anything obvious here? i've got all that complicated removal stuff in the close b/c tinymce doesn't like having it's html removed without it being removed. the setInitialContent() stuff is just so i can pre-load it with their email signature if they have one. it's broken with or without that code so that's not the problem. i was forced to update to 3.4.9 because of this issue: http://www.tinymce.com/forum/viewtopic.php?id=28400 so if someone can solve that, it would help this situation to. I have tried the suggestion from aknosis with no luck. EDIT: I originally thought this only affected firefox 11, but i have downloaded 10, and it is also affected. EDIT: Ok, i've trimmed down all my convoluted dynamic forms and links that cause this into a fairly simple example. the code for the base page: <a href="<%=Url.Action(MVC.Temp.GetRTEDialogContent)%>" id="TestSendEmailDialog">Get Dialog</a> <div id="TestDialog"></div> <script type="text/javascript"> $('#TestSendEmailDialog').click(function (e) { e.preventDefault(); var theDialog = buildADialog('Test', 500, 800, 'TestDialog'); theDialog.dialog('open'); theDialog.empty().load($(this).attr('href'), function () { }); }); function buildADialog(title, height, width, dialogId, maxHeight) { var customDialog = $('#' + dialogId); customDialog.dialog('destory'); customDialog.dialog({ title: title, autoOpen: false, height: height, modal: true, width: width, close: function (ev, ui) { $(this).dialog("destroy"); $(this).empty(); }, beforeClose: function (event, ui) { if (typeof tinyMCE != 'undefined') { $(this).find(':tinymce').each(function () { var theMce = $(this); tinyMCE.execCommand('mceFocus', false, theMce.attr('id')); tinyMCE.execCommand('mceRemoveControl', false, theMce.attr('id')); $(this).remove(); }); } } }); return customDialog; } </script> and the code for the page that is loaded into the dialog: <form id="SendAnEmailForm" name="SendAnEmailForm" enctype="multipart/form-data" method="post"> <textarea cols="50" id="MessageBody" name="MessageBody" rows="10" style="width: 710px; height:200px;"></textarea> </form> <script type="text/javascript"> $(function () { $('#MessageBody').tinymce({ script_url: v2ScriptPaths.TinyMCEPath, mode: "exact", elements: 'MessageBody', theme: "advanced", plugins: "paste, preview", paste_retain_style_properties: "*", theme_advanced_toolbar_location: "top", theme_advanced_buttons1: "bold, italic, underline, strikethrough, separator, justifyleft, justifycenter, justifyright, justifyfull, indent, outdent, separator, undo, redo, separator, numlist, bullist, hr, link, unlink,removeformat", theme_advanced_buttons2: "fontsizeselect, forecolor, backcolor, charmap, pastetext,pasteword,selectall, sub, sup, preview", theme_advanced_buttons3: "", language: 'EN', gecko_spellcheck: true, onchange_callback: function (editor) { tinyMCE.triggerSave(); } }); }); </script> a very interesting thing i noticed, if i move the tinyMCE setup into the load callback, it seems to work. this isn't really a solution though, because when i'm loading dialogs, i don't know in the code ahead of time if it has tinyMCE controls or not!

    Read the article

  • CDI @Conversation not propagated with handleNavigation()

    - by Thomas Kernstock
    I have a problem with the propagation of a long runnig conversation when I redirect the view by the handleNavigation() method. Here is my test code: I have a conversationscoped bean and two views: conversationStart.xhtml is called in Browser with URL http://localhost/tests/conversationStart.jsf?paramTestId=ParameterInUrl <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"> <f:metadata> <f:viewParam name="paramTestId" value="#{conversationTest.fieldTestId}" /> <f:event type="preRenderView" listener="#{conversationTest.preRenderView}" /> </f:metadata> <h:head> <title>Conversation Test</title> </h:head> <h:body> <h:form> <h2>Startpage Test Conversation with Redirect</h2> <h:messages /> <h:outputText value="Testparameter: #{conversationTest.fieldTestId}"/><br /> <h:outputText value="Logged In: #{conversationTest.loggedIn}"/><br /> <h:outputText value="Conversation ID: #{conversationTest.convID}"/><br /> <h:outputText value="Conversation Transient: #{conversationTest.convTransient}"/><br /> <h:commandButton action="#{conversationTest.startLogin}" value="Login ->" rendered="#{conversationTest.loggedIn==false}" /><br /> <h:commandLink action="/tests/conversationLogin.xhtml?faces-redirect=true" value="Login ->" rendered="#{conversationTest.loggedIn==false}" /><br /> </h:form> <h:link outcome="/tests/conversationLogin.xhtml" value="Login Link" rendered="#{conversationTest.loggedIn==false}"> <f:param name="cid" value="#{conversationTest.convID}"></f:param> </h:link> </h:body> </html> The Parameter is written to the beanfield and displayed in the view correctly. There are 3 different possibilites to navigate to the next View. All 3 work fine. The beanfield shows up the next view (conversationLogin.xhtml) too: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"> <h:head> <title>Conversation Test</title> </h:head> <h:body> <h:form> <h2>Loginpage Test Conversation with Redirect</h2> <h:messages /> <h:outputText value="Testparameter: #{conversationTest.fieldTestId}"/><br /> <h:outputText value="Logged In: #{conversationTest.loggedIn}"/><br /> <h:outputText value="Conversation ID: #{conversationTest.convID}"/><br /> <h:outputText value="Conversation Transient: #{conversationTest.convTransient}"/><br /> <h:commandButton action="#{conversationTest.login}" value="Login And Return" /><br /> </h:form> </h:body> </html> When I return to the Startpage by clicking the button the conversation bean still contains all values. So everything is fine. Here is the bean: package test; import java.io.Serializable; import javax.annotation.PostConstruct; import javax.enterprise.context.Conversation; import javax.enterprise.context.ConversationScoped; import javax.faces.event.ComponentSystemEvent; import javax.inject.Inject; import javax.inject.Named; @Named @ConversationScoped public class ConversationTest implements Serializable{ private static final long serialVersionUID = 1L; final String CONVERSATION_NAME="longRun"; @Inject Conversation conversation; private boolean loggedIn; private String fieldTestId; @PostConstruct public void init(){ if(conversation.isTransient()){ conversation.begin(CONVERSATION_NAME); System.out.println("New Conversation started"); } loggedIn=false; } public String getConvID(){ return conversation.getId(); } public boolean isConvTransient(){ return conversation.isTransient(); } public boolean getLoggedIn(){ return loggedIn; } public String startLogin(){ return "/tests/conversationLogin.xhtml?faces-redirect=true"; } public String login(){ loggedIn=true; return "/tests/conversationStart.xhtml?faces-redirect=true"; } public void preRenderView(ComponentSystemEvent ev) { // if(!loggedIn){ // System.out.println("Will redirect to Login"); // FacesContext ctx = FacesContext.getCurrentInstance(); // ctx.getApplication().getNavigationHandler().handleNavigation(ctx, null, "/tests/conversationLogin.xhtml?faces-redirect=true"); // ctx.renderResponse(); // } } public void setFieldTestId(String fieldTestId) { System.out.println("fieldTestID was set to: "+fieldTestId); this.fieldTestId = fieldTestId; } public String getFieldTestId() { return fieldTestId; } } Now comes the problem !! As soon as I try to redirect the page in the preRenderView method of the bean (just uncomment the code in the method), using handleNavigation() the bean is created again in the next view instead of using the allready created instance. Although the cid parameter is propagated to the next view ! Has anybody an idea what's wrong ? best regards Thomas

    Read the article

< Previous Page | 4 5 6 7 8