Skip to content
Snippets Groups Projects
Commit 5e8b053e authored by Simon Barner's avatar Simon Barner
Browse files

- Introduce sub packages for annotation framework (see...

- Introduce sub packages for annotation framework (see org.fortiss.tooling.base.ui.annotation -> package.html for documentation)
- Standardize class names
parent b0f2d575
No related branches found
No related tags found
No related merge requests found
Showing
with 56 additions and 14 deletions
......@@ -12,6 +12,9 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Vendor: fortiss GmbH
Export-Package: org.fortiss.tooling.base.ui,
org.fortiss.tooling.base.ui.annotation,
org.fortiss.tooling.base.ui.annotation.editingsupport,
org.fortiss.tooling.base.ui.annotation.valueprovider,
org.fortiss.tooling.base.ui.annotation.view,
org.fortiss.tooling.base.ui.compose,
org.fortiss.tooling.base.ui.contentprovider,
org.fortiss.tooling.base.ui.databinding,
......
......@@ -13,7 +13,7 @@
<extension
point="org.eclipse.ui.views">
<view
class="org.fortiss.tooling.base.ui.annotation.GenericAnnotationView"
class="org.fortiss.tooling.base.ui.annotation.view.GenericAnnotationView"
icon="icons/annotation.gif"
id="org.fortiss.tooling.base.ui.annotationBase"
name="Annotation"
......
......@@ -26,6 +26,7 @@ import org.eclipse.jface.viewers.ColumnViewer;
import org.eclipse.jface.viewers.EditingSupport;
import org.fortiss.tooling.base.model.element.IAnnotatedSpecification;
import org.fortiss.tooling.base.model.element.IModelElement;
import org.fortiss.tooling.base.ui.annotation.valueprovider.IAnnotationValueProvider;
/**
* The class {@link AnnotationEntry} is responsible for providing those annotations (or annotation
......
......@@ -25,6 +25,7 @@ import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.tooling.base.model.element.IAnnotatedSpecification;
import org.fortiss.tooling.base.model.element.IModelElement;
import org.fortiss.tooling.base.ui.annotation.valueprovider.IAnnotationValueProvider;
import org.fortiss.tooling.kernel.model.IProjectRootElement;
import org.fortiss.tooling.kernel.service.base.EObjectAwareServiceBase;
import org.fortiss.tooling.kernel.utils.EcoreUtils;
......
......@@ -15,7 +15,7 @@ $Id$
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.base.ui.annotation;
package org.fortiss.tooling.base.ui.annotation.editingsupport;
import java.util.List;
......@@ -29,6 +29,7 @@ import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;
import org.fortiss.tooling.base.model.element.IAnnotatedSpecification;
import org.fortiss.tooling.base.ui.annotation.AnnotationEntry;
import org.fortiss.tooling.kernel.extension.data.ITopLevelElement;
import org.fortiss.tooling.kernel.service.IPersistencyService;
......@@ -41,7 +42,7 @@ import org.fortiss.tooling.kernel.service.IPersistencyService;
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: AC8E4395DB075EC3FA9BF290373BBD9B
*/
public class AnnotationEditingSupportCombo extends EditingSupport {
public class ComboBoxEditingSupport extends EditingSupport {
/** Combo box cell editor */
private ComboBoxViewerCellEditor cellEditor = null;
......@@ -57,7 +58,7 @@ public class AnnotationEditingSupportCombo extends EditingSupport {
* the values for the combo box
* @param class1
*/
public AnnotationEditingSupportCombo(ColumnViewer viewer, List<String> values,
public ComboBoxEditingSupport(ColumnViewer viewer, List<String> values,
Class<? extends IAnnotatedSpecification> class1) {
super(viewer);
cellEditor = new ComboBoxViewerCellEditor((Composite)getViewer().getControl());
......
......@@ -15,7 +15,7 @@ $Id$
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.base.ui.annotation;
package org.fortiss.tooling.base.ui.annotation.editingsupport;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.CellEditor;
......@@ -26,6 +26,7 @@ import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;
import org.fortiss.tooling.base.model.element.IAnnotatedSpecification;
import org.fortiss.tooling.base.ui.annotation.AnnotationEntry;
import org.fortiss.tooling.kernel.extension.data.ITopLevelElement;
import org.fortiss.tooling.kernel.service.IPersistencyService;
......@@ -39,7 +40,7 @@ import org.fortiss.tooling.kernel.service.IPersistencyService;
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 09C91FA1AB55052CD74ECF69E121DD7C
*/
public class AnnotationEditingSupportStandard extends EditingSupport {
public class TextEditingSupport extends EditingSupport {
/** Text cell editor */
protected TextCellEditor cellEditor = null;
......@@ -47,7 +48,7 @@ public class AnnotationEditingSupportStandard extends EditingSupport {
protected Class<? extends IAnnotatedSpecification> specClass;
/** Constructor. */
public AnnotationEditingSupportStandard(ColumnViewer viewer,
public TextEditingSupport(ColumnViewer viewer,
Class<? extends IAnnotatedSpecification> class1) {
super(viewer);
......
<!--
$Id$
@version $Rev$
@ConQAT.Rating YELLOW Hash: 220FF5C80574A4AE88C30A7C56D52CE7
-->
<body>
Editing support to embed annotations into the generic table-based annotation view.
</body>
......@@ -4,5 +4,10 @@
@ConQAT.Rating YELLOW Hash: 220FF5C80574A4AE88C30A7C56D52CE7
-->
<body>
TODO
Annotation framework. It provide a flexible mechanism to decorate model elements with primitive and complex annotations.
<ul>
<li><tt>valueprovider.*</tt>, contains an interface (<tt>IAnnotationValueProvider</tt>) and several predefined concrete value providers to couple the model / data storage with the UI</li>
<li><tt>view.*</tt> provides abstract base classes and a generic table-based view part to display annotations.</li>
<li><tt>editingsupport.*</tt> contains editing support to embed annotations into the generic table-based annotation view.</li>
</body>
......@@ -15,7 +15,7 @@ $Id$
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.base.ui.annotation;
package org.fortiss.tooling.base.ui.annotation.valueprovider;
import java.util.List;
......
<!--
$Id$
@version $Rev$
@ConQAT.Rating YELLOW Hash: 220FF5C80574A4AE88C30A7C56D52CE7
-->
<body>
An interface (<tt>IAnnotationValueProvider</tt>) and several predefined concrete value providers to couple the model / data storage with the UI.
</body>
......@@ -15,12 +15,13 @@ $Id$
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.base.ui.annotation;
package org.fortiss.tooling.base.ui.annotation.view;
import org.eclipse.jface.viewers.ColumnLabelProvider;
import org.eclipse.swt.graphics.Color;
import org.eclipse.wb.swt.SWTResourceManager;
import org.fortiss.tooling.base.model.element.IAnnotatedSpecification;
import org.fortiss.tooling.base.ui.annotation.AnnotationEntry;
/**
* This class provides the labels in the table of the annotation view when no item is selected for
......
......@@ -15,7 +15,7 @@ $Id$
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.base.ui.annotation;
package org.fortiss.tooling.base.ui.annotation.view;
import java.util.ArrayList;
import java.util.List;
......@@ -26,6 +26,8 @@ import org.eclipse.ui.ISelectionListener;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.part.ViewPart;
import org.fortiss.tooling.base.model.element.IModelElement;
import org.fortiss.tooling.base.ui.annotation.AnnotationEntry;
import org.fortiss.tooling.base.ui.annotation.IAnnotationValueService;
import org.fortiss.tooling.base.ui.editpart.DiagramEditPartBase;
import org.fortiss.tooling.base.ui.editpart.ElementEditPartBase;
import org.fortiss.tooling.kernel.ui.util.SelectionUtils;
......
......@@ -15,7 +15,7 @@ $Id$
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.base.ui.annotation;
package org.fortiss.tooling.base.ui.annotation.view;
import java.util.HashMap;
......@@ -33,6 +33,9 @@ import org.eclipse.swt.widgets.Table;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.wb.swt.SWTResourceManager;
import org.fortiss.tooling.base.model.element.IAnnotatedSpecification;
import org.fortiss.tooling.base.ui.annotation.AnnotationEntry;
import org.fortiss.tooling.base.ui.annotation.editingsupport.ComboBoxEditingSupport;
import org.fortiss.tooling.base.ui.annotation.editingsupport.TextEditingSupport;
import org.fortiss.tooling.kernel.model.INamedCommentedElement;
/**
......@@ -162,12 +165,12 @@ public class GenericAnnotationView extends AnnotationViewPartBase {
if(entry.getFixedSpecificationValues(spec.getClass()) == null) {
column.setLabelProvider(new AnnotationLabelProvider(spec.getClass(), this));
EditingSupport editingSupport =
new AnnotationEditingSupportStandard(column.getViewer(), spec.getClass());
new TextEditingSupport(column.getViewer(), spec.getClass());
column.setEditingSupport(editingSupport);
} else {
column.setLabelProvider(new AnnotationLabelProvider(spec.getClass(), this));
EditingSupport editingSupport =
new AnnotationEditingSupportCombo(column.getViewer(),
new ComboBoxEditingSupport(column.getViewer(),
entry.getFixedSpecificationValues(spec.getClass()), spec.getClass());
column.setEditingSupport(editingSupport);
}
......
<!--
$Id$
@version $Rev$
@ConQAT.Rating YELLOW Hash: 220FF5C80574A4AE88C30A7C56D52CE7
-->
<body>
Abstract base classes and a generic table-based view part to display annotations.
</body>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment