public Presentation create(PresentationContext context) { return new EhcachePresentationPanel(); } }
private void suspend() { removeAll(); messageLabel.setText(appContext.getString("cluster.not.ready.msg")); add(messagePanel); revalidate(); repaint(); }
private void init() { removeAll(); cacheManagerSelector.removeAllItems(); String[] cacheManagerNames = ehcacheModel.getCacheManagerNames(); if (cacheManagerNames != null && cacheManagerNames.length > 0) { add(mainPanel, BorderLayout.CENTER); for (String cacheManagerName : cacheManagerNames) { cacheManagerSelector.addItem(cacheManagerName); } addModelListeners(ehcacheModel.getCacheManagerModel(cacheManagerNames[0])); handleSummaryText(); firePropertyChange(Presentation.PROP_PRESENTATION_READY, false, true); } else { messageLabel.setText(bundle.getString("no.cache-managers.msg")); add(messagePanel); } revalidate(); repaint(); }
@Override public void setup(ApplicationContext appContext, IClusterModel clusterModel) { this.appContext = appContext; this.clusterModel = clusterModel; this.ehcacheModel = new EhcacheModel(clusterModel); this.ehcacheModel.addEhcacheModelListener(this); setup(); clusterModel.addPropertyChangeListener(clusterListener = new ClusterListener(clusterModel)); if (clusterModel.isReady()) { init(); } else { suspend(); } }
private void setup() { setLayout(new BorderLayout()); mainPanel = new XContainer(new BorderLayout()); XContainer topPanel = new XContainer(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); gbc.gridx = gbc.gridy = 0; gbc.insets = new Insets(3, 3, 3, 3); XLabel headerLabel; topPanel.add(headerLabel = new XLabel(bundle.getString("cache.manager")), gbc); headerLabel.setFont((Font) appContext.getObject("header.label.font")); gbc.gridx++; gbc.ipadx = 10; topPanel.add(cacheManagerSelector = new XComboBox(), gbc); cacheManagerSelector.addItemListener(new CacheManagerSelectionListener()); gbc.gridx++; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.weightx = 1.0; // filler topPanel.add(new XLabel(), gbc); gbc.gridx++; mainPanel.add(topPanel, BorderLayout.NORTH); mainPanel.add(pagedView = new PagedView(), BorderLayout.CENTER); messagePanel = new XContainer(new BorderLayout()); messagePanel.add(messageLabel = new XLabel()); messageLabel.setHorizontalAlignment(SwingConstants.CENTER); messageLabel.setFont((Font) appContext.getObject("message.label.font")); messageLabel.setText(appContext.getString("cluster.not.ready.msg")); }
String currentPage = pagedView.getPage(); if (currentPage != null && ehcacheModel != null) { removeModelListeners(ehcacheModel.getCacheManagerModel(currentPage)); removeAll();
@Override public void setup(ApplicationContext appContext, IClusterModel clusterModel) { this.appContext = appContext; this.clusterModel = clusterModel; this.ehcacheModel = new EhcacheModel(clusterModel); this.ehcacheModel.addEhcacheModelListener(this); setup(); }
@Override public void tearDown() { if (!tornDown.compareAndSet(false, true)) { return; } ehcacheModel.removeEhcacheModelListener(this); clusterModel.removePropertyChangeListener(clusterListener); clusterListener.tearDown(); mainPanel.tearDown(); ehcacheModel.tearDown(); synchronized (this) { appContext = null; clusterModel = null; clusterListener = null; ehcacheModel = null; mainPanel = null; cacheManagerSelector = null; messagePanel = null; messageLabel = null; pagedView = null; } removeAll(); } }
public void run() { if (tornDown.get()) { return; } String cacheManagerName = cacheManagerModel.getName(); DefaultComboBoxModel puModel = (DefaultComboBoxModel) cacheManagerSelector.getModel(); if (puModel.getIndexOf(cacheManagerName) == -1) { puModel.addElement(cacheManagerName); appContext.setStatus("Added Ehcache CacheManager '" + cacheManagerName + "'"); } testAnyCacheManagers(); if (cacheManagerSelector.getItemCount() == 1) { firePropertyChange(Presentation.PROP_PRESENTATION_READY, false, true); } } });
private void setup() { setLayout(new BorderLayout()); mainPanel = new XContainer(new BorderLayout()); XContainer topPanel = new XContainer(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); gbc.gridx = gbc.gridy = 0; gbc.insets = new Insets(3, 3, 3, 3); XLabel headerLabel; topPanel.add(headerLabel = new XLabel(bundle.getString("cache.manager")), gbc); headerLabel.setFont((Font) appContext.getObject("header.label.font")); gbc.gridx++; gbc.ipadx = 10; topPanel.add(cacheManagerSelector = new XComboBox(), gbc); cacheManagerSelector.addItemListener(new CacheManagerSelectionListener()); gbc.gridx++; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.weightx = 1.0; // filler topPanel.add(new XLabel(), gbc); gbc.gridx++; mainPanel.add(topPanel, BorderLayout.NORTH); mainPanel.add(pagedView = new PagedView(), BorderLayout.CENTER); messagePanel = new XContainer(new BorderLayout()); messagePanel.add(messageLabel = new XLabel()); messageLabel.setHorizontalAlignment(SwingConstants.CENTER); messageLabel.setFont((Font) appContext.getObject("message.label.font")); messageLabel.setText(appContext.getString("cluster.not.ready.msg")); }
@Override public void setup(ApplicationContext appContext, IClusterModel clusterModel) { this.appContext = appContext; this.clusterModel = clusterModel; this.ehcacheModel = new EhcacheModel(clusterModel); this.ehcacheModel.addEhcacheModelListener(this); this.myListener = new MyListener(); setup(); }
@Override public void tearDown() { if (!tornDown.compareAndSet(false, true)) { return; } ehcacheModel.removeEhcacheModelListener(this); clusterModel.removePropertyChangeListener(clusterListener); clusterListener.tearDown(); mainPanel.tearDown(); ehcacheModel.tearDown(); synchronized (this) { appContext = null; clusterModel = null; clusterListener = null; ehcacheModel = null; mainPanel = null; cacheManagerSelector = null; messagePanel = null; messageLabel = null; pagedView = null; } removeAll(); } }
public void run() { if (tornDown.get()) { return; } String cacheManagerName = cacheManagerModel.getName(); DefaultComboBoxModel comboBoxModel = (DefaultComboBoxModel) cacheManagerSelector.getModel(); if (comboBoxModel.getIndexOf(cacheManagerName) == -1) { comboBoxModel.addElement(cacheManagerName); appContext.setStatus("Added Ehcache CacheManager '" + cacheManagerName + "'"); testAnyCacheManagers(); if (cacheManagerSelector.getItemCount() == 1) { firePropertyChange(Presentation.PROP_PRESENTATION_READY, false, true); } } } });
private void suspend() { removeAll(); messageLabel.setText(appContext.getString("cluster.not.ready.msg")); add(messagePanel); revalidate(); repaint(); }
public Presentation create(PresentationContext context) { return new EhcachePresentationPanel(); } }
private void setup() { setLayout(new BorderLayout()); mainPanel = new XContainer(new BorderLayout()); XContainer topPanel = new XContainer(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); gbc.gridx = gbc.gridy = 0; gbc.insets = new Insets(3, 3, 3, 3); XLabel headerLabel; topPanel.add(headerLabel = new XLabel(bundle.getString("cache.manager")), gbc); headerLabel.setFont((Font) appContext.getObject("header.label.font")); gbc.gridx++; gbc.ipadx = 10; topPanel.add(cacheManagerSelector = new XComboBox(), gbc); cacheManagerSelector.addItemListener(new CacheManagerSelectionListener()); gbc.gridx++; topPanel.add(summaryLabel = new XLabel(), gbc); gbc.gridx++; // filler gbc.fill = GridBagConstraints.HORIZONTAL; gbc.weightx = 1.0; topPanel.add(new XLabel(), gbc); gbc.gridx++; mainPanel.add(topPanel, BorderLayout.NORTH); mainPanel.add(pagedView = new PagedView(), BorderLayout.CENTER); messagePanel = new XContainer(new BorderLayout()); messagePanel.add(messageLabel = new XLabel()); messageLabel.setHorizontalAlignment(SwingConstants.CENTER); messageLabel.setFont((Font) appContext.getObject("message.label.font")); messageLabel.setText(appContext.getString("cluster.not.ready.msg")); }
public void run() { if (tornDown.get()) { return; } String cacheManagerName = cacheManagerModel.getName(); DefaultComboBoxModel comboBoxModel = (DefaultComboBoxModel) cacheManagerSelector.getModel(); int index = comboBoxModel.getIndexOf(cacheManagerName); if (index != -1) { CacheManagerPanel page = (CacheManagerPanel) pagedView.getComponent(index); pagedView.remove(index); comboBoxModel.removeElementAt(index); page.tearDown(); appContext.setStatus("Removed Ehcache CacheManager '" + cacheManagerName + "'"); } if (cacheManagerSelector.getItemCount() == 0) { firePropertyChange(Presentation.PROP_PRESENTATION_READY, true, false); } } });
private void suspend() { removeAll(); cacheManagerSelector.removeAllItems(); messageLabel.setText(appContext.getString("cluster.not.ready.msg")); add(messagePanel); revalidate(); repaint(); }
public Presentation create(PresentationContext context) { return new EhcachePresentationPanel(); } }