/** Updates the all hosts menu item. */ @Override public void allHostsUpdate() { browser.updateHosts(); }
/** Prepares a new <code>ClusterViewPanel</code> object. */ EmptyViewPanel() { super(); browser = new EmptyBrowser(); Tools.getGUIData().setEmptyBrowser(browser); browser.setEmptyViewPanel(this); browser.initHosts(); final JPanel buttonPanel = new JPanel(new FlowLayout()); buttonPanel.setMinimumSize(new Dimension(0, 110)); buttonPanel.setPreferredSize(new Dimension(0, 110)); buttonPanel.setMaximumSize(new Dimension(Short.MAX_VALUE, 110)); buttonPanel.setBackground(STATUS_BACKGROUND); add(buttonPanel, BorderLayout.NORTH); final JPanel logoPanel = new JPanel(new CardLayout()); logoPanel.setBackground(java.awt.Color.WHITE); final ImageIcon logoImage = Tools.createImageIcon("startpage_head.jpg"); final JLabel logo = new JLabel(logoImage); final JPanel lPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); lPanel.setBackground(java.awt.Color.WHITE); lPanel.add(logo); logoPanel.add(lPanel, LOGO_PANEL_STRING); final JPanel smallButtonPanel = new JPanel(); smallButtonPanel.setBackground(STATUS_BACKGROUND); smallButtonPanel.setLayout(new BoxLayout(smallButtonPanel, BoxLayout.Y_AXIS)); buttonPanel.add(smallButtonPanel); /* check for upgrade field. */ smallButtonPanel.add(Tools.getGUIData().getClustersPanel().registerUpgradeTextField()); /* add new host button */ final MyButton addHostButton = new MyButton(Tools.getString("ClusterTab.AddNewHost"), HOST_ICON); addHostButton.setBackgroundColor(Browser.STATUS_BACKGROUND); addHostButton.setPreferredSize(BIG_BUTTON_DIMENSION); addHostButton.addActionListener( new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { final Thread thread = new Thread( new Runnable() { @Override public void run() { final AddHostDialog ahd = new AddHostDialog(); ahd.showDialogs(); } }); thread.start(); } }); Tools.getGUIData().registerAddHostButton(addHostButton); buttonPanel.add(addHostButton); createEmptyView(); add(logoPanel, BorderLayout.SOUTH); Tools.getGUIData().registerAllHostsUpdate(this); Tools.getGUIData().allHostsUpdate(); /* add new cluster button */ final MyButton addClusterButton = new MyButton(Tools.getString("ClusterTab.AddNewCluster"), CLUSTER_ICON); addClusterButton.setBackgroundColor(Browser.STATUS_BACKGROUND); addClusterButton.setPreferredSize(BIG_BUTTON_DIMENSION); addClusterButton.setMinimumSize(BIG_BUTTON_DIMENSION); addClusterButton.addActionListener( new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { final Thread thread = new Thread( new Runnable() { @Override public void run() { AddClusterDialog acd = new AddClusterDialog(); acd.showDialogs(); } }); thread.start(); } }); Tools.getGUIData().registerAddClusterButton(addClusterButton); Tools.getGUIData().checkAddClusterButtons(); buttonPanel.add(addClusterButton); if (!Tools.getConfigData().getAutoHosts().isEmpty()) { SwingUtilities.invokeLater( new Runnable() { @Override public void run() { addHostButton.pressButton(); } }); } }
/** creates cluster view and updates the tree. */ private void createEmptyView() { getTree(browser); browser.updateHosts(); }