Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/core/org.eclipse.papyrus.properties.runtime/src/org/eclipse/papyrus/properties/runtime/propertyeditor/NullPropertyEditor.java')
-rw-r--r--plugins/core/org.eclipse.papyrus.properties.runtime/src/org/eclipse/papyrus/properties/runtime/propertyeditor/NullPropertyEditor.java100
1 files changed, 100 insertions, 0 deletions
diff --git a/plugins/core/org.eclipse.papyrus.properties.runtime/src/org/eclipse/papyrus/properties/runtime/propertyeditor/NullPropertyEditor.java b/plugins/core/org.eclipse.papyrus.properties.runtime/src/org/eclipse/papyrus/properties/runtime/propertyeditor/NullPropertyEditor.java
new file mode 100644
index 00000000000..8a44e4a7c6d
--- /dev/null
+++ b/plugins/core/org.eclipse.papyrus.properties.runtime/src/org/eclipse/papyrus/properties/runtime/propertyeditor/NullPropertyEditor.java
@@ -0,0 +1,100 @@
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ * 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:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.properties.runtime.propertyeditor;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.papyrus.properties.runtime.propertyeditor.descriptor.IPropertyEditorDescriptor;
+import org.eclipse.papyrus.properties.runtime.propertyeditor.descriptor.PropertyEditorDescriptor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+
+
+/**
+ * Property editor that displays only a single Composite, no information
+ */
+public class NullPropertyEditor extends AbstractPropertyEditor {
+
+ /** main composite created by this property editor */
+ private Composite composite;
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Composite createContent(Composite parent) {
+ composite = getWidgetFactory().createComposite(parent, SWT.NONE);
+ composite.setLayout(new GridLayout());
+ GridData data = new GridData(SWT.FILL, SWT.FILL, true, false);
+ composite.setLayoutData(data);
+ return composite;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void handleContentChanged() {
+ // Nothing to do
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public IStatus init(IPropertyEditorDescriptor descriptor) {
+ this.setDescriptor((PropertyEditorDescriptor)descriptor);
+ return Status.OK_STATUS;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Object getValue() {
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void setValue(Object valueToEdit) {
+ // Nothing to do
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void dispose() {
+ if(isValid(composite)) {
+ composite.dispose();
+ composite = null;
+ setController(null);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean isDisposed() {
+ if(composite == null) {
+ return true;
+ }
+ return composite.isDisposed();
+ }
+
+}

Back to the top