Package org.jamesii.gui.application

Examples of org.jamesii.gui.application.IWindowManager


    return "Default Perspective";
  }

  @Override
  protected List<IAction> generateActions() {
    final IWindowManager windowManager = getWindowManager();

    final List<IAction> actions = new ArrayList<>();
    actions.add(new ActionSet("org.jamesii.edit", "Edit",
        "org.jamesii.menu.main?after=org.jamesii.file", null));
    actions
        .add(new AbstractAction(
            "org.jamesii.preferences",
            "Preferences...",
            new String[] { "org.jamesii.menu.main/org.jamesii.edit?after=org.jamesii.edit.additionals" },
            null) {
          @Override
          public void execute() {
            PreferencesDialog.showPreferencesDialog(windowManager);
          }
        });

    Icon newIcon = null;
    newIcon = IconManager.getIcon(IconIdentifier.NEW_SMALL, "New");

    actions.add(new ActionSet("org.jamesii.new", "New", new String[] {
        "org.jamesii.menu.main/org.jamesii.file?first",
        "org.jamesii.toolbar.main?first" }, null, null, newIcon, null));

    Icon openIcon = null;
    openIcon = IconManager.getIcon(IconIdentifier.OPEN_SMALL, "Open");

    actions.add(new ActionSet("org.jamesii.open", "Open", new String[] {
        "org.jamesii.menu.main/org.jamesii.file?after=org.jamesii.new",
        "org.jamesii.toolbar.main?after=org.jamesii.new" }, null, null,
        openIcon, null));

    Icon saveIcon = null;
    saveIcon = IconManager.getIcon(IconIdentifier.SAVE_SMALL, "Save");

    actions.add(new SaveAction("org.jamesii.save", "Save", windowManager,
        saveIcon, new String[] {
            "org.jamesii.menu.main/org.jamesii.file?after=org.jamesii.open",
            "org.jamesii.toolbar.main?after=org.jamesii.open" }, KeyStroke
            .getKeyStroke(KeyEvent.VK_S,
                Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())
            .toString(), Integer.valueOf(KeyEvent.VK_S), null));

    Icon saveAsIcon = null;
    saveAsIcon = IconManager.getIcon(IconIdentifier.SAVE_SMALL, "Save As...");
    actions
        .add(new SaveAsAction(
            "org.jamesii.saveas",
            "Save As...",
            windowManager,
            saveAsIcon,
            new String[] { "org.jamesii.menu.main/org.jamesii.file?after=org.jamesii.save" },
            null, null, null));

    actions
        .add(new SeparatorAction(
            "org.jamesii.file.additionals1",
            new String[] { "org.jamesii.menu.main/org.jamesii.file?after=org.jamesii.saveas" },
            null));

    actions.add(new SeparatorAction("org.jamesii.toolbar.edit",
        new String[] { "org.jamesii.toolbar.main?after=org.jamesii.save" },
        null));

    actions.add(new ActionIAction(new UndoAction(windowManager),
        "org.jamesii.undo", new String[] {
            "org.jamesii.toolbar.main?after=org.jamesii.toolbar.edit",
            "org.jamesii.menu.main/org.jamesii.edit?first" }, null));

    actions.add(new ActionIAction(new RedoAction(windowManager),
        "org.jamesii.redo", new String[] {
            "org.jamesii.toolbar.main?after=org.jamesii.undo",
            "org.jamesii.menu.main/org.jamesii.edit?after=org.jamesii.undo" },
        null));

    actions.add(new SeparatorAction("org.jamesii.toolbar.additionals",
        new String[] { "org.jamesii.toolbar.main?after=org.jamesii.redo" },
        null));
    actions
        .add(new SeparatorAction(
            "org.jamesii.edit.additionals",
            new String[] { "org.jamesii.menu.main/org.jamesii.edit?after=org.jamesii.redo" },
            null));

    actions.add(new ActionSet("org.jamesii.help", "Help",
        "org.jamesii.menu.main?last", null));

    actions.add(new AbstractAction("org.jamesii.showSystemInfo",
        "Show System Information",
        new String[] { "org.jamesii.menu.main/org.jamesii.help?first" }, null) {

      @Override
      public void execute() {
        BasicUtilities.invokeLaterOnEDT(new Runnable() {
          @Override
          public void run() {
            JavaInfo info = new JavaInfo();
            windowManager.addWindow(new SystemInfoView(info, "this system",
                Contribution.DIALOG));
          }
        });
      }

    });

    actions
        .add(new AbstractAction(
            "org.jamesii.showPlugInInfo",
            "Inspect PlugIns",
            new String[] { "org.jamesii.menu.main/org.jamesii.help?after=org.jamesii.showSystemInfo" },
            null) {

          @Override
          public void execute() {
            BasicUtilities.invokeLaterOnEDT(new Runnable() {
              @Override
              public void run() {
                windowManager.addWindow(new PlugInView(Contribution.DIALOG));
              }
            });
          }

        });

    actions
        .add(new AbstractAction(
            "org.jamesii.showLogView",
            "Show Log View",
            new String[] { "org.jamesii.menu.main/org.jamesii.help?after=org.jamesii.showPlugInInfo" },
            null) {

          @Override
          public void execute() {
            BasicUtilities.invokeLaterOnEDT(new Runnable() {
              @Override
              public void run() {
                windowManager.addWindow(LogView.getInstance());
              }
            });
          }

        });

    actions.add(new ActionIAction(new HelpAction(), "help",
        new String[] { "org.jamesii.menu.main/org.jamesii.help" }, null));

    actions
        .add(new AbstractAction(
            "org.jamesii.showBackgroundTaskManager",
            "Show Background Tasks",
            new String[] { "org.jamesii.menu.main/org.jamesii.help?after=org.jamesii.showLogView" },
            null) {

          @Override
          public void execute() {
            BasicUtilities.invokeLaterOnEDT(new Runnable() {
              @Override
              public void run() {
                windowManager.addWindow(BackgroundTaskView.getInstance());
              }
            });
          }

        });
View Full Code Here

TOP

Related Classes of org.jamesii.gui.application.IWindowManager

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.