Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormegumi.telles2015-03-13 12:47:04 -0400
committermegumi.telles2015-03-13 17:14:55 -0400
commit58f18e906eb67012164062e7e55e118948776599 (patch)
treea08e7e87f9c2e8ffee399bf4325c0e2eee33803b /plugins
parentfa93607489b6cd8570cc1eeadbf7569ce8d971c4 (diff)
downloadorg.eclipse.osee-58f18e906eb67012164062e7e55e118948776599.tar.gz
org.eclipse.osee-58f18e906eb67012164062e7e55e118948776599.tar.xz
org.eclipse.osee-58f18e906eb67012164062e7e55e118948776599.zip
feature[ats_ATS184471]: Revert default edit and provide preference0.20.1.v201503161909_REL
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/render/RendererManagerTest.java2
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/UserManager.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactDoubleClick.java9
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/preferences/EditorsPreferencePage.java77
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/RendererManager.java2
5 files changed, 77 insertions, 16 deletions
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/render/RendererManagerTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/render/RendererManagerTest.java
index 4e24acc220..1d4eb3ce57 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/render/RendererManagerTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/render/RendererManagerTest.java
@@ -92,7 +92,7 @@ public class RendererManagerTest {
}
private void testGetBestRendererWithOption(Artifact artifact, DefaultOption option) throws OseeCoreException {
- UserManager.setSetting(UserManager.DOUBLE_CLICK_SETTING_KEY, String.valueOf(option == On));
+ UserManager.setSetting(UserManager.DOUBLE_CLICK_SETTING_KEY_ART_EDIT, String.valueOf(option == On));
if (clazz == null) {
try {
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/UserManager.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/UserManager.java
index dac0bf88dc..ffd2d491cb 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/UserManager.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/UserManager.java
@@ -32,7 +32,8 @@ import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
*/
public final class UserManager {
- public static String DOUBLE_CLICK_SETTING_KEY = "onDoubleClickOpenUsingArtifactEditor";
+ public static String DOUBLE_CLICK_SETTING_KEY_ART_EDIT = "onDoubleClickOpenUsingArtifactEditor";
+ public static String DOUBLE_CLICK_SETTING_KEY_EDIT = "onDoubleClickOpenUsingEditMode";
private static final LazyObject<UserAdmin> provider = new LazyObject<UserAdmin>() {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactDoubleClick.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactDoubleClick.java
index 76f70a60e5..b8fe08fb1a 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactDoubleClick.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactDoubleClick.java
@@ -73,7 +73,12 @@ public class ArtifactDoubleClick implements IDoubleClickListener {
}
private static PresentationType edit(Artifact artifact) {
- return (UserManager.getBooleanSetting(UserManager.DOUBLE_CLICK_SETTING_KEY)) ? PresentationType.GENERAL_REQUESTED : PresentationType.SPECIALIZED_EDIT;
+ PresentationType type = PresentationType.DEFAULT_OPEN;
+ if (UserManager.getBooleanSetting(UserManager.DOUBLE_CLICK_SETTING_KEY_ART_EDIT)) {
+ type = PresentationType.GENERAL_REQUESTED;
+ } else if (UserManager.getBooleanSetting(UserManager.DOUBLE_CLICK_SETTING_KEY_EDIT)) {
+ type = PresentationType.SPECIALIZED_EDIT;
+ }
+ return type;
}
-
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/preferences/EditorsPreferencePage.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/preferences/EditorsPreferencePage.java
index 6f956b2dc0..864468e883 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/preferences/EditorsPreferencePage.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/preferences/EditorsPreferencePage.java
@@ -19,11 +19,15 @@ import org.eclipse.osee.framework.skynet.core.SystemGroup;
import org.eclipse.osee.framework.skynet.core.UserManager;
import org.eclipse.osee.framework.ui.skynet.internal.Activator;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
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.Group;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
@@ -31,7 +35,8 @@ public class EditorsPreferencePage extends PreferencePage implements IWorkbenchP
private static String CHANGE_REPORT_CLOSE_CHANGE_REPORT_EDITORS_ON_SHUTDOWN =
"change.report.close.editors.on.shutdown";
private static String ADMIN_INCLUDE_ATTRIBUTE_TAB_ON_ARTIFACT_EDITOR = "artifact.editor.include.attribute.tab";
- private Button artifactEditButton;
+ private Button artifactEditorButton;
+ private Button editButton;
private Button closeChangeReportEditorsOnShutdown;
private Button includeAttributeTabOnArtifactEditor;
@@ -49,15 +54,7 @@ public class EditorsPreferencePage extends PreferencePage implements IWorkbenchP
composite.setLayout(new GridLayout());
composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
- // TODO Temporary until editor opening can be configured by users
- artifactEditButton = new Button(composite, SWT.CHECK);
- artifactEditButton.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, true, false));
- artifactEditButton.setText("Default Presentation opens in Artifact Editor if applicable");
- try {
- artifactEditButton.setSelection(UserManager.getBooleanSetting(UserManager.DOUBLE_CLICK_SETTING_KEY));
- } catch (OseeCoreException ex) {
- OseeLog.log(Activator.class, Level.SEVERE, ex);
- }
+ setDefaultPresentation(composite);
closeChangeReportEditorsOnShutdown = new Button(composite, SWT.CHECK);
closeChangeReportEditorsOnShutdown.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, true, false));
@@ -88,6 +85,62 @@ public class EditorsPreferencePage extends PreferencePage implements IWorkbenchP
return composite;
}
+ private void setDefaultPresentation(Composite composite) {
+ // TODO Temporary until editor opening can be configured by users
+ Group group = new Group(composite, SWT.NULL);
+ group.setText("Default Presentation (if applicable)");
+ group.setLayout(new RowLayout(SWT.VERTICAL));
+ artifactEditorButton = new Button(group, SWT.CHECK);
+ artifactEditorButton.setText("Artifact Editor");
+ artifactEditorButton.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ if (artifactEditorButton.getSelection()) {
+ editButton.setEnabled(false);
+ editButton.setSelection(false);
+ } else {
+ editButton.setEnabled(true);
+ }
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ //
+ }
+ });
+
+ editButton = new Button(group, SWT.CHECK);
+ editButton.setText("Edit Mode");
+ editButton.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ if (editButton.getSelection()) {
+ artifactEditorButton.setEnabled(false);
+ artifactEditorButton.setSelection(false);
+ } else {
+ artifactEditorButton.setEnabled(true);
+ }
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ //
+ }
+ });
+
+ try {
+ if (UserManager.getBooleanSetting(UserManager.DOUBLE_CLICK_SETTING_KEY_ART_EDIT)) {
+ artifactEditorButton.setSelection(UserManager.getBooleanSetting(UserManager.DOUBLE_CLICK_SETTING_KEY_ART_EDIT));
+ } else if (UserManager.getBooleanSetting(UserManager.DOUBLE_CLICK_SETTING_KEY_EDIT)) {
+ editButton.setSelection(UserManager.getBooleanSetting(UserManager.DOUBLE_CLICK_SETTING_KEY_EDIT));
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(Activator.class, Level.SEVERE, ex);
+ }
+ }
+
/**
* initialize the preference store to use with the workbench
*/
@@ -109,7 +162,9 @@ public class EditorsPreferencePage extends PreferencePage implements IWorkbenchP
@Override
public boolean performOk() {
try {
- UserManager.setSetting(UserManager.DOUBLE_CLICK_SETTING_KEY, String.valueOf(artifactEditButton.getSelection()));
+ UserManager.setSetting(UserManager.DOUBLE_CLICK_SETTING_KEY_ART_EDIT,
+ String.valueOf(artifactEditorButton.getSelection()));
+ UserManager.setSetting(UserManager.DOUBLE_CLICK_SETTING_KEY_EDIT, String.valueOf(editButton.getSelection()));
boolean result = closeChangeReportEditorsOnShutdown.getSelection();
UserManager.setSetting(CHANGE_REPORT_CLOSE_CHANGE_REPORT_EDITORS_ON_SHUTDOWN, String.valueOf(result));
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/RendererManager.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/RendererManager.java
index d686011b07..89979a70b4 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/RendererManager.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/RendererManager.java
@@ -108,7 +108,7 @@ public final class RendererManager {
}
private static IRenderer getBestRendererPrototype(PresentationType presentationType, Artifact artifact) throws OseeCoreException {
- if (presentationType == DEFAULT_OPEN && UserManager.getBooleanSetting(UserManager.DOUBLE_CLICK_SETTING_KEY)) {
+ if (presentationType == DEFAULT_OPEN && UserManager.getBooleanSetting(UserManager.DOUBLE_CLICK_SETTING_KEY_ART_EDIT)) {
presentationType = GENERAL_REQUESTED;
}
IRenderer bestRendererPrototype = null;

Back to the top