类java.awt.event.ActionListener源码实例Demo

下面列出了怎么用java.awt.event.ActionListener的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: netbeans   文件: OLCustomizer.java
@Override
protected boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed) {
    try {
        return super.processKeyBinding(ks, e, condition, pressed);
    } finally {
        //Fix for #166154: passes Enter kb action to dialog
        if (e.getKeyCode() == KeyEvent.VK_ENTER) {
            if (descriptor!=null) {
                ActionListener al = descriptor.getButtonListener();
                if (al!=null) {
                    al.actionPerformed(new ActionEvent(this,
                                                        ActionEvent.ACTION_PERFORMED,
                                                        "OK",           //NOI18N
                                                        e.getWhen(),
                                                        e.getModifiers()));
                }
            }
        }
    }
}
 
源代码2 项目: jdk8u-jdk   文件: bug6520101.java
public void run() {
    while (!this.chooser.isShowing()) {
        try {
            Thread.sleep(30);
        } catch (InterruptedException exception) {
            exception.printStackTrace();
        }
    }

    Timer timer = new Timer(INTERVAL, new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            chooser.cancelSelection();
        }
    });

    timer.setRepeats(false);
    timer.start();
}
 
源代码3 项目: netbeans   文件: WizardStepProgressSupport.java
public void startProgress() {
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            ProgressHandle progress = getProgressHandle(); // NOI18N
            JComponent bar = ProgressHandleFactory.createProgressComponent(progress);
            stopButton = new JButton(org.openide.util.NbBundle.getMessage(RepositoryStep.class, "BK2022")); // NOI18N
            stopButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    cancel();
                }
            });
            progressComponent = new JPanel();
            progressComponent.setLayout(new BorderLayout(6, 0));
            progressLabel = new JLabel();
            progressLabel.setText(getDisplayName());
            progressComponent.add(progressLabel, BorderLayout.NORTH);
            progressComponent.add(bar, BorderLayout.CENTER);
            progressComponent.add(stopButton, BorderLayout.LINE_END);
            WizardStepProgressSupport.super.startProgress();
            panel.setVisible(true);
            panel.add(progressComponent);
            panel.revalidate();
        }
    });                                                
}
 
源代码4 项目: mzmine3   文件: GUIUtils.java
/**
 *
 * Add a new checkbox to given component
 *
 * @param container Component to add the checkbox to
 * @param text Checkbox' text
 * @param icon Checkbox' icon or null
 * @param listener Checkbox' listener or null
 * @param actionCommand Checkbox' action command or null
 * @param mnemonic Checkbox' mnemonic (virtual key code) or 0
 * @param toolTip Checkbox' tool tip or null
 * @param state Checkbox' state
 * @return Created checkbox
 */
public static JCheckBox addCheckbox(Container component, String text, Icon icon,
    ActionListener listener, String actionCommand, int mnemonic, String toolTip, boolean state) {
  JCheckBox checkbox = new JCheckBox(text, icon, state);
  if (listener != null)
    checkbox.addActionListener(listener);
  if (actionCommand != null)
    checkbox.setActionCommand(actionCommand);
  if (mnemonic > 0)
    checkbox.setMnemonic(mnemonic);
  if (toolTip != null)
    checkbox.setToolTipText(toolTip);
  if (component != null)
    component.add(checkbox);
  return checkbox;
}
 
源代码5 项目: netbeans   文件: FeatureAction.java
public void actionPerformed(ActionEvent e) {
    FeatureInfo info = FoDLayersProvider.getInstance().whichProvides(fo);
    String n = Actions.cutAmpersand((String)fo.getAttribute("displayName")); // NOI18N
    boolean success = Utilities.featureDialog(info, n, n);
    if (!success) {
        return;
    }
    
    FileObject newFile = FileUtil.getConfigFile(fo.getPath());
    if (newFile == null) {
        throw new IllegalStateException("Cannot find file: " + fo.getPath());
    }
    
    Object obj = newFile.getAttribute("instanceCreate"); // NOI18N
    if (obj instanceof ActionListener) {
        ((ActionListener)obj).actionPerformed(e);
    }
}
 
源代码6 项目: netbeans   文件: IOWindow.java
@Override
public SubComponent[] getSubComponents() {
    if( singleTab != null )
        return new SubComponent[0];
    JComponent[] tabs = getTabs();
    SubComponent[] res = new SubComponent[tabs.length];
    for( int i=0; i<res.length; i++ ) {
        final JComponent theTab = tabs[i];
        String title = pane.getTitleAt( i );
        res[i] = new SubComponent( title, new ActionListener() {

            @Override
            public void actionPerformed( ActionEvent e ) {
                if( singleTab != null || pane.indexOfComponent( theTab ) < 0 )
                    return; //the tab is gone already
                selectTab( theTab );
            }
        }, theTab == getSelectedTab() );
    }
    return res;
}
 
源代码7 项目: netbeans   文件: ParamEditor.java
public void showDialog() {

	if(editable == Editable.NEITHER) {
	    NotifyDescriptor d = 
		new NotifyDescriptor(this, title, 
				     NotifyDescriptor.DEFAULT_OPTION,
				     NotifyDescriptor.PLAIN_MESSAGE, 
				     new Object[] { NotifyDescriptor.OK_OPTION },
				     NotifyDescriptor.OK_OPTION); 
	    DialogDisplayer.getDefault().notify(d);
	}
	else {
	    editDialog = new DialogDescriptor
		(this, title, true, DialogDescriptor.OK_CANCEL_OPTION,
		 DialogDescriptor.CANCEL_OPTION,
		 new ActionListener() {
		     public void actionPerformed(ActionEvent e) {
			 evaluateInput(); 
		     }
		 }); 

	    dialog = DialogDisplayer.getDefault().createDialog(editDialog);
	    dialog.setVisible(true);
	    this.repaint();
	}
    }
 
源代码8 项目: netbeans   文件: WeakTimerListener.java
public void actionPerformed(ActionEvent evt) {
    ActionListener src = (ActionListener)ref.get();
    if (src != null) {
        src.actionPerformed(evt);

    } else { // source listener was garbage collected
        if (evt.getSource() instanceof Timer) {
            Timer timer = (Timer)evt.getSource();
            timer.removeActionListener(this);

            if (stopTimer) {
                timer.stop();
            }
        }
    }
}
 
源代码9 项目: SubTitleSearcher   文件: AboutDialog.java
public static void main(String args[]) {
	final JFrame frame = new JFrame("test");
	frame.setSize(800, 500);
	// frame.setBackground(Color.LIGHT_GRAY);
	frame.setVisible(true);
	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	JButton btn = new JButton("test");
	btn.addActionListener(new ActionListener() {
		@Override
		public void actionPerformed(ActionEvent e) {
			new AboutDialog(frame).setVisible(true);
		}

	});
	frame.add(btn);
	new AboutDialog(frame).setVisible(true);

}
 
源代码10 项目: netbeans   文件: DragWindow.java
private Timer createInitialEffect() {
    final Timer timer = new Timer(100, null);
    timer.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            if( contentAlpha < 1.0f ) {
                contentAlpha += ALPHA_INCREMENT;
            } else {
                timer.stop();
            }
            if( contentAlpha > 1.0f )
                contentAlpha = 1.0f;
            repaintImageBuffer();
            repaint();
        }
    });
    timer.setInitialDelay(0);
    return timer;
}
 
源代码11 项目: netbeans   文件: ButtonFactory.java
/**
 * Creates button to maximize currently selected document in the given tab displayer.
 * @param controller Tab displayer's controller.
 * @return Button to maximize selected document tab.
 */
public static JButton createMaximizeButton( final Controller controller ) {
    final JButton btn = new JButton();
    Icon icon = UIManager.getIcon("nb.multitabs.button.maximize.icon");
    if (icon == null) {
        icon = ImageUtilities.loadImageIcon( "org/netbeans/core/multitabs/resources/maximize.png", true ); //NOI18N
    }
    btn.setIcon( icon );
    btn.setToolTipText( NbBundle.getMessage(ButtonFactory.class, "Hint_MaximizeRestore") );
    btn.addActionListener( new ActionListener() {

        @Override
        public void actionPerformed( ActionEvent e ) {
            controller.postActionEvent( new TabActionEvent( btn, TabbedContainer.COMMAND_MAXIMIZE, -1 ) );
        }
    });
    btn.setFocusable( false );
    return btn;
}
 
源代码12 项目: netbeans   文件: ServiceProvidersTablePanel.java
/**
 * Creates a new instance of ServiceProvidersTablePanel
 */
public ServiceProvidersTablePanel(ServiceProvidersTableModel tablemodel, STSConfiguration stsConfig, ConfigVersion cfgVersion) {
    super(tablemodel);
    this.stsConfig = stsConfig;
    this.tablemodel = tablemodel;
    this.cfgVersion = cfgVersion;
    
    this.editButton.setVisible(true);

    addedProviders = new HashMap<String, ServiceProviderElement>();
    
    editActionListener = new EditActionListener();
    ActionListener editListener = WeakListeners.create(ActionListener.class,
            editActionListener, editButton);
    editButton.addActionListener(editListener);

    addActionListener = new AddActionListener();
    ActionListener addListener = WeakListeners.create(ActionListener.class,
            addActionListener, addButton);
    addButton.addActionListener(addListener);
    
    removeActionListener = new RemoveActionListener();
    ActionListener removeListener = WeakListeners.create(ActionListener.class,
            removeActionListener, removeButton);
    removeButton.addActionListener(removeListener);
}
 
源代码13 项目: openAGV   文件: GroupContext.java
@Override
public JPopupMenu getPopupMenu(final Set<UserObject> selectedUserObjects) {
  JPopupMenu menu = new JPopupMenu();
  ResourceBundleUtil labels = ResourceBundleUtil.getBundle(I18nPlantOverview.TREEVIEW_PATH);

  JMenuItem item = new JMenuItem(labels.getString("groupsMouseAdapter.popupMenuItem_removeFromGroup.text"));
  item.addActionListener(new ActionListener() {

    @Override
    public void actionPerformed(ActionEvent e) {
      openTCSView.removeGroupMembers(selectedUserObjects);
    }
  });

  menu.add(item);

  return menu;
}
 
源代码14 项目: ramus   文件: Preferences.java
private Component createLocationSector() {
    JPanel panel = new JPanel(new BorderLayout());
    location = new JTextField();
    location.setPreferredSize(new Dimension(180, location
            .getPreferredSize().height));
    JButton button = new JButton("...");
    button.setToolTipText("Base.Location.ToolTip");
    button.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            JFileChooser chooser = new JFileChooser(location.getText());
            chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
            chooser.setAcceptAllFileFilterUsed(false);
            if (chooser.showOpenDialog(Preferences.this) == JFileChooser.APPROVE_OPTION) {
                location.setText(chooser.getSelectedFile()
                        .getAbsolutePath());
            }

        }
    });
    panel.add(location, BorderLayout.CENTER);
    panel.add(button, BorderLayout.EAST);
    return panel;
}
 
源代码15 项目: ramus   文件: ReportEditorView.java
protected JToggleButton createOpenViewButton(ButtonGroup group,
                                             final SubView view) {
    JToggleButton button = new JToggleButton(view.getTitle());
    group.add(button);
    button.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            actionsRemoved(activeView.getActions());
            beforeSubviewActivated(view);
            content.removeAll();
            content.add(view, BorderLayout.CENTER);
            content.revalidate();
            content.repaint();
            activeView = view;
            actionsAdded(view.getActions());
        }
    });

    return button;
}
 
源代码16 项目: btdex   文件: RotatingIcon.java
public RotatingIcon(Icon icon) {
	delegateIcon = icon;
	
	rotatingTimer = new Timer( 200, new ActionListener() {
		@Override
		public void actionPerformed( ActionEvent e ) {
			angleInDegrees = angleInDegrees + 40;
			if ( angleInDegrees == 360 ){
				angleInDegrees = 0;
			}
			
			for(DefaultTableModel model : cells.keySet()) {
				for(Point c : cells.get(model))
					model.fireTableCellUpdated(c.x, c.y);					
			}
		}
	} );
	rotatingTimer.setRepeats( false );
	rotatingTimer.start();
}
 
源代码17 项目: netbeans   文件: TemplateChooserPanel.java
@Override
public Component getComponent() {
    if (gui == null) {
        gui = new TemplateChooserPanelGUI(includeTemplatesWithProjects);
        gui.addChangeListener(this);
        gui.setDefaultActionListener(new ActionListener() {

            @Override
            public void actionPerformed( ActionEvent e ) {
                if( null != wizard ) {
                    wizard.doNextClick();
                }
            }
        });
    }
    return gui;
}
 
public ActionListener roomTypeActionListener() {
	ActionListener rta = (ActionEvent e) -> {
		final String TYPE = roomTypeCmbBox.getSelectedItem().toString();

		switch (TYPE) {
		case "SINGLE":
			personCountSpinner.setValue(1);
			break;
		case "DOUBLE":
			personCountSpinner.setValue(2);
			break;
		case "TWIN":
			personCountSpinner.setValue(2);
			break;
		case "TRIPLE":
			personCountSpinner.setValue(3);
			break;
		default:
			break;
		}
		repaint();
	};
	return rta;
}
 
源代码19 项目: netbeans   文件: DialogDisplayer50960Test.java
public void testRedundantActionPerformed () {
    JButton b1 = new JButton ("Do");
    JButton b2 = new JButton ("Don't");
    ActionListener listener = new ActionListener () {
        public void actionPerformed (ActionEvent event) {
            assertFalse ("actionPerformed() only once.", performed);
            performed = true;
        }
    };
    DialogDescriptor dd = new DialogDescriptor (
                        "...",
                        "My Dialog",
                        true,
                        new JButton[] {b1, b2},
                        b2,
                        DialogDescriptor.DEFAULT_ALIGN,
                        null,
                        null
                    );
    dd.setButtonListener (listener);
    Dialog dlg = DialogDisplayer.getDefault ().createDialog (dd);
    b1.doClick ();
    assertTrue ("Button b1 invoked.", performed);
}
 
源代码20 项目: TencentKona-8   文件: Font2DTest.java
public ChoiceV2( ActionListener al, boolean fontChoice) {
    this(al);
    if(fontChoice) {
        //Register this component in ToolTipManager
        setToolTipText("");
        bitSet = new BitSet();
        setRenderer(new ChoiceV2Renderer(this));
    }
}
 
源代码21 项目: netbeans   文件: BalloonManager.java
/**
 * Show balloon-like tooltip pointing to the given component. The balloon stays
 * visible until dismissed by clicking its 'close' button or by invoking its default action.
 * @param owner The component which the balloon will point to
 * @param content Content to be displayed in the balloon.
 * @param defaultAction Action to invoked when the balloon is clicked, can be null.
 * @param timeoutMillies Number of milliseconds before the balloon disappears, 0 to keep it visible forever
 */
public static synchronized void show( final JComponent owner, JComponent content, ActionListener defaultAction, ActionListener dismissAction, int timeoutMillis ) {
    assert null != owner;
    assert null != content;
    
    //hide current balloon (if any)
    dismiss();
        
    currentBalloon = new Balloon( content, defaultAction, dismissAction, timeoutMillis );
    currentPane = JLayeredPane.getLayeredPaneAbove( owner );
    
    listener = new ComponentListener() {
        public void componentResized(ComponentEvent e) {
            dismiss();
        }

        public void componentMoved(ComponentEvent e) {
            dismiss();
        }

        public void componentShown(ComponentEvent e) {
        }

        public void componentHidden(ComponentEvent e) {
            dismiss();
        }
    };
    windowListener = new WindowStateListener() {
        public void windowStateChanged(WindowEvent e) {
            dismiss();
        }
    };
    ownerWindow = SwingUtilities.getWindowAncestor(owner);
    if( null != ownerWindow ) {
        ownerWindow.addWindowStateListener(windowListener);
    }
    currentPane.addComponentListener( listener );
    configureBalloon( currentBalloon, currentPane, owner );
    currentPane.add( currentBalloon, new Integer(JLayeredPane.POPUP_LAYER-1) );
}
 
源代码22 项目: ghidra   文件: NewTestApp.java
public static void main(String[] args) {
	try {
		UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
	}
	catch (Exception e1) {
	}
	System.setProperty(SystemUtilities.HEADLESS_PROPERTY, Boolean.FALSE.toString());
	JFrame frame = new JFrame("Test App");
	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	Container container = frame.getContentPane();
	container.setLayout(new BorderLayout());
	final RootNode root = new RootNode(new File("C:\\clear_svn\\Ghidra_trunk\\Ghidra"));
	final GTree tree = new GTree(root);
	tree.setDragNDropHandler(new DragNDropHandler());
	container.add(tree, BorderLayout.CENTER);
	JButton button = new JButton("Push Me");
	container.add(button, BorderLayout.SOUTH);
	frame.setSize(400, 600);
	frame.setVisible(true);
	button.addActionListener(new ActionListener() {
		@Override
		public void actionPerformed(ActionEvent e) {
			TreePath selectionPath = tree.getSelectionPath();
			if (selectionPath != null) {
				GTreeNode node = (GTreeNode) selectionPath.getLastPathComponent();
				tree.collapseAll(node);
			}
		}
	});

}
 
源代码23 项目: netcdf-java   文件: GridController.java
public GridController(GridUI ui, PreferencesExt store) {
  this.ui = ui;
  this.store = store;

  // colorscale
  Object bean = store.getBean(ColorScaleName, null);
  if (!(bean instanceof ColorScale))
    cs = new ColorScale("default");
  else
    cs = (ColorScale) store.getBean(ColorScaleName, null);

  // set up the renderers; Maps are added by addMapBean()
  renderGrid = new GridRenderer();
  renderGrid.setColorScale(cs);
  // renderWind = new WindRenderer();

  // stride
  strideSpinner = new JSpinner(new SpinnerNumberModel(1, 1, 100, 1));
  strideSpinner.addChangeListener(e -> {
    Integer val = (Integer) strideSpinner.getValue();
    renderGrid.setHorizStride(val);
  });

  // timer
  redrawTimer = new javax.swing.Timer(0, new ActionListener() {
    public void actionPerformed(ActionEvent e) {
      SwingUtilities.invokeLater(new Runnable() { // invoke in event thread
        public void run() {
          draw(false);
        }
      });
      redrawTimer.stop(); // one-shot timer
    }
  });
  redrawTimer.setInitialDelay(DELAY_DRAW_AFTER_DATA_EVENT);
  redrawTimer.setRepeats(false);

  makeActions();
}
 
源代码24 项目: TencentKona-8   文件: Test6179222.java
public static void main(String[] args) {
    Test6179222 test = new Test6179222();
    // test 6179222
    test(EventHandler.create(ActionListener.class, test, "foo", "source.icon"));
    // test 6265540
    test(EventHandler.create(ActionListener.class, test, "bar.doit"));
    if (!test.bar.invoked) {
        throw new Error("Bar was not set");
    }
}
 
源代码25 项目: openjdk-jdk9   文件: Font2DTest.java
public ChoiceV2( ActionListener al, boolean fontChoice) {
    this(al);
    if(fontChoice) {
        //Register this component in ToolTipManager
        setToolTipText("");
        bitSet = new BitSet();
        setRenderer(new ChoiceV2Renderer(this));
    }
}
 
源代码26 项目: openjdk-jdk8u-backup   文件: bug7189299.java
private static void verifySingleDefaultButtonModelListener() {
    HTMLEditorKit htmlEditorKit = (HTMLEditorKit) html.getEditorKit();
    StyleContext.NamedStyle style = ((StyleContext.NamedStyle) htmlEditorKit
            .getInputAttributes());
    DefaultButtonModel model = ((DefaultButtonModel) style
            .getAttribute(StyleConstants.ModelAttribute));
    ActionListener[] listeners = model.getActionListeners();
    int actionListenerNum = listeners.length;
    if (actionListenerNum != 1) {
        throw new RuntimeException(
                "Expected single ActionListener object registered with "
                + "DefaultButtonModel; found " + actionListenerNum
                + " listeners registered.");
    }

    int changeListenerNum = model.getChangeListeners().length;
    if (changeListenerNum != 1) {
        throw new RuntimeException(
                "Expected at most one ChangeListener object registered "
                + "with DefaultButtonModel; found " + changeListenerNum
                + " listeners registered.");
    }
    int itemListenerNum = model.getItemListeners().length;
    if (itemListenerNum != 1) {
        throw new RuntimeException(
                "Expected at most one ItemListener object registered "
                + "with DefaultButtonModel; found " + itemListenerNum
                + " listeners registered.");
    }
}
 
源代码27 项目: mts   文件: GUIMenuHelper.java
private JMenu createJMenuHelp(ActionListener actionListener) {
    JMenu jMenu = new JMenu("Help");
    jMenu.add(createJMenuItem(actionListener, "Documentation", HELP_DOCUMENTATION));
    jMenu.add(createJMenuItem(actionListener, "XML Grammar", XML_GRAMMAR));
    jMenu.add(new javax.swing.JSeparator());
    jMenu.add(createJMenuItem(actionListener, "Web Site", HELP_WEBSITE));
    jMenu.add(createJMenuItem(actionListener, "Source Forge", SOURCE_FORGE));
    jMenu.add(new javax.swing.JSeparator());
    jMenu.add(createJMenuItem(actionListener, "About", HELP_ABOUT));
    
    return jMenu;
}
 
/**
 * create returns the thumb close component
 *
 * @param p
 * @return
 */
private JComponent setupThumbClose(final JPanel p) {
    JCheckBox cb = new JCheckBox();
    cb.setIcon(close);
    cb.setSelectedIcon(closesel);
    cb.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            removeThumbPanel(p);
        }
    });
    cb.setPreferredSize(CL_SIZE);
    cb.setMaximumSize(CL_SIZE);
    return cb;
}
 
源代码29 项目: rcrs-server   文件: KernelStartupPanel.java
private CheckboxPanel(Collection<? extends Component> available, final KernelStartupOptions options) {
    GridBagLayout layout = new GridBagLayout();
    GridBagConstraints c = new GridBagConstraints();
    c.gridx = 0;
    c.gridy = 0;
    c.weightx = 1;
    c.weighty = 1;
    c.gridwidth = 1;
    c.gridheight = 1;
    c.fill = GridBagConstraints.BOTH;
    c.anchor = GridBagConstraints.CENTER;
    setLayout(layout);
    for (Component t : available) {
        c.gridx = 0;
        c.weightx = 1;
        JLabel l = new JLabel(t.getName());
        layout.setConstraints(l, c);
        add(l);
        c.gridx = 1;
        c.weightx = 0;
        final JCheckBox check = new JCheckBox();
        check.setSelected(options.getInstanceCount(t) > 0);
        options.setInstanceCount(t, check.isSelected() ? 1 : 0);
        layout.setConstraints(check, c);
        add(check);
        ++c.gridy;
        final Component comp = t;
        check.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    options.setInstanceCount(comp, check.isSelected() ? 1 : 0);
                }
            });
    }
}
 
QuarkusCodeEndpointChooserStep(WizardContext wizardContext) {
    this.customUrlWithBrowseButton = new ComponentWithBrowseButton(this.endpointURL, new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            try {
                QuarkusCodeEndpointChooserStep.this.validate();
                BrowserUtil.browse(QuarkusCodeEndpointChooserStep.this.endpointURL.getText());
            } catch (ConfigurationException var3) {
                Messages.showErrorDialog(var3.getMessage(), "Cannot Open URL");
            }

        }
    });
    this.wizardContext = wizardContext;
    String lastServiceUrl = PropertiesComponent.getInstance().getValue(LAST_ENDPOINT_URL, QUARKUS_CODE_URL);
    if (!lastServiceUrl.equals(QUARKUS_CODE_URL)) {
        this.endpointURL.setSelectedItem(lastServiceUrl);
        this.defaultRadioButton.setSelected(false);
        this.customRadioButton.setSelected(true);
    } else {
        this.defaultRadioButton.setSelected(true);
    }

    List<String> history = this.endpointURL.getHistory();
    history.remove(QUARKUS_CODE_URL);
    this.endpointURL.setHistory(history);
    this.updateCustomUrl();
}