Author: snjeza
Date: 2011-11-18 14:18:37 -0500 (Fri, 18 Nov 2011)
New Revision: 36455
Modified:
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/SoftwarePage.java
Log:
JBIDE-10186 Add the Install button to the bottom left corner of the Software/Update page
Modified:
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/SoftwarePage.java
===================================================================
---
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/SoftwarePage.java 2011-11-18
18:46:37 UTC (rev 36454)
+++
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/SoftwarePage.java 2011-11-18
19:18:37 UTC (rev 36455)
@@ -31,10 +31,13 @@
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ControlAdapter;
import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.layout.RowLayout;
+import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
@@ -61,6 +64,8 @@
public static final String ID = ID_PREFIX + "SoftwarePage";
+ private static final String ICON_INSTALL = "/icons/repository-submit.gif";
+
private Dictionary<Object, Object> environment;
private ScrolledForm form;
private IProgressMonitor monitor;
@@ -150,14 +155,6 @@
}
gd = new GridData(SWT.FILL, SWT.FILL, true, true);
discoveryControl.setLayoutData(gd);
-
- discoveryViewer.addSelectionChangedListener(new ISelectionChangedListener() {
-
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- installAction.setEnabled(discoveryViewer.getInstallableConnectors().size() > 0);
- }
- });
loadingComposite = createLoadingComposite(toolkit, pageBook);
@@ -180,7 +177,29 @@
}
});
-
+ final Button installButton = toolkit.createButton(featureComposite,
"Install", SWT.PUSH);
+ installButton.setEnabled(false);
+ installButton.setImage(JBossCentralActivator.getDefault().getImage(ICON_INSTALL));
+ installButton.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ installAction.run();
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+
+ }
+ });
+ discoveryViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+
+ @Override
+ public void selectionChanged(SelectionChangedEvent event) {
+ installAction.setEnabled(discoveryViewer.getInstallableConnectors().size() > 0);
+ installButton.setEnabled(discoveryViewer.getInstallableConnectors().size() > 0);
+ }
+ });
features.setClient(featureComposite);
showLoading();
pageBook.pack(true);
@@ -336,7 +355,7 @@
private class InstallAction extends Action {
public InstallAction() {
- super("Install",
JBossCentralActivator.imageDescriptorFromPlugin(JBossCentralActivator.PLUGIN_ID,
"/icons/repository-submit.gif"));
+ super("Install",
JBossCentralActivator.imageDescriptorFromPlugin(JBossCentralActivator.PLUGIN_ID,
ICON_INSTALL));
}
@Override
Show replies by date