示例#1
0
  private ResultsToolbar() {
    bar = new JToolBar();
    bar.setFloatable(false);
    bar.addSeparator();

    Component newQuery = CallableSystemAction.get(NewQueryAction.class).getToolbarPresenter();

    Component editQuery = CallableSystemAction.get(EditQueryAction.class).getToolbarPresenter();
    Component prevQuery = CallableSystemAction.get(PrevQueryAction.class).getToolbarPresenter();
    Component refresh = CallableSystemAction.get(RefreshAction.class).getToolbarPresenter();

    bar.add(newQuery);
    bar.add(editQuery);
    bar.add(prevQuery);
    bar.addSeparator();
    bar.add(refresh);
  }
示例#2
0
文件: UserNode.java 项目: cismet/abf
  @Override
  public Action[] getActions(final boolean b) {
    if (UserManagement.REFRESH_DISPATCHER.tasksInProgress()
        || UserManagement.ACTION_DISPATCHER.tasksInProgress()) {
      return new Action[] {CallableSystemAction.get(RefreshIndicatorAction.class)};
    } else {
      Action removeGrpMbrShip = null;
      if (!((getParentNode() instanceof AllUsersNode)
          || (getParentNode() instanceof NoGroupUsersNode))) {
        removeGrpMbrShip = CallableSystemAction.get(RemoveGroupMembershipAction.class);
      }

      final Action refreshAction;
      if (DomainserverOptionsPanelController.isAutoRefresh()) {
        refreshAction = null;
      } else {
        refreshAction = CallableSystemAction.get(RefreshAction.class);
      }

      return new Action[] {
        CallableSystemAction.get(ChangeGroupBelongingWizardAction.class),
        removeGrpMbrShip,
        null,
        CallableSystemAction.get(CopyUserWizardAction.class),
        CallableSystemAction.get(DeleteUserAction.class),
        null,
        refreshAction
      };
    }
  }
  private void initComponents() {

    setLayout(new BorderLayout());

    bar = new JToolBar();
    bar.setFloatable(false);
    bar.addSeparator();

    Component newQuery = CallableSystemAction.get(NewQueryAction.class).getToolbarPresenter();
    Component editQuery = CallableSystemAction.get(EditQueryAction.class).getToolbarPresenter();
    Component prevQuery = CallableSystemAction.get(PrevQueryAction.class).getToolbarPresenter();
    Component refresh = CallableSystemAction.get(RefreshAction.class).getToolbarPresenter();

    bar.add(newQuery);
    bar.add(editQuery);
    bar.add(prevQuery);
    bar.addSeparator();
    bar.add(refresh);

    // add(ResultsToolbar.getDefault().getToolbar(), BorderLayout.NORTH);
    add(bar, BorderLayout.NORTH);
    lookup = new AbstractLookup(ic);
    associateLookup(new ProxyLookup(ExplorerUtils.createLookup(manager, getActionMap()), lookup));
  }
示例#4
0
文件: Case.java 项目: halbbob/autopsy
  // case change helper
  private static void doCaseChange(Case toChangeTo) {
    logger.log(Level.INFO, "Changing Case to: " + toChangeTo);
    if (toChangeTo != null) { // new case is open

      // clear the temp folder when the case is created / opened
      Case.clearTempFolder();
      checkSubFolders(toChangeTo);

      // enable these menus
      CallableSystemAction.get(AddImageAction.class).setEnabled(true);
      CallableSystemAction.get(CaseCloseAction.class).setEnabled(true);
      CallableSystemAction.get(CasePropertiesAction.class).setEnabled(true);
      CallableSystemAction.get(CaseDeleteAction.class).setEnabled(true); // Delete Case menu

      if (toChangeTo.getRootObjectsCount() > 0) {
        // open all top components
        CoreComponentControl.openCoreWindows();
      } else {
        // close all top components
        CoreComponentControl.closeCoreWindows();
      }
    } else { // case is closed
      // close all top components first
      CoreComponentControl.closeCoreWindows();

      // disable these menus
      CallableSystemAction.get(AddImageAction.class).setEnabled(false); // Add Image menu
      CallableSystemAction.get(CaseCloseAction.class).setEnabled(false); // Case Close menu
      CallableSystemAction.get(CasePropertiesAction.class)
          .setEnabled(false); // Case Properties menu
      CallableSystemAction.get(CaseDeleteAction.class).setEnabled(false); // Delete Case menu

      // clear pending notifications
      MessageNotifyUtil.Notify.clear();

      Frame f = WindowManager.getDefault().getMainWindow();
      f.setTitle(Case.getAppName()); // set the window name to just application name

      // try to force gc to happen
      System.gc();
      System.gc();
    }

    // log memory usage after case changed
    logger.log(Level.INFO, PlatformUtil.getAllMemUsageInfo());
  }
 @Override
 protected void initialize() {
   super.initialize();
 }
 @Override
 protected void initialize() {
   super.initialize();
   // see org.openide.util.actions.SystemAction.iconResource() javadoc for more details
   putValue("noIconInMenu", Boolean.TRUE);
 }
示例#7
0
 @Override
 public void setEnabled(boolean enabled) {
   super.setEnabled(enabled);
   this.firstCheck = null;
 }