-/*******************************************************************************\r
- * Copyright (c) 2013 Association for Decentralized Information Management\r
- * in Industry THTH ry.\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the Eclipse Public License v1.0\r
- * which accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- * Semamtum Oy - initial API and implementation\r
- *******************************************************************************/\r
-package org.simantics;\r
-\r
-import org.simantics.db.Resource;\r
-import org.simantics.platform.ui.PlatformUIResource;\r
-\r
-/**\r
- * @author Antti Villberg\r
- * @see NameLabelUtil\r
- */\r
-public enum NameLabelMode {\r
-\r
- NAME("Name"),\r
- LABEL("Label"),\r
- NAME_AND_LABEL("Name (Label)"),\r
- LABEL_AND_NAME("Label (Name)");\r
-\r
- private String label;\r
-\r
- NameLabelMode(String label) {\r
- this.label = label;\r
- }\r
-\r
- public String getLabel() {\r
- return label;\r
- }\r
-\r
- public NameLabelMode cycle() {\r
- if(NAME == this) return LABEL;\r
- else if (LABEL == this) return NAME_AND_LABEL;\r
- else if (NAME_AND_LABEL == this) return LABEL_AND_NAME;\r
- else return NAME;\r
- }\r
-\r
- public Resource asResource(PlatformUIResource UI) {\r
- if(NAME == this) return UI.NameLabelMode_Name;\r
- else if (LABEL == this) return UI.NameLabelMode_Label;\r
- else if (LABEL_AND_NAME == this) return UI.NameLabelMode_LabelAndName;\r
- else return UI.NameLabelMode_NameAndLabel;\r
- }\r
-\r
- public static NameLabelMode fromString(String value) {\r
- if(value == null) return getDefault();\r
- else return valueOf(value);\r
- }\r
-\r
- public static NameLabelMode getDefault() {\r
- return NAME_AND_LABEL;\r
- }\r
-\r
+/*******************************************************************************
+ * Copyright (c) 2013 Association for Decentralized Information Management
+ * in Industry THTH ry.
+ * 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:
+ * Semamtum Oy - initial API and implementation
+ *******************************************************************************/
+package org.simantics;
+
+import org.simantics.db.Resource;
+import org.simantics.platform.ui.PlatformUIResource;
+
+/**
+ * @author Antti Villberg
+ * @see NameLabelUtil
+ */
+public enum NameLabelMode {
+
+ NAME("Name"),
+ LABEL("Label"),
+ NAME_AND_LABEL("Name (Label)"),
+ LABEL_AND_NAME("Label (Name)");
+
+ private String label;
+
+ NameLabelMode(String label) {
+ this.label = label;
+ }
+
+ public String getLabel() {
+ return label;
+ }
+
+ public NameLabelMode cycle() {
+ if(NAME == this) return LABEL;
+ else if (LABEL == this) return NAME_AND_LABEL;
+ else if (NAME_AND_LABEL == this) return LABEL_AND_NAME;
+ else return NAME;
+ }
+
+ public Resource asResource(PlatformUIResource UI) {
+ if(NAME == this) return UI.NameLabelMode_Name;
+ else if (LABEL == this) return UI.NameLabelMode_Label;
+ else if (LABEL_AND_NAME == this) return UI.NameLabelMode_LabelAndName;
+ else return UI.NameLabelMode_NameAndLabel;
+ }
+
+ public static NameLabelMode fromString(String value) {
+ if(value == null) return getDefault();
+ else return valueOf(value);
+ }
+
+ public static NameLabelMode getDefault() {
+ return NAME_AND_LABEL;
+ }
+
}
\ No newline at end of file