diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/FormsEditorBase.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/FormsEditorBase.java index a7fc72f1469841f120abc225414982028e3abb49..a54f68dd2816b37b66ea2e394d4cfa45f2474537 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/FormsEditorBase.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/FormsEditorBase.java @@ -33,12 +33,14 @@ import org.eclipse.ui.forms.widgets.Section; import org.fortiss.tooling.kernel.ui.extension.base.EditorBase; /** - * Basic GEF editor based on forms. + * Basic editor based on forms. + * <p> + * This editor disables the library view. * * @author ratiu * @author $Author: hoelzl $ * @version $Rev: 18709 $ - * @ConQAT.Rating YELLOW Hash: 59FD8F82856ABF18DD742AEB9A1D313C + * @ConQAT.Rating YELLOW Hash: 77237937DC7CBA4AA9BD8B671E8A9926 */ public abstract class FormsEditorBase<T extends EObject> extends EditorBase<T> { @@ -117,4 +119,9 @@ public abstract class FormsEditorBase<T extends EObject> extends EditorBase<T> { return client; } + /** {@inheritDoc} */ + @Override + public boolean enableLibraryView() { + return false; + } } diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/extension/IModelEditor.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/extension/IModelEditor.java index 514b24d9dbd791e9438f55f12e6dbc94a882892b..3bb62f4a3279a3dc26d07b5f358815c93b8c25b9 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/extension/IModelEditor.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/extension/IModelEditor.java @@ -26,12 +26,19 @@ import org.eclipse.ui.IEditorPart; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating GREEN Hash: A0FEDA6616CBC0DCC4632D2E73E4FDA5 + * @ConQAT.Rating YELLOW Hash: CD4AF6D1FAD865473DCF9928CF7C245D */ public interface IModelEditor<T extends EObject> extends IEditorPart { /** Returns the edited object. */ T getEditedObject(); + /** + * Returns whether the library view should be active for this editor. If an + * editor does not need elements to be dragged from the library it may + * return <code>false</code> here. + */ + boolean enableLibraryView(); + /** Sets the highlighting of the given model element to the given value. */ void setHighlight(EObject element, boolean highlighted); diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/extension/base/EditorBase.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/extension/base/EditorBase.java index 2d33cf858b5c6ba931b3da0c068489baf5369be7..152231a546dd80016175d86ddc0108ace7a40ce9 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/extension/base/EditorBase.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/extension/base/EditorBase.java @@ -35,11 +35,13 @@ import org.fortiss.tooling.kernel.ui.internal.editor.ModelElementEditorInput; /** * Base implementation of model element editors returned by * {@link IModelEditorBinding}s. + * <p> + * By default this implementation enables the library view. * * @author hoelzlf * @author $Author$ * @version $Rev$ - * @ConQAT.Rating GREEN Hash: D735C9795A2EB99EDB8D0DF67CDF0A23 + * @ConQAT.Rating YELLOW Hash: 8E78A5604AD81E0BA5E5124F58512E6A */ public abstract class EditorBase<T extends EObject> extends EditorPart implements IActionContributingEditor, IModelEditor<T> { @@ -159,4 +161,10 @@ public abstract class EditorBase<T extends EObject> extends EditorPart public void clearAllHighlights() { // nothing to do } + + /** {@inheritDoc} */ + @Override + public boolean enableLibraryView() { + return true; + } } diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/editor/ExtendableMultiPageEditor.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/editor/ExtendableMultiPageEditor.java index 84e5eed33626ae396df78afa6bd9baf259f7622f..07a73b1e2f34d5114f40b1647ae8728f08446503 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/editor/ExtendableMultiPageEditor.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/editor/ExtendableMultiPageEditor.java @@ -56,8 +56,9 @@ import org.fortiss.tooling.kernel.ui.util.PropertiesConstantUtils; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating GREEN Hash: 0EF0D64A6035A48B0886CCC162C90293 + * @ConQAT.Rating YELLOW Hash: 9EAFF8E3E63D2E476AE2EB23C595D329 */ +@SuppressWarnings("rawtypes") public class ExtendableMultiPageEditor extends MultiPageEditorPart implements ITabbedPropertySheetPageContributor, CommandStackListener, ISaveablePart, IModelEditor<EObject> { @@ -238,7 +239,6 @@ public class ExtendableMultiPageEditor extends MultiPageEditorPart implements /** * {@inheritDoc} */ - @SuppressWarnings("rawtypes") @Override public Object getAdapter(Class adapter) { if (adapter == IPropertySheetPage.class) { @@ -277,7 +277,6 @@ public class ExtendableMultiPageEditor extends MultiPageEditorPart implements } /** {@inheritDoc} */ - @SuppressWarnings("rawtypes") @Override public void setHighlight(EObject element, boolean highlighted) { // delegate to active editor @@ -288,7 +287,6 @@ public class ExtendableMultiPageEditor extends MultiPageEditorPart implements } /** {@inheritDoc} */ - @SuppressWarnings("rawtypes") @Override public void clearAllHighlights() { // delegate to active editor @@ -297,4 +295,15 @@ public class ExtendableMultiPageEditor extends MultiPageEditorPart implements ((IModelEditor) part).clearAllHighlights(); } } + + /** {@inheritDoc} */ + @Override + public boolean enableLibraryView() { + // delegate to active editor + IEditorPart part = getActiveEditor(); + if (part instanceof IModelEditor) { + return ((IModelEditor) part).enableLibraryView(); + } + return false; + } } diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/LibraryView.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/LibraryView.java index 7e69c5f8a37e9e9b7c3f3f9346d2613dc7adf31d..5d25242f8d1b41f338ef70812ae7f0ee9127698d 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/LibraryView.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/LibraryView.java @@ -51,7 +51,7 @@ import org.fortiss.tooling.kernel.ui.service.IModelElementHandlerService; * @author eder * @author $Author: hoelzl $ * @version $Rev: 18709 $ - * @ConQAT.Rating GREEN Hash: 65BA252C5E41249091A127DAC0282DC1 + * @ConQAT.Rating YELLOW Hash: CCABADEE562619A5D1238EA8BD8BAF81 */ public class LibraryView extends ViewPart { @@ -131,7 +131,8 @@ public class LibraryView extends ViewPart { @SuppressWarnings("unchecked") private void updateEditorFilters(IEditorPart editor) { supportedBaseClasses.clear(); - if (editor instanceof EditorBase) { + if (editor instanceof EditorBase + && ((EditorBase<? extends EObject>) editor).enableLibraryView()) { EditorBase<? extends EObject> editorBase = (EditorBase<? extends EObject>) editor; containerObject = editorBase.getEditedObject(); for (Class<? extends EObject> clazz : editorBase