diff -r bf796e9934fc autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/Bundle.properties --- a/autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/Bundle.properties Tue May 05 15:25:36 2009 +0400 +++ b/autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/Bundle.properties Tue May 05 16:13:31 2009 +0400 @@ -106,7 +106,7 @@ AvailableTableModel_Columns_Name=Name AvailableTableModel_Source_Category=Source AvailableTableModel_Columns_Category=Category -InstalledTableModel_Columns_Uninstall=Uninstall +InstalledTableModel_Columns_Uninstall=Select InstalledTableModel_Columns_Name=Name InstalledTableModel_Columns_Installed=Installed InstalledTableModel_Columns_Category=Category @@ -185,4 +185,4 @@ NetworkProblemPanel_ACD=N/A NetworkProblemPanel_taMessage=Message of Network Problem NetworkProblemPanel_taTitle_ACN=Network Problem -UnitTab.advView.text=Advanced View +UnitTab.detailView.text=Sho&w details diff -r bf796e9934fc autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/PluginManagerUI.java --- a/autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/PluginManagerUI.java Tue May 05 15:25:36 2009 +0400 +++ b/autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/PluginManagerUI.java Tue May 05 16:13:31 2009 +0400 @@ -95,15 +95,20 @@ public static final String[] TAB_NAMES = { "update", "available", "local", "installed" }; //NOI18N private int initialTabToSelect; - private boolean advancedView; + private boolean detailView; + public static final String DETAIL_VIEW_SELECTED_PROP = "plugin.manager.detail.view.selected";//NOI18N public PluginManagerUI (JButton closeButton ) { this(closeButton, null, true); } + + public PluginManagerUI (JButton closeButton, Object initialTab) { + this(closeButton, initialTab, Boolean.getBoolean(DETAIL_VIEW_SELECTED_PROP)); + } /** Creates new form PluginManagerUI */ - public PluginManagerUI (JButton closeButton, Object initialTab, boolean advancedView) { - this.advancedView = advancedView; + public PluginManagerUI (JButton closeButton, Object initialTab, boolean detailView) { + this.detailView = detailView; this.closeButton = closeButton; int selIndex = -1; for( int i=0; i features = UpdateManager.getDefault().getUpdateUnits(UpdateManager.TYPE.FEATURE); - if (isAdvancedView() && !features.isEmpty()) { + if (isDetailView() && !features.isEmpty()) { installTableModel.setUnits(units); } else { installTableModel.setUnits(units, features); diff -r bf796e9934fc autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/UnitTab.form --- a/autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/UnitTab.form Tue May 05 15:25:36 2009 +0400 +++ b/autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/UnitTab.form Tue May 05 16:13:31 2009 +0400 @@ -20,7 +20,9 @@ - + + + @@ -28,12 +30,15 @@ - + + + + + - - - + + @@ -48,15 +53,17 @@ + - + - + + @@ -118,18 +125,22 @@ - + - + - + - + + + + + diff -r bf796e9934fc autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/UnitTab.java --- a/autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/UnitTab.java Tue May 05 15:25:36 2009 +0400 +++ b/autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/UnitTab.java Tue May 05 16:13:31 2009 +0400 @@ -41,6 +41,8 @@ package org.netbeans.modules.autoupdate.ui; +import org.netbeans.api.autoupdate.OperationContainer; +import org.netbeans.api.autoupdate.OperationSupport; import org.netbeans.modules.autoupdate.ui.wizards.UninstallUnitWizard; import org.netbeans.modules.autoupdate.ui.wizards.InstallUnitWizard; import java.awt.Component; @@ -69,6 +71,7 @@ import java.util.prefs.PreferenceChangeListener; import java.util.prefs.Preferences; import javax.swing.AbstractAction; +import javax.swing.AbstractButton; import javax.swing.Action; import javax.swing.Icon; import javax.swing.ImageIcon; @@ -120,14 +123,13 @@ private String filter = ""; private PluginManagerUI manager = null; private PopupActionSupport popupActionsSupport; - private RowTabAction activateAction; - private RowTabAction deactivateAction; + private TabAction activateAction; + private TabAction deactivateAction; private TabAction reloadAction; private RowTabAction moreAction; private RowTabAction lessAction; private RowTabAction removeLocallyDownloaded; - private static final String ADVANCED_VIEW_SELECTED_PROP = "plugin.manager.advanced.view.selected";//NOI18N - + private static Boolean isWaitingForExternal = false; private static final RequestProcessor SEARCH_PROCESSOR = new RequestProcessor ("search-processor"); @@ -231,9 +233,10 @@ boolean enabled = !waitingState; Component[] all = getComponents (); for (Component component : all) { - if (component == bTabAction) { + if (component == bTabAction || component == bTabAction1 || component == bTabAction2) { if (enabled) { - component.setEnabled (model.getMarkedUnits ().size () > 0); + TabAction a = (TabAction) ((AbstractButton)component).getAction(); + component.setEnabled (a == null ? false : a.isEnabled()); } else { component.setEnabled (enabled); } @@ -325,7 +328,7 @@ private Collection oldUnits = Collections.emptySet (); public void refreshState () { - advView.setVisible(this.model.supportsTwoViews()); + detailView.setVisible(this.model.supportsTwoViews()); final Collection units = model.getMarkedUnits (); if (oldUnits.equals (units)) { return ; @@ -338,7 +341,7 @@ } else { setSelectionInfo (null, units.size ()); } - getDefaultAction ().setEnabled (units.size () > 0); + getDefaultAction ().tableDataChanged(units); boolean alreadyScheduled = false; if (getDownloadSizeTask != null) { if (getDownloadSizeTask.getDelay () > 0) { @@ -383,18 +386,23 @@ activateAction = new ActivateAction (); deactivateAction = new DeactivateAction (); + UninstallAction uninstall = new UninstallAction(); forPopup = new TabAction[] { activateAction, deactivateAction,activateCategoryAction,deactivateCategoryAction, checkCategoryAction, uncheckCategoryAction, - checkAllAction, uncheckAllAction, new CheckAction () + checkAllAction, uncheckAllAction, new CheckAction (), uninstall }; + bTabAction1.setVisible(true); + bTabAction2.setVisible(true); + bTabAction.setAction(activateAction); + bTabAction1.setAction(deactivateAction); + bTabAction2.setAction (uninstall); + prepareTopButton (reloadAction = new ReloadAction ()); + table.setEnableRenderer (new EnableRenderer ()); + initReloadTooltip(); + break; } - bTabAction.setAction (new UninstallAction ()); - prepareTopButton (reloadAction = new ReloadAction ()); - table.setEnableRenderer (new EnableRenderer ()); - initReloadTooltip(); - break; case UPDATE : { RowTabAction selectCategoryAction = new CheckCategoryAction (); @@ -411,6 +419,8 @@ }; } bTabAction.setAction (new UpdateAction ()); + bTabAction1.setVisible(false); + bTabAction2.setVisible(false); prepareTopButton (reloadAction = new ReloadAction ()); initReloadTooltip(); break; @@ -430,6 +440,8 @@ }; } bTabAction.setAction (new AvailableAction ()); + bTabAction1.setVisible(false); + bTabAction2.setVisible(false); prepareTopButton (reloadAction = new ReloadAction ()); table.setEnableRenderer (new SourceCategoryRenderer ()); initReloadTooltip(); @@ -442,6 +454,8 @@ }; } bTabAction.setAction (new LocalUpdateAction ()); + bTabAction1.setVisible(false); + bTabAction2.setVisible(false); prepareTopButton (new AddLocallyDownloadedAction ()); break; } @@ -529,9 +543,9 @@ //selectedRow is selected Action action = null; if (activateAction != null && activateAction.isEnabled ()) { - action = activateAction; + //action = activateAction; } else if (deactivateAction != null && deactivateAction.isEnabled ()) { - action = deactivateAction; + //action = deactivateAction; } else if (removeLocallyDownloaded != null && removeLocallyDownloaded.isEnabled ()) { action = removeLocallyDownloaded; } @@ -589,7 +603,9 @@ spTab = new javax.swing.JSplitPane(); topButton = new javax.swing.JButton(); lWarning = new javax.swing.JLabel(); - advView = new javax.swing.JCheckBox(); + detailView = new javax.swing.JCheckBox(); + bTabAction1 = new javax.swing.JButton(); + bTabAction2 = new javax.swing.JButton(); lSearch.setLabelFor(tfSearch); org.openide.awt.Mnemonics.setLocalizedText(lSearch, org.openide.util.NbBundle.getMessage(UnitTab.class, "lSearch1.text")); // NOI18N @@ -601,11 +617,11 @@ org.openide.awt.Mnemonics.setLocalizedText(topButton, "jButton1"); - advViewInit(); - org.openide.awt.Mnemonics.setLocalizedText(advView, org.openide.util.NbBundle.getBundle(UnitTab.class).getString("UnitTab.advView.text")); // NOI18N - advView.addItemListener(new java.awt.event.ItemListener() { + detailViewInit(); + org.openide.awt.Mnemonics.setLocalizedText(detailView, org.openide.util.NbBundle.getBundle(UnitTab.class).getString("UnitTab.detailView.text")); // NOI18N + detailView.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { - advViewItemStateChanged(evt); + detailViewItemStateChanged(evt); } }); @@ -618,7 +634,9 @@ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .add(topButton) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 456, Short.MAX_VALUE) + .add(18, 18, 18) + .add(detailView) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 375, Short.MAX_VALUE) .add(lSearch) .add(4, 4, 4) .add(tfSearch, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 114, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) @@ -626,11 +644,14 @@ .add(layout.createSequentialGroup() .add(bTabAction) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(bTabAction1) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(bTabAction2) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(lSelectionInfo) .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED) - .add(lWarning, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 527, Short.MAX_VALUE) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(advView))) + .add(lWarning, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 482, Short.MAX_VALUE) + .add(99, 99, 99))) .addContainerGap()) ); layout.setVerticalGroup( @@ -640,15 +661,17 @@ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.CENTER) .add(tfSearch, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(lSearch) - .add(topButton)) + .add(topButton) + .add(detailView)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(spTab, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 41, Short.MAX_VALUE) + .add(spTab, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 73, Short.MAX_VALUE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.CENTER, false) .add(bTabAction) .add(lSelectionInfo, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(lWarning) - .add(advView)) + .add(bTabAction1) + .add(bTabAction2)) .addContainerGap()) ); @@ -659,18 +682,18 @@ topButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(UnitTab.class, "ACD_Reload")); // NOI18N }// //GEN-END:initComponents - private void advViewItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_advViewItemStateChanged + private void detailViewItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_detailViewItemStateChanged if (this.model.supportsTwoViews()) { - manager.setAdvancedView(advView.isSelected()); + manager.setDetailView(detailView.isSelected()); manager.updateUnitsChanged(); - System.setProperty(ADVANCED_VIEW_SELECTED_PROP, "" + advView.isSelected()); + System.setProperty(PluginManagerUI.DETAIL_VIEW_SELECTED_PROP, "" + detailView.isSelected()); } - }//GEN-LAST:event_advViewItemStateChanged +}//GEN-LAST:event_detailViewItemStateChanged - private void advViewInit() { - advView.setVisible(this.model.supportsTwoViews()); + private void detailViewInit() { + detailView.setVisible(this.model.supportsTwoViews()); if (this.model.supportsTwoViews()) { - advView.setSelected(Boolean.getBoolean(ADVANCED_VIEW_SELECTED_PROP)); + detailView.setSelected(Boolean.getBoolean(PluginManagerUI.DETAIL_VIEW_SELECTED_PROP)); } } @@ -1021,7 +1044,7 @@ } - public abstract void performerImpl (); + public abstract void performerImpl (); } private abstract class RowTabAction extends TabAction { @@ -1269,10 +1292,60 @@ } } - private class ActivateAction extends RowTabAction { + private class ActivateAction extends TabAction { public ActivateAction () { super ("UnitTab_ActivateAction", /*KeyStroke.getKeyStroke (KeyEvent.VK_E, KeyEvent.CTRL_DOWN_MASK),*/ "EnableDisable"); } + + @Override + public void tableDataChanged(Collection units) { + if (units.isEmpty()) { + setEnabled(false); + return; + } + for (Unit u : units) { + if (!isEnabled(u)) { + setEnabled(false); + return; + } + } + setEnabled(true); + } + + @Override + public void performerImpl() { + final int row = getSelectedRow (); + final Map state = UnitCategoryTableModel.captureState (model.getUnits ()); + OperationContainer c = Containers.forEnable(); + for (Unit u : model.getUnits()) { + if (u.isMarked()) { + c.add(u.updateUnit, u.getRelevantElement()); + } + } + UninstallUnitWizard wizard = new UninstallUnitWizard (); + wizard.invokeWizard (true); + Containers.forEnable ().removeAll (); + restoreSelectedRow(row); + refreshState (); + focusTable (); + } + /* + public void performerImpl (Unit u) { + Unit.Installed unit = (Unit.Installed)u; + final int row = getSelectedRow(); + + if (!unit.getRelevantElement ().isEnabled ()) { + OperationInfo info = Containers.forEnable ().add (unit.updateUnit, unit.getRelevantElement ()); + assert info != null; + UninstallUnitWizard wizard = new UninstallUnitWizard (); + wizard.invokeWizard (true); + Containers.forEnable ().removeAll (); + } + fireUpdataUnitChange (); + restoreSelectedRow(row); + focusTable(); + } + */ protected boolean isEnabled (Unit u) { boolean retval = false; @@ -1290,27 +1363,6 @@ }*/ return getActionName (); } - public void performerImpl (Unit u) { - Unit.Installed unit = (Unit.Installed)u; - final int row = getSelectedRow(); - - if (!unit.getRelevantElement ().isEnabled ()) { - OperationInfo info = Containers.forEnable ().add (unit.updateUnit, unit.getRelevantElement ()); - assert info != null; - UninstallUnitWizard wizard = new UninstallUnitWizard (); - wizard.invokeWizard (true); - Containers.forEnable ().removeAll (); - } - fireUpdataUnitChange (); - restoreSelectedRow(row); - focusTable(); - } - - - @Override - protected boolean isVisible (Unit u) { - return false; - } } private class ActivateCategoryAction extends RowTabAction { @@ -1374,11 +1426,62 @@ } - private class DeactivateAction extends RowTabAction { + private class DeactivateAction extends TabAction { public DeactivateAction () { super ("UnitTab_DeactivateAction", /*KeyStroke.getKeyStroke (KeyEvent.VK_D, KeyEvent.CTRL_DOWN_MASK),*/ "EnableDisable"); } + @Override + public void tableDataChanged(Collection units) { + if (units.isEmpty()) { + setEnabled(false); + return; + } + + for (Unit u : units) { + if (!isEnabled(u)) { + setEnabled(false); + return; + } + } + setEnabled(true); + } + + @Override + public void performerImpl() { + final int row = getSelectedRow (); + OperationContainer c = Containers.forDisable(); + for (Unit u : model.getUnits()) { + if (u.isMarked()) { + c.add(u.updateUnit, u.getRelevantElement()); + } + } + UninstallUnitWizard wizard = new UninstallUnitWizard (); + if (wizard.invokeWizard (false)) { + Containers.forUninstall().removeAll(); + } + Containers.forDisable().removeAll(); + restoreSelectedRow(row); + refreshState (); + focusTable (); + } + /* + Unit.Installed unit = (Unit.Installed)u; + final int row = getSelectedRow(); + + if (unit.getRelevantElement ().isEnabled ()) { + OperationInfo info = Containers.forDisable ().add (unit.updateUnit, unit.getRelevantElement ()); + assert info != null; + UninstallUnitWizard wizard = new UninstallUnitWizard (); + if (wizard.invokeWizard (false)) { + Containers.forUninstall ().remove (unit.getRelevantElement ()); + } + Containers.forDisable ().removeAll (); + } + fireUpdataUnitChange (); + restoreSelectedRow(row); + focusTable (); + */ protected boolean isEnabled (Unit u) { boolean retval = false; if ((u != null) && (u instanceof Unit.Installed)) { @@ -1395,29 +1498,6 @@ }*/ return getActionName (); } - public void performerImpl (Unit u) { - Unit.Installed unit = (Unit.Installed)u; - final int row = getSelectedRow(); - - if (unit.getRelevantElement ().isEnabled ()) { - OperationInfo info = Containers.forDisable ().add (unit.updateUnit, unit.getRelevantElement ()); - assert info != null; - UninstallUnitWizard wizard = new UninstallUnitWizard (); - if (wizard.invokeWizard (false)) { - Containers.forUninstall ().remove (unit.getRelevantElement ()); - } - Containers.forDisable ().removeAll (); - } - fireUpdataUnitChange (); - restoreSelectedRow(row); - focusTable (); - } - - - @Override - protected boolean isVisible (Unit u) { - return false; - } } private class DeactivateCategoryAction extends RowTabAction { @@ -1830,8 +1910,10 @@ } } // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JCheckBox advView; private javax.swing.JButton bTabAction; + private javax.swing.JButton bTabAction1; + private javax.swing.JButton bTabAction2; + private javax.swing.JCheckBox detailView; private javax.swing.JLabel lSearch; private javax.swing.JLabel lSelectionInfo; private javax.swing.JLabel lWarning; diff -r bf796e9934fc autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/actions/PluginManagerAction.java --- a/autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/actions/PluginManagerAction.java Tue May 05 15:25:36 2009 +0400 +++ b/autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/actions/PluginManagerAction.java Tue May 05 16:13:31 2009 +0400 @@ -64,11 +64,9 @@ Mnemonics.setLocalizedText (close,NbBundle.getMessage (PluginManagerAction.class, "PluginManager_CloseButton_Name")); pluginManagerUI = new PluginManagerUI ( close, - getValue("InitialTab"), //NOI18N - !Boolean.FALSE.equals(getValue("AdvancedView")) // NOI18N + getValue("InitialTab")//NOI18N ); putValue("InitialTab", null); //NOI18N - putValue("AdvancedView", null); //NOI18N DialogDescriptor dd = new DialogDescriptor ( pluginManagerUI, NbBundle.getMessage (PluginManagerAction.class, "PluginManager_Panel_Name"), diff -r bf796e9934fc welcome/src/org/netbeans/modules/welcome/ui/PluginsPanel.java --- a/welcome/src/org/netbeans/modules/welcome/ui/PluginsPanel.java Tue May 05 15:25:36 2009 +0400 +++ b/welcome/src/org/netbeans/modules/welcome/ui/PluginsPanel.java Tue May 05 16:13:31 2009 +0400 @@ -104,7 +104,6 @@ Class clz = (Class)cl.loadClass("org.netbeans.modules.autoupdate.ui.actions.PluginManagerAction"); CallableSystemAction a = CallableSystemAction.findObject(clz, true); a.putValue("InitialTab", initialTab); // NOI18N - a.putValue("AdvancedView", Boolean.FALSE); // NOI18N a.performAction (); } catch (Exception ex) { Exceptions.printStackTrace(ex);