Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2012-08-16 21:02:53 +0000
committerdonald.g.dunne2012-08-16 21:04:02 +0000
commit4caa58d9cc18bb22954048f76063430f8aa7b458 (patch)
tree792b829ca4929ca964ddb2482fb85689744393e6
parent92310725de52d7b5efbad05d7cf3f06b16c7bfaf (diff)
downloadorg.eclipse.osee-4caa58d9cc18bb22954048f76063430f8aa7b458.tar.gz
org.eclipse.osee-4caa58d9cc18bb22954048f76063430f8aa7b458.tar.xz
org.eclipse.osee-4caa58d9cc18bb22954048f76063430f8aa7b458.zip
feature[ats_Q7ZLS]: Improve pattern matching in navigators and dialogs
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage1.java4
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/review/NewPeerToPeerReviewItem.java9
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/AICheckTreeDialog.java5
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionActionableItemListDialog.java11
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionableItemListDialog.java13
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionableItemTreeWithChildrenDialog.java11
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionCheckTreeDialog.java4
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionTreeWithChildrenDialog.java17
-rw-r--r--plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/xnavigate/XNavigateComposite.java18
-rw-r--r--plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/xnavigate/XNavigateViewFilter.java40
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/branch/BranchCheckTreeDialog.java6
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/filteredTree/MinMaxOSEECheckedFilteredTreeDialog.java5
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/filteredTree/OSEECheckedFilteredTree.java5
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/filteredTree/OSEECheckedFilteredTreeDialog.java11
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/filteredTree/OSEEFilteredTreeDialog.java5
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/filteredTree/SimpleCheckFilteredTreeDialog.java6
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/AttributeTypeFilteredCheckTreeDialog.java5
-rw-r--r--plugins/org.eclipse.osee.framework.ui.swt/src/org/eclipse/osee/framework/ui/swt/OSEEFilteredTree.java7
-rw-r--r--plugins/org.eclipse.osee.framework.ui.swt/src/org/eclipse/osee/framework/ui/swt/ToStringContainsPatternFilter.java58
19 files changed, 130 insertions, 110 deletions
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage1.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage1.java
index 9f00cc274b..69bbf39a85 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage1.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage1.java
@@ -56,7 +56,6 @@ import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.dialogs.PatternFilter;
/**
* @author Donald G. Dunne
@@ -65,7 +64,6 @@ public class NewActionPage1 extends WizardPage {
private final NewActionWizard wizard;
private XWidgetPage page;
protected OSEECheckedFilteredTree treeViewer;
- private static PatternFilter patternFilter = new PatternFilter();
private Text descriptionLabel;
private boolean debugPopulated = false;
private static IAtsActionableItem atsAi;
@@ -117,7 +115,7 @@ public class NewActionPage1 extends WizardPage {
new Label(aiComp, SWT.NONE).setText("Select Actionable Items:");
treeViewer =
new OSEECheckedFilteredTree(aiComp,
- SWT.CHECK | SWT.MULTI | SWT.READ_ONLY | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER, patternFilter);
+ SWT.CHECK | SWT.MULTI | SWT.READ_ONLY | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
treeViewer.getViewer().getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
treeViewer.getViewer().setContentProvider(new AITreeContentProvider(Active.Active));
treeViewer.getViewer().setLabelProvider(new AtsObjectLabelProvider());
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/review/NewPeerToPeerReviewItem.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/review/NewPeerToPeerReviewItem.java
index d3c02b55fc..4dcb1ee0ac 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/review/NewPeerToPeerReviewItem.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/review/NewPeerToPeerReviewItem.java
@@ -41,14 +41,17 @@ public class NewPeerToPeerReviewItem extends XNavigateItemAction {
@Override
public void run(TableLoadOption... tableLoadOptions) {
- final ActionableItemListDialog ld = new ActionableItemListDialog(Active.Active);
- ld.setMessage("Select Actionable Items to Review\n\nNOTE: To create a review against " + "an Action and Team Workflow\nopen the object in ATS and select the " + "review to create from the editor.");
+ final ActionableItemListDialog ld =
+ new ActionableItemListDialog(
+ Active.Active,
+ "Select Actionable Items to Review\n\nNOTE: To create a review against " + "an Action and Team Workflow\nopen the object in ATS and select the " + "review to create from the editor.");
int result = ld.open();
if (result == 0) {
final EntryDialog ed = new EntryDialog("Peer Review Title", "Enter Peer Review Title");
if (ed.open() == 0) {
try {
- SkynetTransaction transaction = TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "New Peer To Peer Review");
+ SkynetTransaction transaction =
+ TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "New Peer To Peer Review");
PeerToPeerReviewArtifact peerArt =
PeerToPeerReviewManager.createNewPeerToPeerReview(null, ed.getEntry(), null, new Date(),
AtsUsersClient.getUser(), transaction);
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/AICheckTreeDialog.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/AICheckTreeDialog.java
index 7af508cbb1..5a37d51947 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/AICheckTreeDialog.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/AICheckTreeDialog.java
@@ -30,20 +30,17 @@ import org.eclipse.osee.framework.ui.skynet.util.ArtifactNameSorter;
import org.eclipse.osee.framework.ui.skynet.util.filteredTree.OSEECheckedFilteredTreeDialog;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.dialogs.PatternFilter;
/**
* @author Donald G. Dunne
*/
public class AICheckTreeDialog extends OSEECheckedFilteredTreeDialog {
- private static PatternFilter patternFilter = new PatternFilter();
private final Active active;
private Collection<IAtsActionableItem> initialAias;
public AICheckTreeDialog(String title, String message, Active active) {
- super(title, message, patternFilter, new AITreeContentProvider(active), new AtsObjectLabelProvider(),
- new ArtifactNameSorter());
+ super(title, message, new AITreeContentProvider(active), new AtsObjectLabelProvider(), new ArtifactNameSorter());
this.active = active;
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionActionableItemListDialog.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionActionableItemListDialog.java
index 9f548f9651..e7302d0918 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionActionableItemListDialog.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionActionableItemListDialog.java
@@ -17,8 +17,8 @@ import org.eclipse.osee.ats.util.AtsObjectLabelProvider;
import org.eclipse.osee.framework.core.enums.Active;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.ui.skynet.util.filteredTree.OSEECheckedFilteredTreeDialog;
import org.eclipse.osee.framework.ui.skynet.widgets.XCheckBox;
-import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
@@ -26,12 +26,11 @@ import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.dialogs.CheckedTreeSelectionDialog;
/**
* @author Donald G. Dunne
*/
-public class ActionActionableItemListDialog extends CheckedTreeSelectionDialog {
+public class ActionActionableItemListDialog extends OSEECheckedFilteredTreeDialog {
XCheckBox recurseChildrenCheck = new XCheckBox("Include all children Actionable Items' Actions");
boolean recurseChildren = false;
@@ -41,10 +40,8 @@ public class ActionActionableItemListDialog extends CheckedTreeSelectionDialog {
boolean showAction = false;
public ActionActionableItemListDialog(Active active) {
- super(Displays.getActiveShell(), new AtsObjectLabelProvider(), new AITreeContentProvider(active));
- setTitle("Select Actionable Items");
- setMessage("Select Actionable Items");
- setComparator(new AtsObjectNameSorter());
+ super("Select Actionable Items", "Select Actionable Items", new AITreeContentProvider(active),
+ new AtsObjectLabelProvider(), new AtsObjectNameSorter());
try {
setInput(ActionableItems.getTopLevelActionableItems(active));
} catch (Exception ex) {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionableItemListDialog.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionableItemListDialog.java
index df6ef9f8e0..17baf17c02 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionableItemListDialog.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionableItemListDialog.java
@@ -20,19 +20,16 @@ import org.eclipse.osee.framework.core.enums.Active;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.ui.skynet.util.ArtifactNameSorter;
-import org.eclipse.osee.framework.ui.swt.Displays;
-import org.eclipse.ui.dialogs.CheckedTreeSelectionDialog;
+import org.eclipse.osee.framework.ui.skynet.util.filteredTree.OSEECheckedFilteredTreeDialog;
/**
* @author Donald G. Dunne
*/
-public class ActionableItemListDialog extends CheckedTreeSelectionDialog {
+public class ActionableItemListDialog extends OSEECheckedFilteredTreeDialog {
- public ActionableItemListDialog(Active active) {
- super(Displays.getActiveShell(), new AtsObjectLabelProvider(), new AITreeContentProvider(active));
- setTitle("Select Actionable Item(s)");
- setMessage("Select Actionable Item(s)");
- setComparator(new ArtifactNameSorter());
+ public ActionableItemListDialog(Active active, String message) {
+ super("Select Actionable Item(s)", "Select Actionable Item(s)", new AITreeContentProvider(active),
+ new AtsObjectLabelProvider(), new ArtifactNameSorter());
try {
setInput(ActionableItems.getTopLevelActionableItems(active));
} catch (Exception ex) {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionableItemTreeWithChildrenDialog.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionableItemTreeWithChildrenDialog.java
index 8cc3987715..61cbcfed2b 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionableItemTreeWithChildrenDialog.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionableItemTreeWithChildrenDialog.java
@@ -20,8 +20,8 @@ import org.eclipse.osee.ats.util.AtsObjectLabelProvider;
import org.eclipse.osee.framework.core.enums.Active;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.ui.skynet.util.ArtifactNameSorter;
+import org.eclipse.osee.framework.ui.skynet.util.filteredTree.OSEECheckedFilteredTreeDialog;
import org.eclipse.osee.framework.ui.skynet.widgets.XCheckBox;
-import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
@@ -29,12 +29,11 @@ import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.dialogs.CheckedTreeSelectionDialog;
/**
* @author Donald G. Dunne
*/
-public class ActionableItemTreeWithChildrenDialog extends CheckedTreeSelectionDialog {
+public class ActionableItemTreeWithChildrenDialog extends OSEECheckedFilteredTreeDialog {
XCheckBox recurseChildrenCheck = new XCheckBox("Include all children Actionable Item Actions");
boolean recurseChildren = false;
@@ -45,10 +44,8 @@ public class ActionableItemTreeWithChildrenDialog extends CheckedTreeSelectionDi
}
public ActionableItemTreeWithChildrenDialog(Active active, Collection<IAtsActionableItem> actionableItems) {
- super(Displays.getActiveShell(), new AtsObjectLabelProvider(), new ActionableItemTreeContentProvider(active));
- setTitle("Select Actionable Item");
- setMessage("Select Actionable Item");
- setComparator(new ArtifactNameSorter());
+ super("Select Actionable Item", "Select Actionable Item", new ActionableItemTreeContentProvider(active),
+ new AtsObjectLabelProvider(), new ArtifactNameSorter());
setInput(actionableItems);
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionCheckTreeDialog.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionCheckTreeDialog.java
index 3cc42ae7d8..34147d505b 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionCheckTreeDialog.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionCheckTreeDialog.java
@@ -32,19 +32,17 @@ import org.eclipse.osee.framework.ui.skynet.util.ArtifactNameSorter;
import org.eclipse.osee.framework.ui.skynet.util.filteredTree.OSEECheckedFilteredTreeDialog;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.dialogs.PatternFilter;
/**
* @author Donald G. Dunne
*/
public class TeamDefinitionCheckTreeDialog extends OSEECheckedFilteredTreeDialog {
- private static PatternFilter patternFilter = new PatternFilter();
private final Active active;
private List<IAtsTeamDefinition> initialTeamDefs;
public TeamDefinitionCheckTreeDialog(String title, String message, Active active) {
- super(title, message, patternFilter, new TeamDefinitionTreeContentProvider(active), new AtsObjectLabelProvider(),
+ super(title, message, new TeamDefinitionTreeContentProvider(active), new AtsObjectLabelProvider(),
new ArtifactNameSorter());
this.active = active;
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionTreeWithChildrenDialog.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionTreeWithChildrenDialog.java
index 8a33446bcb..da17aad56f 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionTreeWithChildrenDialog.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionTreeWithChildrenDialog.java
@@ -19,8 +19,8 @@ import org.eclipse.osee.ats.core.config.TeamDefinitions;
import org.eclipse.osee.ats.util.AtsObjectLabelProvider;
import org.eclipse.osee.framework.core.enums.Active;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.ui.skynet.util.filteredTree.OSEECheckedFilteredTreeDialog;
import org.eclipse.osee.framework.ui.skynet.widgets.XCheckBox;
-import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
@@ -28,12 +28,11 @@ import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.dialogs.CheckedTreeSelectionDialog;
/**
* @author Donald G. Dunne
*/
-public class TeamDefinitionTreeWithChildrenDialog extends CheckedTreeSelectionDialog {
+public class TeamDefinitionTreeWithChildrenDialog extends OSEECheckedFilteredTreeDialog {
XCheckBox recurseChildrenCheck = new XCheckBox("Include all children Team Definition Actions");
boolean recurseChildren = false;
@@ -44,10 +43,8 @@ public class TeamDefinitionTreeWithChildrenDialog extends CheckedTreeSelectionDi
}
public TeamDefinitionTreeWithChildrenDialog(Active active, Collection<IAtsTeamDefinition> TeamDefinitions) {
- super(Displays.getActiveShell(), new AtsObjectLabelProvider(), new TeamDefinitionTreeContentProvider(active));
- setTitle("Select Team Definition");
- setMessage("Select Team Definition");
- setComparator(new AtsObjectNameSorter());
+ super("Select Team Defintion", "Select Team Definition", new TeamDefinitionTreeContentProvider(active),
+ new AtsObjectLabelProvider(), new AtsObjectNameSorter());
setInput(TeamDefinitions);
}
@@ -86,16 +83,10 @@ public class TeamDefinitionTreeWithChildrenDialog extends CheckedTreeSelectionDi
return container;
}
- /**
- * @return the recurseChildren
- */
public boolean isRecurseChildren() {
return recurseChildren;
}
- /**
- * @param recurseChildren the recurseChildren to set
- */
public void setRecurseChildren(boolean recurseChildren) {
this.recurseChildren = recurseChildren;
}
diff --git a/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/xnavigate/XNavigateComposite.java b/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/xnavigate/XNavigateComposite.java
index 9965fc608f..b41ddb0910 100644
--- a/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/xnavigate/XNavigateComposite.java
+++ b/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/xnavigate/XNavigateComposite.java
@@ -47,7 +47,7 @@ import org.eclipse.ui.dialogs.PatternFilter;
* @author Donald G. Dunne
*/
public class XNavigateComposite extends Composite {
- private static PatternFilter patternFilter = new PatternFilter();
+ private static PatternFilter patternFilter;
public static enum TableLoadOption {
None,
@@ -74,8 +74,15 @@ public class XNavigateComposite extends Composite {
createControl();
}
+ private PatternFilter getPatternFilter() {
+ if (patternFilter == null) {
+ patternFilter = new XNavigateViewFilter();
+ }
+ return patternFilter;
+ }
+
private void createControl() {
- filteredTree = new OSEEFilteredTree(this, SWT.SINGLE | SWT.BORDER, patternFilter);
+ filteredTree = new OSEEFilteredTree(this, SWT.SINGLE | SWT.BORDER);
filteredTree.getViewer().setContentProvider(new XNavigateContentProvider());
filteredTree.getViewer().setLabelProvider(new XNavigateLabelProvider());
filteredTree.getViewer().getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
@@ -156,13 +163,6 @@ public class XNavigateComposite extends Composite {
}
/**
- * @return the patternFilter
- */
- public PatternFilter getPatternFilter() {
- return patternFilter;
- }
-
- /**
* @return the items
*/
@SuppressWarnings("unchecked")
diff --git a/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/xnavigate/XNavigateViewFilter.java b/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/xnavigate/XNavigateViewFilter.java
index c8d10b700f..924be1b0ce 100644
--- a/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/xnavigate/XNavigateViewFilter.java
+++ b/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/xnavigate/XNavigateViewFilter.java
@@ -10,17 +10,15 @@
*******************************************************************************/
package org.eclipse.osee.framework.ui.plugin.xnavigate;
-import java.util.regex.Pattern;
-import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.ui.dialogs.PatternFilter;
-public class XNavigateViewFilter extends ViewerFilter {
+public class XNavigateViewFilter extends PatternFilter {
- private boolean enabled = false;
private String text;
- public XNavigateViewFilter(TreeViewer treeViewer) {
+ public XNavigateViewFilter() {
// do nothing
}
@@ -30,26 +28,22 @@ public class XNavigateViewFilter extends ViewerFilter {
}
@Override
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- if (!enabled) {
- return true;
+ public void setPattern(String patternString) {
+ super.setPattern(patternString);
+ if (Strings.isValid(patternString)) {
+ text = patternString.toLowerCase();
}
- XNavigateItem item = (XNavigateItem) element;
- return Pattern.compile(text).matcher(item.getName()).find();
- }
-
- /**
- * @return the enabled
- */
- public boolean isEnabled() {
- return enabled;
}
- /**
- * @param enabled the enabled to set
- */
- public void setEnabled(boolean enabled) {
- this.enabled = enabled;
+ @Override
+ protected boolean isLeafMatch(Viewer viewer, Object element) {
+ if (element == null) {
+ return true;
+ }
+ if (!Strings.isValid(text)) {
+ return true;
+ }
+ return element.toString().toLowerCase().contains(text);
}
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/branch/BranchCheckTreeDialog.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/branch/BranchCheckTreeDialog.java
index 7109b0b3cf..e6cb9458ab 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/branch/BranchCheckTreeDialog.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/branch/BranchCheckTreeDialog.java
@@ -30,19 +30,17 @@ import org.eclipse.osee.framework.ui.skynet.widgets.xBranch.BranchViewImageHandl
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.dialogs.PatternFilter;
/**
* @author Donald G. Dunne
*/
public class BranchCheckTreeDialog extends MinMaxOSEECheckedFilteredTreeDialog {
- private static PatternFilter patternFilter = new PatternFilter();
private Collection<Branch> initialBranches;
public BranchCheckTreeDialog(String title, String message, int minSelectionRequired, int maxSelectionRequired) {
- super(title, message, patternFilter, new ArrayTreeContentProvider(), new BranchLabelProvider(),
- new BranchNameSorter(), minSelectionRequired, maxSelectionRequired);
+ super(title, message, new ArrayTreeContentProvider(), new BranchLabelProvider(), new BranchNameSorter(),
+ minSelectionRequired, maxSelectionRequired);
}
public Collection<Branch> getChecked() {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/filteredTree/MinMaxOSEECheckedFilteredTreeDialog.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/filteredTree/MinMaxOSEECheckedFilteredTreeDialog.java
index ca6bfc7dcb..9a6cd749c9 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/filteredTree/MinMaxOSEECheckedFilteredTreeDialog.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/filteredTree/MinMaxOSEECheckedFilteredTreeDialog.java
@@ -19,7 +19,6 @@ import org.eclipse.osee.framework.core.util.Result;
import org.eclipse.osee.framework.jdk.core.util.Collections;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.dialogs.PatternFilter;
/**
* @author Donald G. Dunne
@@ -29,8 +28,8 @@ public class MinMaxOSEECheckedFilteredTreeDialog extends OSEECheckedFilteredTree
private final int maxSelectionRequired;
private final int minSelectionRequired;
- public MinMaxOSEECheckedFilteredTreeDialog(String dialogTitle, String dialogMessage, PatternFilter patternFilter, IContentProvider contentProvider, IBaseLabelProvider labelProvider, ViewerSorter viewerSorter, int minSelectionRequired, int maxSelectionRequired) {
- super(dialogTitle, dialogMessage, patternFilter, contentProvider, labelProvider, viewerSorter);
+ public MinMaxOSEECheckedFilteredTreeDialog(String dialogTitle, String dialogMessage, IContentProvider contentProvider, IBaseLabelProvider labelProvider, ViewerSorter viewerSorter, int minSelectionRequired, int maxSelectionRequired) {
+ super(dialogTitle, dialogMessage, contentProvider, labelProvider, viewerSorter);
this.minSelectionRequired = minSelectionRequired;
this.maxSelectionRequired = maxSelectionRequired;
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/filteredTree/OSEECheckedFilteredTree.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/filteredTree/OSEECheckedFilteredTree.java
index 2fa4c92e2a..917081ea37 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/filteredTree/OSEECheckedFilteredTree.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/filteredTree/OSEECheckedFilteredTree.java
@@ -23,7 +23,6 @@ import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.ui.dialogs.PatternFilter;
/**
* @author Donald G. Dunne
@@ -32,8 +31,8 @@ public class OSEECheckedFilteredTree extends OSEEFilteredTree {
private final Set<Object> checked = new HashSet<Object>();
- public OSEECheckedFilteredTree(Composite parent, int treeStyle, PatternFilter filter) {
- super(parent, treeStyle, filter);
+ public OSEECheckedFilteredTree(Composite parent, int treeStyle) {
+ super(parent, treeStyle);
}
@Override
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/filteredTree/OSEECheckedFilteredTreeDialog.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/filteredTree/OSEECheckedFilteredTreeDialog.java
index 5f921b13f6..3516a05d1a 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/filteredTree/OSEECheckedFilteredTreeDialog.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/filteredTree/OSEECheckedFilteredTreeDialog.java
@@ -27,25 +27,22 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.dialogs.PatternFilter;
public abstract class OSEECheckedFilteredTreeDialog extends MessageDialog {
protected Label statusLabel;
protected Button okButton;
private OSEECheckedFilteredTree treeViewer;
- private final PatternFilter patternFilter;
private Object input;
private final IContentProvider contentProvider;
private final IBaseLabelProvider labelProvider;
private Collection<? extends Object> initialSelections;
private final ViewerSorter viewerSorter;
- public OSEECheckedFilteredTreeDialog(String dialogTitle, String dialogMessage, PatternFilter patternFilter, IContentProvider contentProvider, IBaseLabelProvider labelProvider, ViewerSorter viewerSorter) {
+ public OSEECheckedFilteredTreeDialog(String dialogTitle, String dialogMessage, IContentProvider contentProvider, IBaseLabelProvider labelProvider, ViewerSorter viewerSorter) {
super(new Shell(), dialogTitle, null, dialogMessage, MessageDialog.NONE, new String[] {"OK", "Cancel"}, 0);
this.contentProvider = contentProvider;
this.labelProvider = labelProvider;
- this.patternFilter = patternFilter;
this.viewerSorter = viewerSorter;
setShellStyle(getShellStyle() | SWT.RESIZE);
}
@@ -98,13 +95,15 @@ public abstract class OSEECheckedFilteredTreeDialog extends MessageDialog {
treeViewer =
new OSEECheckedFilteredTree(aiComp,
- SWT.MULTI | SWT.CHECK | SWT.READ_ONLY | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER, patternFilter);
+ SWT.MULTI | SWT.CHECK | SWT.READ_ONLY | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
gd.heightHint = 500;
treeViewer.getViewer().getTree().setLayoutData(gd);
treeViewer.getViewer().setContentProvider(contentProvider);
treeViewer.getViewer().setLabelProvider(labelProvider);
- treeViewer.getViewer().setSorter(viewerSorter);
+ if (viewerSorter != null) {
+ treeViewer.getViewer().setSorter(viewerSorter);
+ }
treeViewer.getViewer().addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/filteredTree/OSEEFilteredTreeDialog.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/filteredTree/OSEEFilteredTreeDialog.java
index 5de9b6455d..9a24adfef9 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/filteredTree/OSEEFilteredTreeDialog.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/filteredTree/OSEEFilteredTreeDialog.java
@@ -36,7 +36,6 @@ public abstract class OSEEFilteredTreeDialog<T> extends MessageDialog {
protected Label statusLabel;
private Button okButton;
private OSEEFilteredTree treeViewer;
- private final PatternFilter patternFilter;
private boolean checkTree = true;
private boolean multiSelect = true;
private T input;
@@ -50,7 +49,6 @@ public abstract class OSEEFilteredTreeDialog<T> extends MessageDialog {
"Cancel"}, 0);
this.contentProvider = contentProvider;
this.labelProvider = labelProvider;
- this.patternFilter = patternFilter;
setShellStyle(getShellStyle() | SWT.RESIZE);
}
@@ -117,8 +115,7 @@ public abstract class OSEEFilteredTreeDialog<T> extends MessageDialog {
treeViewer =
new OSEECheckedFilteredTree(
comp,
- (multiSelect ? SWT.MULTI : SWT.SINGLE) | (isCheckTree() ? SWT.CHECK : SWT.NONE) | SWT.READ_ONLY | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER,
- patternFilter);
+ (multiSelect ? SWT.MULTI : SWT.SINGLE) | (isCheckTree() ? SWT.CHECK : SWT.NONE) | SWT.READ_ONLY | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
TreeViewer viewer = treeViewer.getViewer();
viewer.setContentProvider(contentProvider);
viewer.setLabelProvider(labelProvider);
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/filteredTree/SimpleCheckFilteredTreeDialog.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/filteredTree/SimpleCheckFilteredTreeDialog.java
index cf941ce1f0..9251ce9d18 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/filteredTree/SimpleCheckFilteredTreeDialog.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/filteredTree/SimpleCheckFilteredTreeDialog.java
@@ -14,18 +14,14 @@ package org.eclipse.osee.framework.ui.skynet.util.filteredTree;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.ui.dialogs.PatternFilter;
/**
* @author Donald G. Dunne
*/
public class SimpleCheckFilteredTreeDialog extends MinMaxOSEECheckedFilteredTreeDialog {
- private static PatternFilter patternFilter = new PatternFilter();
-
public SimpleCheckFilteredTreeDialog(String title, String message, ITreeContentProvider contentProvider, LabelProvider labelProvider, ViewerSorter viewerSorter, int minSelectionRequired, int maxSelectionRequired) {
- super(title, message, patternFilter, contentProvider, labelProvider, viewerSorter, minSelectionRequired,
- maxSelectionRequired);
+ super(title, message, contentProvider, labelProvider, viewerSorter, minSelectionRequired, maxSelectionRequired);
}
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/AttributeTypeFilteredCheckTreeDialog.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/AttributeTypeFilteredCheckTreeDialog.java
index 4fde433c93..5f3964f1da 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/AttributeTypeFilteredCheckTreeDialog.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/AttributeTypeFilteredCheckTreeDialog.java
@@ -26,19 +26,16 @@ import org.eclipse.osee.framework.ui.skynet.util.filteredTree.OSEECheckedFiltere
import org.eclipse.osee.framework.ui.skynet.widgets.AttributeContentProvider;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.dialogs.PatternFilter;
/**
* @author Donald G. Dunne
*/
public class AttributeTypeFilteredCheckTreeDialog extends OSEECheckedFilteredTreeDialog {
- private static PatternFilter patternFilter = new PatternFilter();
private Collection<IAttributeType> selectableTypes;
public AttributeTypeFilteredCheckTreeDialog(String title, String message) {
- super(title, message, patternFilter, new AttributeContentProvider(), new AttributeTypeLabelProvider(),
- new ArtifactNameSorter());
+ super(title, message, new AttributeContentProvider(), new AttributeTypeLabelProvider(), new ArtifactNameSorter());
}
public Collection<AttributeType> getChecked() {
diff --git a/plugins/org.eclipse.osee.framework.ui.swt/src/org/eclipse/osee/framework/ui/swt/OSEEFilteredTree.java b/plugins/org.eclipse.osee.framework.ui.swt/src/org/eclipse/osee/framework/ui/swt/OSEEFilteredTree.java
index f19cab139c..85e43df1d2 100644
--- a/plugins/org.eclipse.osee.framework.ui.swt/src/org/eclipse/osee/framework/ui/swt/OSEEFilteredTree.java
+++ b/plugins/org.eclipse.osee.framework.ui.swt/src/org/eclipse/osee/framework/ui/swt/OSEEFilteredTree.java
@@ -25,7 +25,12 @@ import org.eclipse.ui.dialogs.PatternFilter;
public class OSEEFilteredTree extends FilteredTree {
public OSEEFilteredTree(Composite parent) {
- this(parent, SWT.BORDER | SWT.MULTI, new PatternFilter());
+ this(parent, SWT.BORDER | SWT.MULTI, new ToStringContainsPatternFilter());
+ }
+
+ public OSEEFilteredTree(Composite parent, int treeStyle) {
+ super(parent, treeStyle, new ToStringContainsPatternFilter(), false);
+ setInitialText("");
}
public OSEEFilteredTree(Composite parent, int treeStyle, PatternFilter filter) {
diff --git a/plugins/org.eclipse.osee.framework.ui.swt/src/org/eclipse/osee/framework/ui/swt/ToStringContainsPatternFilter.java b/plugins/org.eclipse.osee.framework.ui.swt/src/org/eclipse/osee/framework/ui/swt/ToStringContainsPatternFilter.java
new file mode 100644
index 0000000000..567566ed99
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.ui.swt/src/org/eclipse/osee/framework/ui/swt/ToStringContainsPatternFilter.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.framework.ui.swt;
+
+import java.util.logging.Level;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.ui.swt.internal.Activator;
+import org.eclipse.ui.dialogs.PatternFilter;
+
+public class ToStringContainsPatternFilter extends PatternFilter {
+
+ private String text;
+
+ public ToStringContainsPatternFilter() {
+ // do nothing
+ }
+
+ public void setFilterText(String text) {
+ this.text = text;
+
+ }
+
+ @Override
+ public void setPattern(String patternString) {
+ super.setPattern(patternString);
+ if (patternString == null || patternString.isEmpty()) {
+ text = null;
+ } else {
+ text = patternString.toLowerCase();
+ }
+ }
+
+ @Override
+ protected boolean isLeafMatch(Viewer viewer, Object element) {
+ if (element == null) {
+ return true;
+ }
+ if (text == null || text.isEmpty()) {
+ return true;
+ }
+ try {
+ return element.toString().toLowerCase().contains(text);
+ } catch (Exception ex) {
+ OseeLog.log(Activator.class, Level.SEVERE, ex);
+ }
+ return true;
+ }
+
+}

Back to the top