コード例 #1
0
 private MergeDupLines() {
   super(
       UsageViewImpl.this,
       UsageViewBundle.message("action.merge.same.line"),
       IconLoader.getIcon("/toolbar/filterdups.png"));
   setShortcutSet(
       new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_F, InputEvent.CTRL_DOWN_MASK)));
 }
コード例 #2
0
  // Private helper methods
  private void createMenuBar() {
    menuBar = new JMenuBar();
    fileMenu = new JMenu("File");

    miOpen = new JMenuItem("Open...");
    miOpen.setAccelerator(
        KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.Event.META_MASK));
    fileMenu.add(miOpen).setEnabled(false);
    miOpen.addActionListener(new MenuActionListener());

    miSave = new JMenuItem("Save Selected...");
    miSave.setAccelerator(
        KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.Event.META_MASK));
    fileMenu.add(miSave).setEnabled(false);
    miSave.addActionListener(new MenuActionListener());

    miSaveAll = new JMenuItem("Save All...");
    fileMenu.add(miSaveAll).setEnabled(false);
    miSaveAll.addActionListener(new MenuActionListener());

    menuBar.add(fileMenu);
  }
コード例 #3
0
  protected void fillToolbarActions(DefaultActionGroup group) {
    final boolean alphabeticallySorted = PropertiesComponent.getInstance().isTrueValue(PROP_SORTED);
    if (alphabeticallySorted) {
      setSortComparator(new OrderComparator());
    }
    myAlphabeticallySorted = alphabeticallySorted;
    group.add(mySortAction);

    if (!supportsNestedContainers()) {
      ShowContainersAction showContainersAction = getShowContainersAction();
      showContainersAction.registerCustomShortcutSet(
          new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.ALT_MASK)),
          myTree);
      setShowClasses(PropertiesComponent.getInstance().isTrueValue(PROP_SHOWCLASSES));
      group.add(showContainersAction);
    }
  }
コード例 #4
0
 protected MemberChooser(
     boolean allowEmptySelection,
     boolean allowMultiSelection,
     @NotNull Project project,
     boolean isInsertOverrideVisible,
     @Nullable JComponent headerPanel,
     @Nullable JComponent[] optionControls) {
   super(project, true);
   myAllowEmptySelection = allowEmptySelection;
   myAllowMultiSelection = allowMultiSelection;
   myProject = project;
   myIsInsertOverrideVisible = isInsertOverrideVisible;
   myHeaderPanel = headerPanel;
   myTree = createTree();
   myOptionControls = optionControls;
   mySortAction = new SortEmAction();
   mySortAction.registerCustomShortcutSet(
       new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_A, InputEvent.ALT_MASK)), myTree);
 }
コード例 #5
0
 protected void setupExcludedAction() {
   ToggleExcludedStateAction toggleExcludedAction = new ToggleExcludedStateAction(myTree, this);
   myEditingActionsGroup.add(toggleExcludedAction);
   toggleExcludedAction.registerCustomShortcutSet(
       new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_E, InputEvent.ALT_MASK)), myTree);
 }
コード例 #6
0
ファイル: HyperSearchResults.java プロジェクト: SELab/jEdit
  // {{{ HyperSearchResults constructor
  public HyperSearchResults(View view) {
    super(new BorderLayout());

    this.view = view;

    caption = new JLabel();

    Box toolBar = new Box(BoxLayout.X_AXIS);
    toolBar.add(caption);
    toolBar.add(Box.createGlue());

    ActionHandler ah = new ActionHandler();

    highlight = new RolloverButton();
    highlight.setToolTipText(jEdit.getProperty("hypersearch-results.highlight.label"));
    highlight.addActionListener(ah);
    toolBar.add(highlight);

    clear =
        new RolloverButton(
            GUIUtilities.loadIcon(jEdit.getProperty("hypersearch-results.clear.icon")));
    clear.setToolTipText(jEdit.getProperty("hypersearch-results.clear.label"));
    clear.addActionListener(ah);
    toolBar.add(clear);

    multi = new RolloverButton();
    multi.setToolTipText(jEdit.getProperty("hypersearch-results.multi.label"));
    multi.addActionListener(ah);
    toolBar.add(multi);

    stop =
        new RolloverButton(
            GUIUtilities.loadIcon(jEdit.getProperty("hypersearch-results.stop.icon")));
    stop.setToolTipText(jEdit.getProperty("hypersearch-results.stop.label"));
    stop.addActionListener(ah);
    toolBar.add(stop);
    stop.setEnabled(false);

    add(BorderLayout.NORTH, toolBar);

    resultTreeRoot = new DefaultMutableTreeNode();
    resultTreeModel = new DefaultTreeModel(resultTreeRoot);
    resultTree = new HighlightingTree(resultTreeModel);
    resultTree.setToolTipText(null);
    resultTree.setCellRenderer(new ResultCellRenderer());
    resultTree.setVisibleRowCount(16);
    resultTree.setRootVisible(false);
    resultTree.setShowsRootHandles(true);
    // the ESCAPE keystroke is assigned to hideTip action by swing
    // it breaks the action usually assigned to close-docking-area by jEdit,
    // so we remove this keystroke binding bug #1955140
    KeyStroke keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
    resultTree.getInputMap().remove(keyStroke);
    // looks bad with the OS X L&F, apparently...
    if (!OperatingSystem.isMacOSLF()) resultTree.putClientProperty("JTree.lineStyle", "Angled");

    resultTree.setEditable(false);

    resultTree.addKeyListener(new KeyHandler());
    resultTree.addMouseListener(new MouseHandler());

    JScrollPane scrollPane = new JScrollPane(resultTree);
    Dimension dim = scrollPane.getPreferredSize();
    dim.width = 400;
    scrollPane.setPreferredSize(dim);
    add(BorderLayout.CENTER, scrollPane);
    resultTree.setTransferHandler(new ResultTreeTransferHandler());
  } // }}}