Package org.eclipse.jface.action

Examples of org.eclipse.jface.action.IAction.run()


        IAction action = getActionRegistry().getAction(
            ActionFactory.DELETE.getId());
        if (action == null)
          return false;
        if (action.isEnabled())
          action.run();
        return true;
      }

    };
    ;
View Full Code Here


    public void modeChanged(Type newMode) {
      IAction actionToExecute = new ChangeModeAction(newMode, newMode.getShortName(),
              AnnotationEditor.this);

      actionToExecute.run();
    }});

    modeMenuManager.add(modeMenu);

    // annotation menu
View Full Code Here

    ICategoryProvider provider = mock(ICategoryProvider.class);
    doThrow(new MyException()).when(provider).setSelected(categories);

    IAction action = create(provider, categories);
    thrown.expect(MyException.class);
    action.run();
  }

  @Test
  public void shouldSetTheImageOfTheActionToBeTheSameAsTheImageOfTheFirstCategory() {
    ICategory first = mock(ICategory.class);
View Full Code Here

    IVisualProvider provider = mock(IVisualProvider.class);
    doThrow(new MyException()).when(provider).setVisualCategory(category);

    IAction action = create(category, provider);
    thrown.expect(MyException.class);
    action.run();
  }

  @Test
  public void shouldSetTheImageOfTheActionToBeTheSameAsTheImageOfTheCategory() {
    ICategory category = mock(ICategory.class);
View Full Code Here

        }
        // set alignment
        IAction alignmentAction = findChildAction(alignmentManager, actionText);
        assertNotNull(actionText, alignmentAction);
        alignmentAction.setChecked(true);
        alignmentAction.run();
      }
    });
    // check result
    {
      CellConstraintsSupport constraints = HTMLTableInfo.getConstraints(button);
View Full Code Here

      IMenuManager manager = getContextMenu(button);
      autoSizeAction = findChildAction(manager, "Autosize widget");
      assertNotNull(autoSizeAction);
    }
    // perform auto-size
    autoSizeAction.run();
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    RootPanel rootPanel = RootPanel.get();",
        "    {",
View Full Code Here

      List<Object> actions = Lists.newArrayList();
      frame.getBroadcastObject().addSelectionActions(selectedObjects, actions);
      action = findAction(actions, actionText);
    }
    // perform alignment
    action.run();
  }

  private void setupSelectionActions(final AbsolutePanelInfo panel) {
    panel.addBroadcastListener(new ObjectEventListener() {
      @Override
View Full Code Here

                            .getProperty(IProgressConstants.ACTION_PROPERTY);
                    if (property instanceof IAction) {
            action = (IAction) property;
          }
                    if (action != null && action.isEnabled()) {
                        action.run();
                        JobTreeElement topElement = (JobTreeElement) ji
                                .getParent();
                        if (topElement == null) {
              topElement = ji;
            }
View Full Code Here

    assertNotNull(findChildAction(menu, "right + width"));
    assertNotNull(findChildAction(menu, "left + right"));
    {
      IAction action = findChildAction(menu, "right + width");
      action.setChecked(true);
      action.run();
      assertEditor(
          "public class Test implements EntryPoint {",
          "  public void onModuleLoad() {",
          "    RootLayoutPanel rootPanel = RootLayoutPanel.get();",
          "    {",
View Full Code Here

    assertNotNull(findChildAction(menu, "bottom + height"));
    assertNotNull(findChildAction(menu, "top + bottom"));
    {
      IAction action = findChildAction(menu, "top + bottom");
      action.setChecked(true);
      action.run();
      assertEditor(
          "public class Test implements EntryPoint {",
          "  public void onModuleLoad() {",
          "    RootLayoutPanel rootPanel = RootLayoutPanel.get();",
          "    {",
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.