示例#1
0
 private String getTabTitle(MemoryLogModel memoryLogModel) {
   SessionID sessionId = memoryLogModel.getSessionId();
   if (sessionId == null) {
     return NO_SESSION_ID;
   } else {
     return sessionId.toString();
   }
 }
示例#2
0
  public JComponent createView(MemoryLogModel memoryLogModel) {
    final JTabbedPane tabPane = new JTabbedPane();
    tabPane.addTab(getTabTitle(memoryLogModel), createTabForSession(memoryLogModel));

    memoryLogModel.addPropertyChangeListener(
        new PropertyChangeListener() {
          public void propertyChange(PropertyChangeEvent evt) {

            String title;
            if (evt.getNewValue() == null) {
              title = NO_SESSION_ID;
            } else {
              title = evt.getNewValue().toString();
            }
            tabPane.setTitleAt(0, title);
          }
        });

    return tabPane;
  }