Package javax.swing

Examples of javax.swing.AbstractButton$AccessibleAbstractButton$ButtonKeyBinding


      final TableLayout btbl = new TableLayout(bPanelSize);

      final Container buttonPanel = new JPanel(btbl);
      _excludePanel.add(buttonPanel, "3, 1, 3, 1");

      final AbstractButton addButton = new JButton();
      final Action action = new BrowseAction(_parent, "Add...", new ExtensionFileFilter(FindBugsUtil.XML_EXTENSIONS_SET), new BrowseActionCallback() {
        @Override
        public void addSelection(final File selectedFile) {
          final String replacement = IdeaUtilImpl.collapsePathMacro(_parent.getProject(), selectedFile.getAbsolutePath());
          //noinspection unchecked
          ((DefaultListModel) _excludeList.getModel()).addElement(replacement);
          _preferences.getExcludeFilters().add(replacement);
          _preferences.setModified(true);
        }
      });
      addButton.setAction(action);
      buttonPanel.add(addButton, "1, 1, 1, 1");

      final AbstractButton removeButton = new JButton("Remove") {


        @Override
        public boolean isEnabled() {
          return super.isEnabled() && _excludeList.getSelectedIndex() > -1;
        }
      };
      removeButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(final ActionEvent e) {
          final int index = _excludeList.getSelectedIndex();
          getModel(_excludeList).remove(index);
          _preferences.removeExcludeFilter(index);
View Full Code Here


      final TableLayout btbl = new TableLayout(bPanelSize);

      final Container buttonPanel = new JPanel(btbl);
      _baselinePanel.add(buttonPanel, "3, 1, 3, 1");

      final AbstractButton addButton = new JButton();
      final Action action = new BrowseAction(_parent, "Add...", new ExtensionFileFilter(FindBugsUtil.XML_EXTENSIONS_SET), new BrowseActionCallback() {
        @Override
        public void addSelection(final File selectedFile) {
          final String replacement = IdeaUtilImpl.collapsePathMacro(_parent.getProject(), selectedFile.getAbsolutePath());
          //noinspection unchecked
          ((DefaultListModel) _baselineList.getModel()).addElement(replacement);
          _preferences.getExcludeBaselineBugs().add(replacement);
          _preferences.setModified(true);
        }
      });
      addButton.setAction(action);
      buttonPanel.add(addButton, "1, 1, 1, 1");

      final AbstractButton removeButton = new JButton("Remove") {


        @Override
        public boolean isEnabled() {
          return super.isEnabled() && _baselineList.getSelectedIndex() > -1;
        }
      };
      removeButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(final ActionEvent e) {
          final int index = _baselineList.getSelectedIndex();
          getModel(_baselineList).remove(index);
          _preferences.removeBaselineExcludeFilter(index);
View Full Code Here

      final TableLayout tableLayout = new TableLayout(bPanelSize);

      final Container buttonPanel = new JPanel(tableLayout);
      _pluginsPanel.add(buttonPanel, "3, 1, 3, 1");

      final AbstractButton addButton = new JButton();
      final Action action = new BrowseAction(_parent, "Add Plugin...", new ExtensionFileFilter(FindBugsUtil.PLUGINS_EXTENSIONS_SET), new BrowseActionCallback() {
        public void addSelection(final File selectedFile) {
          doAddPlugin(selectedFile);
        }
      });
      addButton.setAction(action);
      buttonPanel.add(addButton, "1, 1, 1, 1");

    }

    return _pluginsPanel;
View Full Code Here

    _importFile.setPreferredSize(new Dimension(200, 20));
    c.weightx = 1;
    c.gridwidth = 1;
    add(_importFile, c);

    final AbstractButton browseButton = new JButton("Browse");
    browseButton.addActionListener(new MyFileChooserActionListener());
    c.weightx = 0;
    add(browseButton, c);

    c.gridx = GridBagConstraints.RELATIVE;
    c.gridy = 2;
View Full Code Here

        text = pluginId;
      }

      final String pluginUrl = FindBugsCustomPluginUtil.getAsString(plugin);
      final boolean enabled = isEnabled(currentProject, plugin);
      final AbstractButton checkbox = new JCheckBox();
      checkbox.setEnabled(enabled);
      checkbox.setBackground(PLUGIN_DESCRIPTION_BG_COLOR);
      _component.add(checkbox,"1, 1, 1, 1, L, T");

      final String longText = plugin.getDetailedDescription();
      if (longText != null) {
        checkbox.setToolTipText("<html>" + longText + "</html>");
      }
      checkbox.setSelected(isSelected(currentProject, plugin, userPlugin));
      checkbox.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
          if (checkbox.isSelected()) {
            if (userPlugin) {
              _preferences.addUserPlugin(pluginUrl, pluginId, true);
            } else {
              _preferences.addBundledPlugin(pluginId, true);
            }
          } else {
            if (userPlugin) {
              final String[] options = {
                  "Disable",
                  "Remove",
                  "Cancel"
              };
              final int answer = Messages.showDialog(checkbox, "Would you like to disable or remove the plugin?", "Disable or Remove", options, 0, Messages.getQuestionIcon());
              if (0 == answer) {
                _preferences.addUserPlugin(pluginUrl, pluginId, false);
              } else if (1 == answer) {
                _preferences.removeUserPlugin(pluginUrl);
              } else {
                // cancel ; restore
                checkbox.setSelected(true);
              }
            } else {
              _preferences.addBundledPlugin(pluginId, false);
            }
          }
View Full Code Here

      final JComponent exportDirLabel = new JLabel("Export Dir");
      exportDirLabel.setToolTipText("Set the default export directory. if not set selection dialog will be shown.");
      _exportDirPanel.add(exportDirLabel, "1, 1, 1, 1");
      _exportDirPanel.add(getExportDirTextField(), "3, 1, 3, 1");

      final AbstractButton browseButton = new JButton("Browse");
      browseButton.setPreferredSize(new Dimension(80, 20));
      browseButton.addActionListener(new FileChooserActionListener());
      _exportDirPanel.add(browseButton, "5, 1, 5, 1");

      _exportDirPanel.add(getExportDirFormatCheckbox(), "1, 3, 1, 3");
      _exportDirPanel.add(new JLabel("Create archive sub dir(s) in the following format (MM_TT_YYYY)"), "3, 3, 3, 3");
    }
View Full Code Here

public class AbstractButtonWiringHarness implements WiringHarness<Bound, Field> {

    public Collection<Binding> wire(Bound bound, BindingContext context, Field field)
            throws IllegalAccessException, IntrospectionException {
        Mutator mutator = Mutator.create(context, bound.to());
        AbstractButton abstractButton = context.getFieldObject(field, AbstractButton.class);
        return ImmutableList.of(bindAbstractButton(mutator, abstractButton));
    }
View Full Code Here

        if(btg == null){
            return;
        }
        Enumeration<AbstractButton> e = btg.getElements();
        while(e.hasMoreElements()){
            AbstractButton bt = e.nextElement();
            if(bt.getActionCommand().equals(value)){
                btg.setSelected(bt.getModel(), true);
                break;
            }
        }
    }
View Full Code Here

            allowedScriptOrigin = "" + ResourceOrigin.NONE;
        }

        Enumeration e = scriptOriginGroup.getElements();
        while (e.hasMoreElements()) {
            AbstractButton ab = (AbstractButton)e.nextElement();
            String ac = ab.getActionCommand();
            if (allowedScriptOrigin.equals(ac)) {
                ab.setSelected(true);
            }
        }

        String allowedResourceOrigin = "" + model.getInteger(PREFERENCE_KEY_ALLOWED_EXTERNAL_RESOURCE_ORIGIN);
        if (allowedResourceOrigin == null || "".equals(allowedResourceOrigin)) {
            allowedResourceOrigin = "" + ResourceOrigin.NONE;
        }

        e = resourceOriginGroup.getElements();
        while (e.hasMoreElements()) {
            AbstractButton ab = (AbstractButton)e.nextElement();
            String ac = ab.getActionCommand();
            if (allowedResourceOrigin.equals(ac)) {
                ab.setSelected(true);
            }
        }

        showRendering.setEnabled
            (!model.getBoolean(PREFERENCE_KEY_ENABLE_DOUBLE_BUFFERING));
View Full Code Here

 
  public List getElements() {
    Enumeration<AbstractButton> elements = this.group.getElements();
    List list=new ArrayList();
    while(elements.hasMoreElements()){
      AbstractButton aButton = elements.nextElement();
      list.add(WidgetAdapter.getWidgetAdapter(aButton));
    }
    return list;
  }
View Full Code Here

TOP

Related Classes of javax.swing.AbstractButton$AccessibleAbstractButton$ButtonKeyBinding

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.