aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc-Andre Laperle2013-09-04 18:52:04 (EDT)
committerAlexandre Montplaisir2013-09-09 11:22:07 (EDT)
commitb6ef66ba8bb407f71ecf8f3a8fda73f914b605fa (patch)
tree3d6171b9032a03de62460459c9a6ca5085c60203
parentf4895c04fbecf4f8d1d5cbc50df772f885412af7 (diff)
downloadorg.eclipse.linuxtools-b6ef66ba8bb407f71ecf8f3a8fda73f914b605fa.zip
org.eclipse.linuxtools-b6ef66ba8bb407f71ecf8f3a8fda73f914b605fa.tar.gz
org.eclipse.linuxtools-b6ef66ba8bb407f71ecf8f3a8fda73f914b605fa.tar.bz2
Bug 416578 - [TMF] Select/Deselect All buttons in delete supplementary filesrefs/changes/46/16146/3
Change-Id: I47db7273801dd829807b63aa99044521892163cf Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com> Reviewed-on: https://git.eclipse.org/r/16146 Tested-by: Hudson CI Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com> IP-Clean: Bernd Hufmann <bernd.hufmann@ericsson.com> Tested-by: Bernd Hufmann <bernd.hufmann@ericsson.com> Tested-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/dialogs/Messages.java5
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/dialogs/SelectSupplementaryResourcesDialog.java46
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/dialogs/messages.properties7
3 files changed, 51 insertions, 7 deletions
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/dialogs/Messages.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/dialogs/Messages.java
index 37cfbbb..9b1996b 100644
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/dialogs/Messages.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/dialogs/Messages.java
@@ -7,7 +7,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Francois Chouinard - Initial API and implementation
+ * Francois Chouinard - Initial API and implementation
+ * Marc-Andre Laperle - Add select/deselect all
*******************************************************************************/
package org.eclipse.linuxtools.internal.tmf.ui.project.dialogs;
@@ -24,6 +25,8 @@ public class Messages extends NLS {
public static String SelectSpplementaryResources_DialogTitle;
public static String SelectSpplementaryResources_ResourcesGroupTitle;
+ public static String SelectSpplementaryResources_SelectAll;
+ public static String SelectSpplementaryResources_DeselectAll;
static {
// initialize resource bundle
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/dialogs/SelectSupplementaryResourcesDialog.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/dialogs/SelectSupplementaryResourcesDialog.java
index 0b45abc..793b7b0 100644
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/dialogs/SelectSupplementaryResourcesDialog.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/dialogs/SelectSupplementaryResourcesDialog.java
@@ -7,7 +7,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Francois Chouinard - Copied and adapted from NewFolderDialog
+ * Francois Chouinard - Copied and adapted from NewFolderDialog
+ * Marc-Andre Laperle - Add select/deselect all
*******************************************************************************/
package org.eclipse.linuxtools.internal.tmf.ui.project.dialogs;
@@ -23,9 +24,13 @@ import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Group;
@@ -94,7 +99,7 @@ public class SelectSupplementaryResourcesDialog extends Dialog {
Group contextGroup = new Group(composite, SWT.SHADOW_NONE);
contextGroup.setText(Messages.SelectSpplementaryResources_ResourcesGroupTitle);
- contextGroup.setLayout(new GridLayout());
+ contextGroup.setLayout(new GridLayout(2, false));
contextGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
fTreeViewer = new CheckboxTreeViewer(contextGroup, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
@@ -153,6 +158,39 @@ public class SelectSupplementaryResourcesDialog extends Dialog {
});
fTreeViewer.setInput(fAvailableResources);
+ Composite btComp = new Composite(contextGroup, SWT.NONE);
+ FillLayout layout = new FillLayout(SWT.VERTICAL);
+ layout.spacing = 4;
+ btComp.setLayout(layout);
+
+ GridData gd = new GridData();
+ gd.verticalAlignment = SWT.CENTER;
+ btComp.setLayoutData(gd);
+
+ final Button selectAll = new Button(btComp, SWT.PUSH);
+ selectAll.setText(Messages.SelectSpplementaryResources_SelectAll);
+ selectAll.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ Object[] items = fAvailableResources;
+ for (Object treeItem : items) {
+ fTreeViewer.setChecked(treeItem, true);
+ }
+ }
+ });
+
+ final Button deselectAll = new Button(btComp, SWT.PUSH);
+ deselectAll.setText(Messages.SelectSpplementaryResources_DeselectAll);
+ deselectAll.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ Object[] items = fAvailableResources;
+ for (Object treeItem : items) {
+ fTreeViewer.setChecked(treeItem, false);
+ }
+ }
+ });
+
getShell().setMinimumSize(new Point(300, 150));
return composite;
@@ -160,8 +198,8 @@ public class SelectSupplementaryResourcesDialog extends Dialog {
@Override
protected void createButtonsForButtonBar(Composite parent) {
- createButton(parent, IDialogConstants.CANCEL_ID, "&Cancel", true); //$NON-NLS-1$
- createButton(parent, IDialogConstants.OK_ID, "&Ok", true); //$NON-NLS-1$
+ createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, true);
+ createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
}
@Override
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/dialogs/messages.properties b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/dialogs/messages.properties
index 41cde04..ab6840b 100644
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/dialogs/messages.properties
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/dialogs/messages.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2012 Ericsson
+# Copyright (c) 2012, 2013 Ericsson
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
@@ -7,7 +7,10 @@
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
-# Bernd Hufmann - initial API and implementation
+# Bernd Hufmann - initial API and implementation
+# Marc-Andre Laperle - Add select/deselect all
###############################################################################
SelectSpplementaryResources_DialogTitle=Delete Resources
SelectSpplementaryResources_ResourcesGroupTitle=Select resources to delete
+SelectSpplementaryResources_SelectAll=Select All
+SelectSpplementaryResources_DeselectAll=Deselect All \ No newline at end of file