Java 8 ActionEvent - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 ActionEvent class.

This code example shows how to use the following methods:getID, getActionCommand, getModifiers, getWhen
            delegate.putValue(key, value);
    } 
     
    public void actionPerformed(ActionEvent ae){
        if(delegate!=null)
            delegate.actionPerformed(new ActionEvent(source, ae.getID(), ae.getActionCommand(), ae.getWhen(), ae.getModifiers()));
    } 
} 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getSource
    } 
 
    @Override 
    public void run(ActionEvent e) throws Throwable {
        // TODO 
        File jad = (File) (((Object[]) e.getSource())[0]);
        File jar = (File) (((Object[]) e.getSource())[1]);
        if (!new File(Settings.getEjavaPath()).exists()) {
            getMainFrame().showError("Please point out ejava.exe", "Invalid path"); 
            SettingsAction.getInstance(getMainFrame()).actionPerformed(e);
            return; 
        } 
        EjavaProxy proxy = new EjavaProxy(Settings.getEjavaPath());
        getMainFrame().actionStarted(this);
        slider = new UIProgressSlider(this);
        new Thread(slider).start();
        File installFile = jad == null ? jar : jad;
        getMainFrame().setBottomInfo("Installing " + installFile.getAbsolutePath());
        EjavaProxy.Midlet midlet = proxy.installMidlet(installFile, this);
        if (isRunning()) { 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
        logger.fine("Received notification from '" + pingBean + "' " + sb.toString());
        if (filesInfo.length() < FILESINFOMAX) {
            //filesInfo.append(notification.getMessage()); 
            filesInfo.append(notification.getUserData().toString());
            if (actionListener != null) {
                actionListener.actionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, "OpenGrok fileevent"));
            } 
        } 
    } 
 
    public void registerListener() throws IOException,
            InstanceNotFoundException {
        logger.fine("Registering listener: " + this.getClass().getName() + " for ObjectName: " + objName);
        server.addNotificationListener(objName, this, null, objName);
        logger.fine("Listener Registered");
        listenerRegistered = true;
    } 
 
    public void reconnect(int retrytimes) throws MalformedURLException, IOException {
        logger.fine("Doing reconnect on '" + agenturl + "'");
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getActionCommand
                (int) Math.ceil(h));
    } 
 
    @Override 
    public void actionPerformed(ActionEvent e) {
        if (ACTION_HOMEPAGE.equals(e.getActionCommand())) {
            UrlDisplayHelper.displayUrl(this, GCVIEWER_HOMEPAGE);
        } 
        else { 
            // default action 
            super.actionPerformed(e);
        } 
    } 
 
} 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:toString, getActionCommand
public class Debug implements ActionListener {
    public Debug () { 
        super(); 
    } 
    public void actionPerformed (ActionEvent ev) {
        System.out.println ("Action command: "+ev.getActionCommand ());
        System.out.println (ev.toString ());
        System.out.println ("");
    } 
} 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getSource
        //putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke('E', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() )); 
        setEnabled(false);
    } 
 
    public void actionPerformed(final ActionEvent e) {
        final ItemSelectable is = (ItemSelectable)e.getSource();
        final Object[] o = is.getSelectedObjects();
        try { 
            String item = (String)o[0];
            if (item.endsWith("%")) item = item.substring(0, item.length()-1);
            final double zoomFactor = Double.parseDouble(item.trim());
            if (zoomFactor > 0) gcViewer.getSelectedGCDocument().getModelChart().setScaleFactor(zoomFactor/1000.0);
        } 
        catch (NumberFormatException nfe) {
            //nfe.printStackTrace(); 
        } 
    } 
} 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
			actionListeners = new ArrayList<ActionListener>();
		 
		actionListeners.add(actionListener);
		 
		if (fired) {
			actionListener.actionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, ""));
		} 
	} 
	 
	private synchronized void fireActionPerformed() { 
		if (actionListeners == null) 
			return; 
		 
		ActionEvent a = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, "");
		for (ActionListener l : actionListeners)
			l.actionPerformed(a);
	} 
	 
} 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getSource
        // We must ask the user if it is ok to close current project 
        if (!Close.performAction(e)) {
            return; 
        } 
        // Load the file for this recent file command 
        loadProjectFile(e, getRecentFile(e), false);
    } 
 
    /** 
     * Get the recent file for the menu item 
     */ 
    private File getRecentFile(ActionEvent e) {
        JMenuItem menuItem = (JMenuItem)e.getSource();
        // Get the preference for the recent files 
        return new File(getRecentFile(Integer.parseInt(menuItem.getName())));
    } 
 
    /** 
     * Get the menu items to add to the menu bar, to get recent file functionality 
     * 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getSource
        putValue(SMALL_ICON, WATCH_ICON);
        setEnabled(false); 
    } 
 
    public void actionPerformed(final ActionEvent ae) {
        final AbstractButton source = (AbstractButton)ae.getSource();
        if (source.isSelected()) {
            final GCDocument selectedGCDocument = gcViewer.getSelectedGCDocument();
            selectedGCDocument.setWatched(true);
            selectedGCDocument.getRefreshWatchDog().setAction(this);
            selectedGCDocument.getRefreshWatchDog().start();
        } 
        else { 
            final GCDocument selectedGCDocument = gcViewer.getSelectedGCDocument();
            selectedGCDocument.setWatched(false);
            selectedGCDocument.getRefreshWatchDog().stop();
        } 
    } 
 
    public void setEnabled(final boolean newValue) {
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getActionCommand, getSource
     * Implemented by sub-classes. 
     * @see java.awt.event.ActionListener#actionPerformed(ActionEvent) 
     */ 
	public void actionPerformed(ActionEvent e) 
	{ 
		if (CREATEWORKFLOW.equals(e.getActionCommand()))
			model.createWorkflow(); 
		else 
		{ 
			if (COMBOBOX_CHANGED.equals(e.getActionCommand()))
			{ 
				JComboBox comboBox = (JComboBox)e.getSource();
				model.setWorkflow((String) comboBox.getSelectedItem());
				 
			} 
			else 			 
				model.setWorkflow(e.getActionCommand());
		} 
	} 
 

5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
See Code Examples for Java 8 ActionEvent Methods: