org.openide.windows.Mode.getName()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(4.6k)|赞(0)|评价(0)|浏览(130)

本文整理了Java中org.openide.windows.Mode.getName()方法的一些代码示例,展示了Mode.getName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Mode.getName()方法的具体详情如下:
包路径:org.openide.windows.Mode
类名称:Mode
方法名:getName

Mode.getName介绍

[英]Get the programmatic name of the mode. This name should be unique, as it is used to find modes etc.
[中]获取模式的编程名称。这个名称应该是唯一的,因为它用于查找模式等。

代码示例

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

public Mode findMode(String name) {
  if(name == null) {
    return null;
  }
  for(Iterator it = getModes().iterator(); it.hasNext(); ) {
    Mode m = (Mode)it.next();
    if(name.equals(m.getName())) {
      return m;
    }
  }
  
  return null;
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

public Mode findMode(String name) {
  if(name == null) {
    return null;
  }
  for(Iterator it = getModes().iterator(); it.hasNext(); ) {
    Mode m = (Mode)it.next();
    if(name.equals(m.getName())) {
      return m;
    }
  }
  
  return null;
}

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-vmd-io

private static Mode findEditorMode () {
  Set modes = WindowManager.getDefault ().getModes ();
  for (Object o : modes) {
    Mode m = (Mode) o;
    if (m != null  &&  MODE_EDITOR.equals (m.getName ()))
      return m;
  }
  return null;
}

代码示例来源:origin: it.tidalwave.netbeans/it-tidalwave-netbeans-docking

@Override
 public void propertyChange (@Nonnull final PropertyChangeEvent event)
  {
   if (TopComponent.Registry.PROP_ACTIVATED.equals(event.getPropertyName()))
    {
     activeComponent = (TopComponent)event.getNewValue();
     boolean enabled = false;
     
     if (activeComponent != null)
      {
       final Mode mode = WindowManager.getDefault().findMode(activeComponent);
       enabled = testEnabled(mode.getName());
      }
     
     setEnabled(enabled);
    }
  }
});

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-cnd-gizmo

private GizmoIndicatorsTopComponent(boolean dock) {
  initComponents();
  this.dock = dock;
  setSession(null);
  setName(getMessage("CTL_DLightIndicatorsTopComponent")); // NOI18N
  setToolTipText(getMessage("CTL_DLightIndicatorsTopComponent"));//NOI18N
  setIcon(ImageUtilities.loadImage(ICON_PATH, true));
  if (dock) {
    if (WindowManager.getDefault().findMode(this) == null || WindowManager.getDefault().findMode(this).getName().equals("navigator")) { // NOI18N
      if (WindowManager.getDefault().findMode("navigator") != null) { // NOI18N
        WindowManager.getDefault().findMode("navigator").dockInto(this);//NOI18N
      }
    }
  }
  setFocusTraversalPolicyProvider(true);
  setFocusTraversalPolicy(focusPolicy);
  ActionMap map = new ActionMap();
  map.put("org.openide.actions.PopupAction", popupAction);//NOI18N
  this.associateLookup(ExplorerUtils.createLookup(manager, map));
  installActions();
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-gsf-testrunner-ui

@Override
  public void run() {
    final ResultWindow window = ResultWindow.getInstance();
    Mode mode = WindowManager.getDefault().findMode(window);
    boolean isInSlidingMode = mode != null && mode.getName().contains("SlidingSide");   //NOI18N
    if (window.isOpened() && !isInSlidingMode) {
      window.promote();
    } else if (!window.isOpened() || (window.isOpened() && !window.isShowing() && isInSlidingMode)) {
      Icon icon = new ImageIcon(ImageUtilities.loadImage("org/netbeans/modules/gsf/testrunner/ui/resources/testResults.png"));   //NOI18N
      String projectname = ProjectUtils.getInformation(session.getProject()).getDisplayName();
      int total = displayHandler.getTotalTests();
      String title = total == 0 ? Bundle.LBL_NotificationDisplayer_NoTestsExecuted_title(projectname) : Bundle.LBL_NotificationDisplayer_title(total, projectname);
      
      if(bubbleTask.cancel()) {
        bubbleTask.schedule(0);
      }
      bubbleNotification = NotificationDisplayer.getDefault().notify(title, icon,
          Bundle.LBL_NotificationDisplayer_detailsText(), new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
          window.promote();
          bubbleTask.cancel();
        }
      });
      bubbleTask.schedule(15000);
    }
  }
});

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-dlight-core-ui

private DLightIndicatorsTopComponent(boolean dock) {
    initComponents();
    this.dock = dock;
    setSession(null);
    setName(getMessage("CTL_DLightIndicatorsTopComponent")); // NOI18N
    setToolTipText(getMessage("CTL_DLightIndicatorsTopComponent"));//NOI18N
    setIcon(ImageUtilities.loadImage(ICON_PATH, true));
    if (dock) {
      if (WindowManager.getDefault().findMode(this) == null || WindowManager.getDefault().findMode(this).getName().equals("navigator")) { // NOI18N
        if (WindowManager.getDefault().findMode("navigator") != null) { // NOI18N
          WindowManager.getDefault().findMode("navigator").dockInto(this);//NOI18N
        }
      }
    }
    setFocusTraversalPolicyProvider(true);
    setFocusTraversalPolicy(focusPolicy);
//        ActionMap map = new ActionMap();
//        map.put("org.openide.actions.PopupAction", popupAction);//NOI18N
//        this.associateLookup(ExplorerUtils.createLookup(manager, map));
//        installActions();
  }

相关文章