Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/style/gaugesectiondescription/GaugeSectionDescriptionBackgroundColorPropertySection.java')
-rw-r--r--plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/style/gaugesectiondescription/GaugeSectionDescriptionBackgroundColorPropertySection.java133
1 files changed, 133 insertions, 0 deletions
diff --git a/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/style/gaugesectiondescription/GaugeSectionDescriptionBackgroundColorPropertySection.java b/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/style/gaugesectiondescription/GaugeSectionDescriptionBackgroundColorPropertySection.java
new file mode 100644
index 0000000000..8fc8afc8d9
--- /dev/null
+++ b/plugins/org.eclipse.sirius.editor/src-gen/org/eclipse/sirius/editor/properties/sections/style/gaugesectiondescription/GaugeSectionDescriptionBackgroundColorPropertySection.java
@@ -0,0 +1,133 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2013 THALES GLOBAL SERVICES.
+ * 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:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.sirius.editor.properties.sections.style.gaugesectiondescription;
+
+// Start of user code imports
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
+
+import org.eclipse.sirius.description.style.StylePackage;
+import org.eclipse.sirius.editor.editorPlugin.SiriusEditor;
+import org.eclipse.sirius.editor.properties.sections.common.AbstractComboPropertySection;
+
+// End of user code imports
+
+/**
+ * A section for the backgroundColor property of a GaugeSectionDescription
+ * object.
+ */
+public class GaugeSectionDescriptionBackgroundColorPropertySection extends AbstractComboPropertySection {
+ /**
+ * @see org.eclipse.sirius.editor.properties.sections.AbstractComboPropertySection#getDefaultLabelText()
+ */
+ protected String getDefaultLabelText() {
+ return "BackgroundColor"; //$NON-NLS-1$
+ }
+
+ /**
+ * @see org.eclipse.sirius.editor.properties.sections.AbstractComboPropertySection#getLabelText()
+ */
+ protected String getLabelText() {
+ String labelText;
+ labelText = super.getLabelText() + "*:"; //$NON-NLS-1$
+ // Start of user code get label text
+
+ // End of user code get label text
+ return labelText;
+ }
+
+ /**
+ * @see org.eclipse.sirius.editor.properties.sections.AbstractComboPropertySection#getFeature()
+ */
+ protected EReference getFeature() {
+ return StylePackage.eINSTANCE.getGaugeSectionDescription_BackgroundColor();
+ }
+
+ /**
+ * @see org.eclipse.sirius.editor.properties.sections.AbstractComboPropertySection#getFeatureValue(int)
+ */
+ protected Object getFeatureValue(int index) {
+ return getFeatureValueAt(index);
+ }
+
+ /**
+ * @see org.eclipse.sirius.editor.properties.sections.AbstractComboPropertySection#isEqual(int)
+ */
+ protected boolean isEqual(int index) {
+ boolean isEqual = false;
+ if (getFeatureValueAt(index) == null)
+ isEqual = eObject.eGet(getFeature()) == null;
+ else
+ isEqual = getFeatureValueAt(index).equals(eObject.eGet(getFeature()));
+ return isEqual;
+ }
+
+ /**
+ * Returns the value at the specified index in the choice of values for the
+ * feature.
+ *
+ * @param index
+ * Index of the value.
+ * @return the value at the specified index in the choice of values.
+ */
+ protected Object getFeatureValueAt(int index) {
+ List<?> values = getChoiceOfValues();
+ if (values.size() < index || values.size() == 0 || index == -1) {
+ return null;
+ }
+ return values.get(index);
+ }
+
+ /**
+ * Fetches the list of available values for the feature.
+ *
+ * @return The list of available values for the feature.
+ */
+ protected List<?> getChoiceOfValues() {
+ List<?> values = Collections.emptyList();
+ List<IItemPropertyDescriptor> propertyDescriptors = getDescriptors();
+ for (Iterator<IItemPropertyDescriptor> iterator = propertyDescriptors.iterator(); iterator.hasNext();) {
+ IItemPropertyDescriptor propertyDescriptor = (IItemPropertyDescriptor) iterator.next();
+ if (((EStructuralFeature) propertyDescriptor.getFeature(eObject)) == getFeature())
+ values = new ArrayList<Object>(propertyDescriptor.getChoiceOfValues(eObject));
+ }
+
+ // Required singleValued color reference : do not propose null.
+ values.remove(null);
+
+ // Start of user code choice of values
+ // End of user code choice of values
+ return values;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) {
+ super.createControls(parent, tabbedPropertySheetPage);
+ nameLabel.setFont(SiriusEditor.getFontRegistry().get("required"));
+ // Start of user code create controls
+
+ // End of user code create controls
+ }
+ // Start of user code user operations
+
+ // End of user code user operations
+}

Back to the top