コード例 #1
0
 private void updateTitle() {
   String titlePostfix = "";
   if (getFormModel().isValid()) {
     titlePostfix = " - " + getFormModel().getModelName();
   }
   toolView.setDisplayName(titlePrefix + titlePostfix);
 }
コード例 #2
0
  @Override
  public void setName(String name) {
    String oldName = m_name;

    if (m_name.equals(name)) return;

    super.setName(name);

    m_name = name;

    onRename(oldName, m_name);

    if (m_topComponent != null) m_topComponent.setDisplayName(m_name);
  }
コード例 #3
0
 private static void showTopComponent(int id, Exception exception) {
   String name = "exception" + id;
   TopComponent c = NbComponents.findTopComponentByNameAndClass(name, TopComponent.class);
   if (c == null) {
     c =
         new TopComponent() {
           @Override
           public int getPersistenceType() {
             return TopComponent.PERSISTENCE_NEVER;
           }
         };
     c.setName(name);
     c.setDisplayName(exception.getClass().getSimpleName());
     c.setLayout(new BorderLayout());
     c.add(ExceptionPanel.create(exception), BorderLayout.CENTER);
     c.open();
   }
   c.requestActive();
 }
コード例 #4
0
  public void showTopComponent() {
    if (m_topComponent == null) {
      m_topComponent = getTopComponent();
      m_topComponent.open();
    }

    if (m_topComponent != null) {
      if (!m_topComponent.isOpened()) {
        m_topComponent = getTopComponent();
        m_topComponent.open();
      }

      m_topComponent.requestActive();

      // repeated on purpose to assert the display name
      m_topComponent.requestActive();

      m_topComponent.setDisplayName(m_name);
    }
  }