public static List<PluginInfo> showDialog(Map<String, PluginRegistry> downloadsProviders, Component parent) { PluginPanel panel = new PluginPanel(downloadsProviders); Object [] options = new String []{"Install", "Not now"}; int ret = JOptionPaneEx.showConfirmDialog(parent, "Automatic Update", panel, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null, options, options[0]); if (ret == 0) { return panel.getPluginsToInstall(); } return null; }
private Component createInfoBox() { Box infoBox = new Box(BoxLayout.PAGE_AXIS); infoBox.add(Box.createRigidArea(new Dimension(0, 7))); infoBox.add(createAuthorPanel()); infoBox.add(Box.createRigidArea(new Dimension(0, 7))); infoBox.add(createLicensePanel()); infoBox.add(Box.createRigidArea(new Dimension(0, 7))); infoBox.add(createDocPanel()); return infoBox; }
private Component createDocPanel() { createTextPanel(); readmeScroller = new JScrollPane(readmePane, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); readmeScroller.setOpaque(false); return readmeScroller; }
public PluginPanel(List<PluginInfo> pluginInfoList) { setPreferredSize(new Dimension(600, 600)); setLayout(new BorderLayout(2, 2)); JSplitPane sp = new JSplitPane(JSplitPane.VERTICAL_SPLIT); sp.setBorder(new EmptyBorder(6, 6, 6, 6)); sp.setResizeWeight(0.5); pluginTable = new PluginTable(pluginInfoList); pluginTable.addListSelectionListener(e -> { PluginInfo info = pluginTable.getCurrentUpdateInfo(); updateInfoPanel(info); }); sp.setTopComponent(new JScrollPane(pluginTable)); sp.setBottomComponent(createInfoBox()); add(sp, BorderLayout.CENTER); alwaysShow = new JCheckBox("Always check for updates on startup.", PluginManager.getInstance().isAutoUpdateEnabled()); alwaysShow.addActionListener(event -> { PluginManager.getInstance().setAutoUpdateEnabled(alwaysShow.isSelected()); }); alwaysShow.setAlignmentX(0.0f); add(alwaysShow, BorderLayout.SOUTH); }
public PluginPanel(Map<String, PluginRegistry> downloadsProviders) { setLayout(new BorderLayout(2, 2)); sp.setRightComponent(createInfoBox()); add(sp, BorderLayout.CENTER); add(alwaysShow, BorderLayout.SOUTH);
private void showPluginsDialog(List<PluginInfo> pluginInfoList) { SwingUtilities.invokeLater(() -> { List<PluginInfo> selUpdates = PluginPanel.showDialog(pluginInfoList, null); if (!selUpdates.isEmpty()) { PluginInstaller installer = new PluginInstaller(selUpdates); installer.run(); } }); }
public PluginPanel(Map<String, PluginRegistry> downloadsProviders) { setLayout(new BorderLayout(2, 2)); sp.setRightComponent(createInfoBox()); add(sp, BorderLayout.CENTER); add(alwaysShow, BorderLayout.SOUTH);
public void showUpdatesDialog(Map<String, PluginRegistry> downloadsProviders) { List<PluginInfo> selUpdates = PluginPanel.showDialog(downloadsProviders, null); if (selUpdates != null){ PluginInstaller installer = new PluginInstaller(selUpdates); installer.run(); // @@TODO remove the installed plugins from the updatesProvider } }
private Component createInfoBox() { Box infoBox = new Box(BoxLayout.PAGE_AXIS); infoBox.setBorder(ComponentFactory.createTitledBorder("Plugin info")); infoBox.add(Box.createRigidArea(new Dimension(0, 10))); infoBox.add(createAuthorPanel()); infoBox.add(Box.createRigidArea(new Dimension(0, 10))); infoBox.add(createLicensePanel()); infoBox.add(Box.createRigidArea(new Dimension(0, 20))); infoBox.add(createDocPanel()); return infoBox; }
public static List<PluginInfo> showDialog(Map<String, PluginRegistry> downloadsProviders, Component parent) { PluginPanel panel = new PluginPanel(downloadsProviders); Object [] options = new String []{"Install", "Not now"}; int ret = JOptionPaneEx.showConfirmDialog(parent, "Automatic Update", panel, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null, options, options[0]); if (ret == 0) { return panel.getPluginsToInstall(); } return null; }
public void showUpdatesDialog(Map<String, PluginRegistry> downloadsProviders) { List<PluginInfo> selUpdates = PluginPanel.showDialog(downloadsProviders, null); if (selUpdates != null){ PluginInstaller installer = new PluginInstaller(selUpdates); installer.run(); // @@TODO remove the installed plugins from the updatesProvider } }
private Component createDocPanel() { readmePane = createTextPanel(); readmeScroller = new JScrollPane(readmePane, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); readmeScroller.setOpaque(false); return readmeScroller; }
private Component createInfoBox() { Box infoBox = new Box(BoxLayout.PAGE_AXIS); infoBox.setBorder(ComponentFactory.createTitledBorder("Plugin info")); infoBox.add(Box.createRigidArea(new Dimension(0, 10))); infoBox.add(createAuthorPanel()); infoBox.add(Box.createRigidArea(new Dimension(0, 10))); infoBox.add(createLicensePanel()); infoBox.add(Box.createRigidArea(new Dimension(0, 20))); infoBox.add(createDocPanel()); return infoBox; }
public static List<PluginInfo> showDialog(List<PluginInfo> pluginInfoList, Component parent) { PluginPanel panel = new PluginPanel(pluginInfoList); final String installOption = "Install"; final String notNowOption = "Not now"; Object [] options = new String []{installOption, notNowOption}; JOptionPane optionPane = new JOptionPane( panel, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null, options, options[0]); JDialog dlg = optionPane.createDialog(parent, "Automatic Update"); dlg.setModal(true); dlg.setResizable(true); dlg.setVisible(true); if(installOption.equals(optionPane.getValue())) { return panel.getPluginsToInstall(); } else { return Collections.emptyList(); } }
private Component createDocPanel() { readmePane = createTextPanel(); readmeScroller = new JScrollPane(readmePane, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); readmeScroller.setOpaque(false); return readmeScroller; }