Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/preferences/ArbitrationServerPage.java')
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/preferences/ArbitrationServerPage.java221
1 files changed, 110 insertions, 111 deletions
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/preferences/ArbitrationServerPage.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/preferences/ArbitrationServerPage.java
index eccd6c82c0e..b66c4c686c3 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/preferences/ArbitrationServerPage.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/preferences/ArbitrationServerPage.java
@@ -21,13 +21,13 @@ import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
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.swt.widgets.Display;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.IWorkbench;
@@ -38,114 +38,113 @@ import org.eclipse.ui.IWorkbenchPreferencePage;
*/
public class ArbitrationServerPage extends PreferencePage implements IWorkbenchPreferencePage {
- public ArbitrationServerPage() {
- super();
- }
-
- @Override
- protected Control createContents(Composite parent) {
- Composite content = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- content.setLayout(layout);
- content.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-
- Group resourceGroup = new Group(content, SWT.NONE);
- resourceGroup.setLayout(new GridLayout());
- resourceGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
- resourceGroup.setText("OSEE Arbitration");
-
- Composite resourceComposite = new Composite(resourceGroup, SWT.NONE);
- resourceComposite.setLayout(new GridLayout(2, false));
- resourceComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
-
- boolean wasArbitrationOverriden = Strings.isValid(OseeClientProperties.getOseeApplicationServer());
- String defaultArbitrationServer = null;
- if (!wasArbitrationOverriden) {
- try {
- defaultArbitrationServer = HttpUrlBuilderClient.getInstance().getArbitrationServerPrefix();
- } catch (OseeDataStoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- }
-
- String defaultApplicationServer = null;
- try {
- defaultApplicationServer = HttpUrlBuilderClient.getInstance().getApplicationServerPrefix();
- } catch (OseeDataStoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
-
- List<Data> entries = new ArrayList<Data>();
-
- if (wasArbitrationOverriden) {
- entries.add(new Data("Arbitration", "Disabled", Display.getDefault().getSystemColor(SWT.COLOR_RED)));
- entries.add(new Data("Application Server: ", defaultApplicationServer != null ? defaultApplicationServer : ""));
- } else {
- entries.add(new Data("Arbitration Server: ", defaultArbitrationServer != null ? defaultArbitrationServer : ""));
- entries.add(new Data("Version To Match: ", OseeCodeVersion.getVersion()));
- entries.add(new Data("Resolved To Server: ", defaultApplicationServer != null ? defaultApplicationServer : ""));
- }
- for (Data entry : entries) {
- Label label1 = new Label(resourceComposite, SWT.NONE);
- label1.setForeground(entry.getLabelColor());
- label1.setText(entry.getLabelText());
-
- Label label2 = new Label(resourceComposite, SWT.NONE);
- label2.setForeground(entry.getDataColor());
- label2.setText(entry.getDataText());
- }
- return content;
- }
-
- public void init(IWorkbench workbench) {
- setPreferenceStore(SkynetGuiPlugin.getInstance().getPreferenceStore());
- setDescription("See default Arbitration Server below.");
- }
-
- private final class Data {
- private final String label;
- private final Color labelColor;
- private final String value;
- private final Color valueColor;
-
- public Data(String label, Color labelColor, String value, Color valueColor) {
- super();
- this.label = label;
- this.labelColor = labelColor;
- this.value = value;
- this.valueColor = valueColor;
- }
-
- public Data(String label, Color labelColor, String value) {
- this(label, labelColor, value, Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
- }
-
- public Data(String label, String value, Color valueColor) {
- this(label, Display.getDefault().getSystemColor(SWT.COLOR_BLUE), value, valueColor);
- }
-
- public Data(String label, String value) {
- this(label, Display.getDefault().getSystemColor(SWT.COLOR_BLUE), value, Display.getDefault().getSystemColor(
- SWT.COLOR_BLACK));
- }
-
- public String getLabelText() {
- return label;
- }
-
- public Color getLabelColor() {
- return labelColor;
- }
-
- public String getDataText() {
- return value;
- }
-
- public Color getDataColor() {
- return valueColor;
- }
-
- }
+ public ArbitrationServerPage() {
+ super();
+ }
+
+ @Override
+ protected Control createContents(Composite parent) {
+ Composite content = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.marginHeight = 0;
+ layout.marginWidth = 0;
+ content.setLayout(layout);
+ content.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ Group resourceGroup = new Group(content, SWT.NONE);
+ resourceGroup.setLayout(new GridLayout());
+ resourceGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+ resourceGroup.setText("OSEE Arbitration");
+
+ Composite resourceComposite = new Composite(resourceGroup, SWT.NONE);
+ resourceComposite.setLayout(new GridLayout(2, false));
+ resourceComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+
+ boolean wasArbitrationOverriden = Strings.isValid(OseeClientProperties.getOseeApplicationServer());
+ String defaultArbitrationServer = null;
+ if (!wasArbitrationOverriden) {
+ try {
+ defaultArbitrationServer = HttpUrlBuilderClient.getInstance().getArbitrationServerPrefix();
+ } catch (OseeDataStoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ String defaultApplicationServer = null;
+ try {
+ defaultApplicationServer = HttpUrlBuilderClient.getInstance().getApplicationServerPrefix();
+ } catch (OseeDataStoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+
+ List<Data> entries = new ArrayList<Data>();
+
+ if (wasArbitrationOverriden) {
+ entries.add(new Data("Arbitration", "Disabled", Displays.getSystemColor(SWT.COLOR_RED)));
+ entries.add(new Data("Application Server: ", defaultApplicationServer != null ? defaultApplicationServer : ""));
+ } else {
+ entries.add(new Data("Arbitration Server: ", defaultArbitrationServer != null ? defaultArbitrationServer : ""));
+ entries.add(new Data("Version To Match: ", OseeCodeVersion.getVersion()));
+ entries.add(new Data("Resolved To Server: ", defaultApplicationServer != null ? defaultApplicationServer : ""));
+ }
+ for (Data entry : entries) {
+ Label label1 = new Label(resourceComposite, SWT.NONE);
+ label1.setForeground(entry.getLabelColor());
+ label1.setText(entry.getLabelText());
+
+ Label label2 = new Label(resourceComposite, SWT.NONE);
+ label2.setForeground(entry.getDataColor());
+ label2.setText(entry.getDataText());
+ }
+ return content;
+ }
+
+ public void init(IWorkbench workbench) {
+ setPreferenceStore(SkynetGuiPlugin.getInstance().getPreferenceStore());
+ setDescription("See default Arbitration Server below.");
+ }
+
+ private final class Data {
+ private final String label;
+ private final Color labelColor;
+ private final String value;
+ private final Color valueColor;
+
+ public Data(String label, Color labelColor, String value, Color valueColor) {
+ super();
+ this.label = label;
+ this.labelColor = labelColor;
+ this.value = value;
+ this.valueColor = valueColor;
+ }
+
+ public Data(String label, Color labelColor, String value) {
+ this(label, labelColor, value, Displays.getSystemColor(SWT.COLOR_BLACK));
+ }
+
+ public Data(String label, String value, Color valueColor) {
+ this(label, Displays.getSystemColor(SWT.COLOR_BLUE), value, valueColor);
+ }
+
+ public Data(String label, String value) {
+ this(label, Displays.getSystemColor(SWT.COLOR_BLUE), value, Displays.getSystemColor(SWT.COLOR_BLACK));
+ }
+
+ public String getLabelText() {
+ return label;
+ }
+
+ public Color getLabelColor() {
+ return labelColor;
+ }
+
+ public String getDataText() {
+ return value;
+ }
+
+ public Color getDataColor() {
+ return valueColor;
+ }
+
+ }
}

Back to the top