Package org.jdesktop.swingx.action

Examples of org.jdesktop.swingx.action.ActionManager


        // well supported with the current design ... nobody
        // really cares about enabled as it should.
        //
        Runnable doEnabled = new Runnable() {
                public void run() {
                    ActionManager manager = ActionManager.getInstance();
                    manager.setEnabled(ACTION_UNDO, undoManager.canUndo());
                    manager.setEnabled(ACTION_REDO, undoManager.canRedo());
                }
            };
        SwingUtilities.invokeLater(doEnabled);
    }
View Full Code Here


           
            Element elem = document.getCharacterElement(dot);
            AttributeSet set = elem.getAttributes();

            // JW: see comment in updateActionState
            ActionManager manager = ActionManager.getInstance();
            manager.setSelected("font-bold", StyleConstants.isBold(set));
            manager.setSelected("font-italic", StyleConstants.isItalic(set));
            manager.setSelected("font-underline", StyleConstants.isUnderline(set));

            elem = document.getParagraphElement(dot);
            set = elem.getAttributes();

            // Update the paragraph selector if applicable.
            if (selector != null) {
                selector.setSelectedItem(set.getAttribute(StyleConstants.NameAttribute));
            }

            switch (StyleConstants.getAlignment(set)) {
                // XXX There is a bug here. the setSelected method
                // should only affect the UI actions rather than propagate
                // down into the action map actions.
            case StyleConstants.ALIGN_LEFT:
                manager.setSelected("left-justify", true);
                break;

            case StyleConstants.ALIGN_CENTER:
                manager.setSelected("center-justify", true);
                break;

            case StyleConstants.ALIGN_RIGHT:
                manager.setSelected("right-justify", true);
                break;
            }
        }
View Full Code Here

    //
    // -------------------------------------------------------------------------------------------------------
    private void initButtonPanel() {
        // String model = getModel();
        // RackList rackList = SampleBeanController.getRackList(model);
        ActionManager actionManager = ActionManager.getInstance();
        buttonPanel = new JPanel();

        // Initiate the button for validation
        Icon iconValite = icons.getIcon("samples.validate");
        Action validateAction = new ValidateConfigurationAction("Validation",
                iconValite, samplesManagerModel);
        valiteButton = new JButton("Validation");
        valiteButton.setAction(validateAction);
        actionManager.addAction(validateAction);
        buttonPanel.add(valiteButton);

        // Initiate the button for reset
        Icon iconReset = icons.getIcon("samples.clearLine");
        Action resetAction = new ResetAction("Reset", iconReset, samplesManagerModel);
        actionManager.addAction(resetAction);
        resetButton = new JButton("Reset");
        resetButton.setIcon(iconReset);
        resetButton.setAction(resetAction);
        buttonPanel.add(resetButton);
View Full Code Here

        JMenu addMenu = new JMenu("Add Sample");
        addMenu.setIcon(icons.getIcon("samples.add"));

        CellPosition[] positions = CellPosition.values();

        ActionManager actionManager = ActionManager.getInstance();

        for (int i = 0; i < positions.length; i++) {
            CellPosition cellPosition = positions[i];
            String cellName = cellPosition.name();
            JMenuItem add_menuItem = new JMenuItem(cellName);
            Action addSampleAction = new AddSampleAction(cellPosition, treePath);
            actionManager.addAction(addSampleAction);
            add_menuItem.setAction(addSampleAction);
            addMenu.add(add_menuItem);
        }

        popupMenu.add(addMenu);
        // ----------------------------------------------------------------------
        // ---------------------------------
        //
        // Initiate the deleteMenu for delete samples.
        //
        // ----------------------------------------------------------------------
        // ---------------------------------
        JMenu deleteMenu = new JMenu("Delete Samples");
        deleteMenu.setIcon(icons.getIcon("samples.remove"));

        for (int i = 0; i < positions.length; i++) {
            CellPosition cellPosition = positions[i];
            String cellName = cellPosition.name();
            JMenuItem del_menuItem = new JMenuItem(cellName);
            Action deleteSampleAction = new DeleteSampleAction(cellPosition, treePath);
            actionManager.addAction(deleteSampleAction);
            del_menuItem.setAction(deleteSampleAction);
            deleteMenu.add(del_menuItem);
        }
        popupMenu.add(deleteMenu);

        // ----------------------------------------------------------------------
        // ---------------------------------
        //
        // Initiate the moveMenu for change the position of the sample.
        //
        // ----------------------------------------------------------------------
        // ---------------------------------
        JMenu moveMenu = new JMenu("Move Sample");
        moveMenu.setIcon(icons.getIcon("samples.move"));

        for (int i = 0; i < positions.length; i++) {
            CellPosition cellPosition = positions[i];
            String cellName = cellPosition.name();
            JMenuItem mov_menuItem = new JMenuItem(cellName);
            Action moveSampleAction = new MoveSampleAction(cellPosition, treePath);
            actionManager.addAction(moveSampleAction);
            mov_menuItem.setAction(moveSampleAction);
            moveMenu.add(mov_menuItem);
        }
        popupMenu.add(moveMenu);

        popupMenu.addSeparator();

        // ----------------------------------------------------------------------
        // ---------------------------------
        //
        // Initiate the getPositionMenu to find the sample.
        //
        // ----------------------------------------------------------------------
        // ---------------------------------
        Icon getPositionIcon = icons.getIcon("samples.getPosition");
        Action getPositionAction = new GetPositionAction("Get Position", getPositionIcon, treePath,
                treeTableModel);
        actionManager.addAction(getPositionAction);
        popupMenu.add(getPositionAction);
        // ----------------------------------------------------------------------
        // ---------------------------------
        //
        // Initiate the cleanLineMenu to clean the sample.
        //
        // ----------------------------------------------------------------------
        // ---------------------------------
        Icon cleanLineIcon = icons.getIcon("samples.clearLine");

        Action cleanLineAction = new CleanLineAction("Clean Line", cleanLineIcon, treePath,
                treeTableModel);
        actionManager.addAction(cleanLineAction);
        popupMenu.add(cleanLineAction);

        return popupMenu;
    }
View Full Code Here

    add(northPanel, BorderLayout.NORTH);

    // Add create batch button
    JButton createBatchButton = new JButton("Create Batch");
    Action createBatchAction = new CreateBatchAction();
    ActionManager actionManager = ActionManager.getInstance();
    actionManager.addAction(createBatchAction);
    createBatchButton.setAction(createBatchAction);
    createBatchButton.setPreferredSize(new Dimension(140, 25));
    JPanel buttonPanel = new JPanel();
    buttonPanel.add(createBatchButton);
    add(buttonPanel, BorderLayout.CENTER);
View Full Code Here

    //
    // -------------------------------------------------------------------------------------------------------
    private void initButtonPanel() {
        // String model = getModel();
        // RackList rackList = SampleBeanController.getRackList(model);
        ActionManager actionManager = ActionManager.getInstance();
        buttonPanel = new JPanel();

        // Initiate the button for validation
        Icon iconValite = icons.getIcon("samples.validate");
        Action validateAction = new ValidateConfigurationAction("Validation", iconValite,
                samplesManagerModel);
        valiteButton = new JButton("Validation");
        valiteButton.setAction(validateAction);
        actionManager.addAction(validateAction);
        buttonPanel.add(valiteButton);

        // Initiate the button for reset
        Icon iconReset = icons.getIcon("samples.clearLine");
        Action resetAction = new ResetAction("Reset", iconReset, samplesManagerModel);
        actionManager.addAction(resetAction);
        resetButton = new JButton("Reset");
        resetButton.setIcon(iconReset);
        resetButton.setAction(resetAction);
        buttonPanel.add(resetButton);
View Full Code Here

    super(LABEL);
    setActionCommand(LABEL);
  }

  public void actionPerformed(ActionEvent arg0) {
    ActionManager actionManager = ActionManager.getInstance();
    Action validateAction = actionManager
        .getAction(ValidateConfigurationAction.ACTION_COMMAND);

    if (validateAction != null) {
      validateAction.actionPerformed(arg0);
      SequencerController.createBatchInSequencer();
View Full Code Here

    JMenu addMenu = new JMenu("Add Sample");
    addMenu.setIcon(icons.getIcon("samples.add"));

    CellPosition[] positions = CellPosition.values();

    ActionManager actionManager = ActionManager.getInstance();

    for (int i = 0; i < positions.length; i++) {
      CellPosition cellPosition = positions[i];
      String cellName = cellPosition.name();
      JMenuItem add_menuItem = new JMenuItem(cellName);
      Action addSampleAction = new AddSampleAction(cellPosition, treePath);
      actionManager.addAction(addSampleAction);
      add_menuItem.setAction(addSampleAction);
      addMenu.add(add_menuItem);
    }

    popupMenu.add(addMenu);
    // ----------------------------------------------------------------------
    // ---------------------------------
    //
    // Initiate the deleteMenu for delete samples.
    //
    // ----------------------------------------------------------------------
    // ---------------------------------
    JMenu deleteMenu = new JMenu("Delete Samples");
    deleteMenu.setIcon(icons.getIcon("samples.remove"));

    for (int i = 0; i < positions.length; i++) {
      CellPosition cellPosition = positions[i];
      String cellName = cellPosition.name();
      JMenuItem del_menuItem = new JMenuItem(cellName);
      Action deleteSampleAction = new DeleteSampleAction(cellPosition,
          treePath);
      actionManager.addAction(deleteSampleAction);
      del_menuItem.setAction(deleteSampleAction);
      deleteMenu.add(del_menuItem);
    }
    popupMenu.add(deleteMenu);

    // ----------------------------------------------------------------------
    // ---------------------------------
    //
    // Initiate the moveMenu for change the position of the sample.
    //
    // ----------------------------------------------------------------------
    // ---------------------------------
    JMenu moveMenu = new JMenu("Move Sample");
    moveMenu.setIcon(icons.getIcon("samples.move"));

    for (int i = 0; i < positions.length; i++) {
      CellPosition cellPosition = positions[i];
      String cellName = cellPosition.name();
      JMenuItem mov_menuItem = new JMenuItem(cellName);
      Action moveSampleAction = new MoveSampleAction(cellPosition,
          treePath);
      actionManager.addAction(moveSampleAction);
      mov_menuItem.setAction(moveSampleAction);
      moveMenu.add(mov_menuItem);
    }
    popupMenu.add(moveMenu);

    popupMenu.addSeparator();

    // ----------------------------------------------------------------------
    // ---------------------------------
    //
    // Initiate the getPositionMenu to find the sample.
    //
    // ----------------------------------------------------------------------
    // ---------------------------------
    Icon getPositionIcon = icons.getIcon("samples.getPosition");
    Action getPositionAction = new GetPositionAction("Get Position",
        getPositionIcon, treePath, treeTableModel);
    actionManager.addAction(getPositionAction);
    popupMenu.add(getPositionAction);
    // ----------------------------------------------------------------------
    // ---------------------------------
    //
    // Initiate the cleanLineMenu to clean the sample.
    //
    // ----------------------------------------------------------------------
    // ---------------------------------
    Icon cleanLineIcon = icons.getIcon("samples.clearLine");

    Action cleanLineAction = new CleanLineAction("Clean Line",
        cleanLineIcon, treePath, treeTableModel);
    actionManager.addAction(cleanLineAction);
    popupMenu.add(cleanLineAction);

    return popupMenu;
  }
View Full Code Here

    //
    // -------------------------------------------------------------------------------------------------------
    private void initButtonPanel() {
        // String model = getModel();
        // RackList rackList = SampleBeanController.getRackList(model);
        ActionManager actionManager = ActionManager.getInstance();
        buttonPanel = new JPanel();

        // Initiate the button for validation
        Icon iconValite = icons.getIcon("samples.validate");
        Action validateAction = new ValidateConfigurationAction("Validation",
                iconValite, samplesManagerModel);
        valiteButton = new JButton("Validation");
        valiteButton.setAction(validateAction);
        actionManager.addAction(validateAction);
        buttonPanel.add(valiteButton);

        // Initiate the button for reset
        Icon iconReset = icons.getIcon("samples.clearLine");
        Action resetAction = new ResetAction("Reset", iconReset, samplesManagerModel);
        actionManager.addAction(resetAction);
        resetButton = new JButton("Reset");
        resetButton.setIcon(iconReset);
        resetButton.setAction(resetAction);
        buttonPanel.add(resetButton);
View Full Code Here

TOP

Related Classes of org.jdesktop.swingx.action.ActionManager

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.