private String getTabTitle(MemoryLogModel memoryLogModel) { SessionID sessionId = memoryLogModel.getSessionId(); if (sessionId == null) { return NO_SESSION_ID; } else { return sessionId.toString(); } }
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; }