Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorddunne2010-09-20 13:50:09 -0400
committerRyan D. Brooks2010-09-20 13:50:09 -0400
commit03a1304e18bced59c330995406f0a3b24820d125 (patch)
treed0537d901d4cb75567bcc9a781376da1f86e10a1 /plugins
parent9edb7ea14f3b6d4404028a3c9d28aa7bd03647df (diff)
downloadorg.eclipse.osee-03a1304e18bced59c330995406f0a3b24820d125.tar.gz
org.eclipse.osee-03a1304e18bced59c330995406f0a3b24820d125.tar.xz
org.eclipse.osee-03a1304e18bced59c330995406f0a3b24820d125.zip
feature: Add active parameter to UserListDialog
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/GenerateReviewParticipationReport.java3
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/PromptChangeUtil.java3
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectXViewer.java3
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleXViewer.java3
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/UserRelatedToAtsObjectSearch.java3
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/UserSearchItem.java12
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/UserListDialog.java29
7 files changed, 44 insertions, 12 deletions
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/GenerateReviewParticipationReport.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/GenerateReviewParticipationReport.java
index 30ccc88de2..5146294aa4 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/GenerateReviewParticipationReport.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/GenerateReviewParticipationReport.java
@@ -23,6 +23,7 @@ import org.eclipse.osee.ats.util.xviewer.column.XViewerSmaStateColumn;
import org.eclipse.osee.ats.world.WorldXViewerFactory;
import org.eclipse.osee.ats.world.search.MyReviewWorkflowItem;
import org.eclipse.osee.ats.world.search.MyReviewWorkflowItem.ReviewState;
+import org.eclipse.osee.framework.core.enums.Active;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.DateUtil;
import org.eclipse.osee.framework.skynet.core.User;
@@ -54,7 +55,7 @@ public class GenerateReviewParticipationReport extends XNavigateItemAction {
@Override
public void run(TableLoadOption... tableLoadOptions) throws OseeCoreException {
- UserListDialog ld = new UserListDialog(Displays.getActiveShell());
+ UserListDialog ld = new UserListDialog(Displays.getActiveShell(), Active.Active);
int result = ld.open();
if (result == 0) {
if (ld.getResult().length == 0) {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/PromptChangeUtil.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/PromptChangeUtil.java
index 59d77c3f5d..fd9928043f 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/PromptChangeUtil.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/PromptChangeUtil.java
@@ -28,6 +28,7 @@ import org.eclipse.osee.ats.util.widgets.dialog.VersionListDialog;
import org.eclipse.osee.ats.world.search.GoalSearchItem;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.data.SystemUser;
+import org.eclipse.osee.framework.core.enums.Active;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLevel;
@@ -159,7 +160,7 @@ public final class PromptChangeUtil {
}
public static boolean promptChangeOriginator(final Collection<? extends StateMachineArtifact> smas) throws OseeCoreException {
- UserListDialog ld = new UserListDialog(Displays.getActiveShell(), "Select New Originator");
+ UserListDialog ld = new UserListDialog(Displays.getActiveShell(), "Select New Originator", Active.Active);
int result = ld.open();
if (result == 0) {
User selectedUser = ld.getSelection();
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectXViewer.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectXViewer.java
index 1eb69d6901..d8c4849150 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectXViewer.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectXViewer.java
@@ -28,6 +28,7 @@ import org.eclipse.osee.ats.internal.AtsPlugin;
import org.eclipse.osee.ats.util.widgets.defect.DefectItem.Disposition;
import org.eclipse.osee.ats.util.widgets.defect.DefectItem.InjectionActivity;
import org.eclipse.osee.ats.util.widgets.defect.DefectItem.Severity;
+import org.eclipse.osee.framework.core.enums.Active;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -490,7 +491,7 @@ public class DefectXViewer extends XViewer {
modified = setLocation(defectItems, loc);
}
} else if (xCol.equals(DefectXViewerFactory.User_Col)) {
- UserListDialog ld = new UserListDialog(Displays.getActiveShell(), "Select New User");
+ UserListDialog ld = new UserListDialog(Displays.getActiveShell(), "Select New User", Active.Active);
int result = ld.open();
if (result == 0) {
modified = setUser(defectItems, ld.getSelection());
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleXViewer.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleXViewer.java
index 2da442e3d1..42871d444d 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleXViewer.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleXViewer.java
@@ -23,6 +23,7 @@ import org.eclipse.nebula.widgets.xviewer.XViewerColumn;
import org.eclipse.nebula.widgets.xviewer.util.EnumStringSingleSelectionDialog;
import org.eclipse.osee.ats.internal.AtsPlugin;
import org.eclipse.osee.ats.util.widgets.role.UserRole.Role;
+import org.eclipse.osee.framework.core.enums.Active;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.exception.OseeStateException;
import org.eclipse.osee.framework.logging.OseeLevel;
@@ -237,7 +238,7 @@ public class UserRoleXViewer extends XViewer {
} else if (xCol.equals(UserRoleXViewerFactory.Completed_Col)) {
modified = setCompleted(userRoles);
} else if (xCol.equals(UserRoleXViewerFactory.User_Col)) {
- UserListDialog ld = new UserListDialog(Displays.getActiveShell(), "Select New User");
+ UserListDialog ld = new UserListDialog(Displays.getActiveShell(), "Select New User", Active.Active);
int result = ld.open();
if (result == 0) {
modified = setUser(userRoles, ld.getSelection());
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/UserRelatedToAtsObjectSearch.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/UserRelatedToAtsObjectSearch.java
index ec298fa227..31d21f8894 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/UserRelatedToAtsObjectSearch.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/UserRelatedToAtsObjectSearch.java
@@ -17,6 +17,7 @@ import java.util.List;
import org.eclipse.osee.ats.artifact.AtsAttributeTypes;
import org.eclipse.osee.ats.util.AtsRelationTypes;
import org.eclipse.osee.ats.util.AtsUtil;
+import org.eclipse.osee.framework.core.enums.Active;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.User;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
@@ -35,11 +36,13 @@ public class UserRelatedToAtsObjectSearch extends UserSearchItem {
super(name, user);
this.activeObjectsOnly = activeObjectsOnly;
setLoadView(loadView);
+ setActive(Active.Both);
}
public UserRelatedToAtsObjectSearch(UserRelatedToAtsObjectSearch userRelatedToAtsObjectSearch) {
super(userRelatedToAtsObjectSearch);
this.activeObjectsOnly = userRelatedToAtsObjectSearch.activeObjectsOnly;
+ setActive(Active.Both);
}
@Override
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/UserSearchItem.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/UserSearchItem.java
index e5f77b3590..51cceed104 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/UserSearchItem.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/UserSearchItem.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.ats.world.search;
import java.util.Collection;
+import org.eclipse.osee.framework.core.enums.Active;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.User;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
@@ -28,6 +29,7 @@ public abstract class UserSearchItem extends WorldUISearchItem {
protected final User user;
protected User selectedUser;
+ private Active active = Active.Active;
public UserSearchItem(String name, User user) {
super(name);
@@ -106,7 +108,7 @@ public abstract class UserSearchItem extends WorldUISearchItem {
if (searchType == SearchType.ReSearch && selectedUser != null) {
return;
}
- UserListDialog ld = new UserListDialog(Displays.getActiveShell());
+ UserListDialog ld = new UserListDialog(Displays.getActiveShell(), active);
int result = ld.open();
if (result == 0) {
selectedUser = ld.getSelection();
@@ -173,4 +175,12 @@ public abstract class UserSearchItem extends WorldUISearchItem {
return ImageManager.getImage(FrameworkImage.USER);
}
+ public Active getActive() {
+ return active;
+ }
+
+ public void setActive(Active active) {
+ this.active = active;
+ }
+
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/UserListDialog.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/UserListDialog.java
index 5837d729de..2d32f524bd 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/UserListDialog.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/UserListDialog.java
@@ -10,11 +10,14 @@
*******************************************************************************/
package org.eclipse.osee.framework.ui.skynet.widgets.dialog;
-import org.eclipse.jface.viewers.LabelProvider;
+import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.osee.framework.core.enums.Active;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.User;
import org.eclipse.osee.framework.skynet.core.UserManager;
import org.eclipse.osee.framework.ui.skynet.ArtifactContentProvider;
+import org.eclipse.osee.framework.ui.skynet.ArtifactLabelProvider;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.dialogs.ListDialog;
@@ -24,16 +27,16 @@ import org.eclipse.ui.dialogs.ListDialog;
*/
public class UserListDialog extends ListDialog {
- public UserListDialog(Shell parent) throws OseeCoreException {
- this(parent, "Select User");
+ public UserListDialog(Shell parent, Active active) throws OseeCoreException {
+ this(parent, "Select User", active);
}
- public UserListDialog(Shell parent, String title) throws OseeCoreException {
+ public UserListDialog(Shell parent, String title, Active active) throws OseeCoreException {
super(parent);
setTitle(title);
setMessage(title);
setContentProvider(new ArtifactContentProvider());
- setLabelProvider(new LabelProvider() {
+ setLabelProvider(new ArtifactLabelProvider() {
@Override
public String getText(Object element) {
if (element instanceof User) {
@@ -42,8 +45,20 @@ public class UserListDialog extends ListDialog {
return "Unknown Object";
}
});
- System.err.println("Switch this back to only active: getUsersSortedByName");
- setInput(UserManager.getUsersAllSortedByName());
+ List<User> users = null;
+ if (active == Active.Both) {
+ users = UserManager.getUsersAllSortedByName();
+ } else if (active == Active.Active) {
+ users = UserManager.getUsersSortedByName();
+ } else {
+ users = new ArrayList<User>();
+ for (User user : UserManager.getUsersAllSortedByName()) {
+ if (!user.isActive()) {
+ users.add(user);
+ }
+ }
+ }
+ setInput(users);
setShellStyle(getShellStyle() | SWT.RESIZE);
}

Back to the top