Skip to content
Snippets Groups Projects
Commit 14293808 authored by Johannes Eder's avatar Johannes Eder
Browse files

Merge branch '4020' into 'master'

[4020] KISS View to JavaFX

See merge request !123
parents 69adf7dd 67659695
No related branches found
No related tags found
1 merge request!123[4020] KISS View to JavaFX
Showing
with 50 additions and 779 deletions
# (c) 2011 fortiss GmbH
source.. = src/
source.. = src/,\
res/
output.. = build/
bin.includes = .,\
plugin.xml,\
......
......@@ -41,9 +41,9 @@
</view>
<view
allowMultiple="false"
class="org.fortiss.tooling.kernel.ui.internal.introspection.KISSViewPart"
class="org.fortiss.tooling.kernel.ui.introspection.KISSServicesFXViewPart"
icon="icons/introspection.gif"
id="org.fortiss.tooling.kernel.ui.introspection.view"
id="org.fortiss.tooling.kernel.ui.introspection"
name="Kernel Introspection System Service (KISS)"
restorable="true">
</view>
......
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.layout.BorderPane?>
<BorderPane fx:id="borderPane" xmlns:fx="http://javafx.com/fxml/1" />
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.ScrollPane?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.VBox?>
<AnchorPane xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1">
<children>
<BorderPane fx:id="borderPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<bottom>
<VBox fx:id="vBox" prefHeight="150.0" prefWidth="800.0" BorderPane.alignment="CENTER">
<children>
<ScrollPane fitToWidth="true" hbarPolicy="NEVER" prefHeight="300.0" prefWidth="800.0">
<content>
<Label fx:id="label" style="-fx-padding: 5; -fx-border-style: solid inside; -fx-border-width: 2; -fx-border-insets: 5; -fx-border-radius: 5; -fx-border-color: lightblue;" text="Welcome to KISS!&#10;&#10;This is the kernel introspection system service." wrapText="true" />
</content>
</ScrollPane>
</children>
</VBox>
</bottom>
</BorderPane>
</children>
</AnchorPane>
ActionService.java e29126b5947c9fd2f1d82bb87001b9d0ead50c3b GREEN
AllocationEditPartFactoryService.java 81bd227736013f1157ba9d0f79a9f3deefe10064 GREEN
ContextMenuService.java ca3c899293f25b70ce8e5f0d86ca2f9683329d81 GREEN
EditPartFactoryService.java e9180c0020f1769d9e24ef3c08f9ca5599dbc5c3 GREEN
AllocationEditPartFactoryService.java 1656319f018b4df6d18643e2eb76e012f45c2392 GREEN
ContextMenuService.java 802b6d0ade78f91478cd8959cfb423b9963d43bf GREEN
EditPartFactoryService.java 14c44fd426da4a26bfd4012652ea510a4b149421 GREEN
MarkerService.java 505296c356f8d66c5c009b6d6181a971d02a9501 GREEN
ModelEditorBindingService.java 4f502438a9fed17a3c8d03a7f11140ad1f10a0a9 GREEN
ModelElementHandlerService.java eeb07f6926012aa98256d452d1e554a5486dc657 GREEN
ModelEditorBindingService.java 52038a912db203fb8d63a000a59872cfa94e0eea GREEN
ModelElementHandlerService.java 34adeef844bf98c69f1b9a7252f34d0a2b741b54 GREEN
NavigatorService.java 1d773dde3791ddf7051616fe249558e7e307757d GREEN
ToolingKernelUIInternal.java a70d19883dfb315d860233156d8524cf1ac2952f GREEN
TutorialUIService.java b1d632eca91b4feb583f3930cd6ee4722dd9bfed GREEN
......@@ -28,7 +28,7 @@ import org.fortiss.tooling.kernel.service.IKernelIntrospectionSystemService;
import org.fortiss.tooling.kernel.service.base.EObjectAwareServiceBase;
import org.fortiss.tooling.kernel.ui.ToolingKernelUIActivator;
import org.fortiss.tooling.kernel.ui.extension.IAllocationEditPartFactory;
import org.fortiss.tooling.kernel.ui.internal.introspection.items.AllocationEditPartFactoryServiceIntrospectionDetailsItem;
import org.fortiss.tooling.kernel.ui.introspection.items.AllocationEditPartFactoryKISSDetailsItem;
import org.fortiss.tooling.kernel.ui.service.IAllocationEditPartFactoryService;
import org.fortiss.tooling.kernel.utils.LoggingUtils;
......@@ -150,6 +150,6 @@ public class AllocationEditPartFactoryService
/** {@inheritDoc} */
@Override
public IIntrospectionDetailsItem getDetailsItem() {
return new AllocationEditPartFactoryServiceIntrospectionDetailsItem(handlerMap);
return new AllocationEditPartFactoryKISSDetailsItem(handlerMap);
}
}
......@@ -39,7 +39,7 @@ import org.fortiss.tooling.kernel.service.ITutorialService;
import org.fortiss.tooling.kernel.ui.extension.IContextMenuContributor;
import org.fortiss.tooling.kernel.ui.extension.IContextMenuMultiSelectionContributor;
import org.fortiss.tooling.kernel.ui.extension.data.ContextMenuContextProvider;
import org.fortiss.tooling.kernel.ui.internal.introspection.items.ContextMenuServiceIntrospectionDetailsItem;
import org.fortiss.tooling.kernel.ui.introspection.items.ContextMenuKISSDetailsItem;
import org.fortiss.tooling.kernel.ui.service.IActionService;
import org.fortiss.tooling.kernel.ui.service.IContextMenuService;
import org.fortiss.tooling.kernel.ui.service.ITutorialUIService;
......@@ -278,6 +278,6 @@ public class ContextMenuService implements IContextMenuService, IIntrospectiveKe
/** {@inheritDoc} */
@Override
public IIntrospectionDetailsItem getDetailsItem() {
return new ContextMenuServiceIntrospectionDetailsItem(contextMenuContributorList);
return new ContextMenuKISSDetailsItem(contextMenuContributorList);
}
}
......@@ -29,7 +29,7 @@ import org.fortiss.tooling.kernel.service.IKernelIntrospectionSystemService;
import org.fortiss.tooling.kernel.service.base.EObjectAwareServiceBase;
import org.fortiss.tooling.kernel.ui.ToolingKernelUIActivator;
import org.fortiss.tooling.kernel.ui.extension.IEditPartFactory;
import org.fortiss.tooling.kernel.ui.internal.introspection.items.EditPartFactoryServiceIntrospectionDetailsItem;
import org.fortiss.tooling.kernel.ui.introspection.items.EditPartFactoryKISSDetailsItem;
import org.fortiss.tooling.kernel.ui.service.IEditPartFactoryService;
/**
......@@ -147,6 +147,6 @@ public class EditPartFactoryService extends EObjectAwareServiceBase<IEditPartFac
/** {@inheritDoc} */
@Override
public IIntrospectionDetailsItem getDetailsItem() {
return new EditPartFactoryServiceIntrospectionDetailsItem(handlerMap);
return new EditPartFactoryKISSDetailsItem(handlerMap);
}
}
......@@ -58,8 +58,8 @@ import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
import org.fortiss.tooling.kernel.ui.extension.ModelEditorNotAvailableBinding;
import org.fortiss.tooling.kernel.ui.internal.editor.ExtendableMultiPageEditor;
import org.fortiss.tooling.kernel.ui.internal.editor.ModelElementEditorInput;
import org.fortiss.tooling.kernel.ui.internal.introspection.items.ModelEditorBindingServiceIntrospectionDetailsItem;
import org.fortiss.tooling.kernel.ui.internal.views.library.LibraryViewPart;
import org.fortiss.tooling.kernel.ui.introspection.items.ModelEditorBindingKISSDetailsItem;
import org.fortiss.tooling.kernel.ui.service.IModelEditorBindingService;
import org.fortiss.tooling.kernel.ui.service.IModelElementHandlerService;
......@@ -404,6 +404,6 @@ public class ModelEditorBindingService extends EObjectAwareServiceBase<IModelEdi
/** {@inheritDoc} */
@Override
public IIntrospectionDetailsItem getDetailsItem() {
return new ModelEditorBindingServiceIntrospectionDetailsItem(handlerMap);
return new ModelEditorBindingKISSDetailsItem(handlerMap);
}
}
......@@ -30,7 +30,7 @@ import org.fortiss.tooling.kernel.introspection.IIntrospectiveKernelService;
import org.fortiss.tooling.kernel.service.IKernelIntrospectionSystemService;
import org.fortiss.tooling.kernel.service.base.EObjectAwareServiceBase;
import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
import org.fortiss.tooling.kernel.ui.internal.introspection.items.ModelElementHandlerServiceIntrospectionDetailsItem;
import org.fortiss.tooling.kernel.ui.introspection.items.ModelElementHandlerKISSDetailsItem;
import org.fortiss.tooling.kernel.ui.service.IModelElementHandlerService;
import javafx.scene.Node;
......@@ -186,6 +186,6 @@ public class ModelElementHandlerService
/** {@inheritDoc} */
@Override
public IIntrospectionDetailsItem getDetailsItem() {
return new ModelElementHandlerServiceIntrospectionDetailsItem(handlerMap);
return new ModelElementHandlerKISSDetailsItem(handlerMap);
}
}
KISSViewPart.java 0de931d1947b2fc8c95cb5b5c9ed9d9d3bc82c6e GREEN
KISSViewerContentProvider.java b9740ee3471a70726f3f7e4dd500668301af3f61 GREEN
KISSViewerLabelProvider.java 639495bdc8ce8c13edd464869ff625f745ed9809 GREEN
/*-------------------------------------------------------------------------+
| Copyright 2011 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.kernel.ui.internal.introspection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.ViewerComparator;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.part.ViewPart;
import org.fortiss.tooling.kernel.introspection.IIntrospectionDetailsItem;
import org.fortiss.tooling.kernel.introspection.IIntrospectiveKernelService;
import org.fortiss.tooling.kernel.introspection.KernelIntrospectionSystemService;
import org.fortiss.tooling.kernel.ui.internal.introspection.details.DetailsUIHandlerBase;
import org.fortiss.tooling.kernel.ui.internal.introspection.details.KISSDetailsUIRegistry;
/**
* {@link ViewPart} for the marker display.
*
* @author hoelzl
*/
public class KISSViewPart extends ViewPart implements ISelectionChangedListener {
/** The greeting text. */
private static final String GREETING =
"Welcome to KISS!\n\nThis is the kernel introspection system service.";
/** GUI builder viewer instance. */
private KISSViewerGUI gui;
/** {@inheritDoc} */
@Override
public void createPartControl(Composite parent) {
parent.setLayout(new FillLayout());
gui = new KISSViewerGUI(parent, SWT.NONE);
TreeViewer tv = gui.getTreeViewer();
tv.setContentProvider(new KISSViewerContentProvider());
tv.setLabelProvider(new KISSViewerLabelProvider());
tv.setComparator(new ViewerComparator());
tv.addSelectionChangedListener(this);
gui.getDescriptionText().setText(GREETING);
// the class is used as hidden root element, which contains the instance
// see also content provider implementation for this setup
tv.setInput(KernelIntrospectionSystemService.class);
}
/** {@inheritDoc} */
@Override
public void setFocus() {
gui.getTreeViewer().getControl().setFocus();
}
/** Refreshes the view. Needs to be called on UI thread. */
public void refresh() {
if(!gui.getTreeViewer().getControl().isDisposed()) {
gui.getTreeViewer().refresh();
}
}
/** {@inheritDoc} */
@Override
public void selectionChanged(SelectionChangedEvent event) {
if(gui.getTreeViewer().getControl().isDisposed()) {
return;
}
if(event.getSelection().isEmpty()) {
gui.getDescriptionText().setText(GREETING);
return;
}
if(event.getSelection() instanceof IStructuredSelection) {
IStructuredSelection sel = (IStructuredSelection)event.getSelection();
if(sel.getFirstElement() instanceof IIntrospectiveKernelService) {
updateWidgets((IIntrospectiveKernelService)sel.getFirstElement());
return;
}
}
// fallback
gui.getDescriptionText().setText(GREETING);
}
/** Update the KISS view widgets and controls. */
private void updateWidgets(IIntrospectiveKernelService service) {
gui.getDescriptionText().setText(service.getIntrospectionDescription());
ScrolledComposite sc = gui.getDetailsScrolledComposite();
if(sc.getContent() != null) {
Control old = sc.getContent();
gui.getDetailsScrolledComposite().setContent(null);
old.dispose();
}
IIntrospectionDetailsItem item = service.getDetailsItem();
if(item != null) {
DetailsUIHandlerBase handler =
KISSDetailsUIRegistry.getInstance().getHandler(item.getClass());
if(handler != null) {
handler.setService(service);
handler.setDataItem(item);
Control newContent = handler.createComposite(sc);
sc.setContent(newContent);
}
}
}
}
/*-------------------------------------------------------------------------+
| Copyright 2016 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.kernel.ui.internal.introspection;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Text;
/**
* GENERATED CODE (WindowBuilder)
*
* @author hoelzl
*/
@SuppressWarnings("javadoc")
public class KISSViewerGUI extends Composite {
private TreeViewer treeViewer;
private ScrolledComposite detailsScrolledComposite;
private Composite descriptionComposite;
private Text descriptionText;
/**
* Create the composite.
*
* @param parent
* @param style
*/
public KISSViewerGUI(Composite parent, int style) {
super(parent, style);
setLayout(new FillLayout(SWT.HORIZONTAL));
SashForm verticalSplitSash = new SashForm(this, SWT.VERTICAL | SWT.BORDER | SWT.SMOOTH);
SashForm horizontalSplitSash = new SashForm(verticalSplitSash, SWT.BORDER | SWT.SMOOTH);
treeViewer = new TreeViewer(horizontalSplitSash, SWT.SINGLE | SWT.BORDER);
treeViewer.setAutoExpandLevel(2);
detailsScrolledComposite = new ScrolledComposite(horizontalSplitSash,
SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
detailsScrolledComposite.setExpandHorizontal(true);
detailsScrolledComposite.setExpandVertical(true);
horizontalSplitSash.setWeights(new int[] {1, 5});
descriptionComposite = new Composite(verticalSplitSash, SWT.BORDER);
descriptionComposite.setLayout(new GridLayout());
verticalSplitSash.setWeights(new int[] {7, 1});
descriptionText = new Text(descriptionComposite, SWT.READ_ONLY | SWT.V_SCROLL | SWT.MULTI);
Color gray = Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND);
descriptionText.setBackground(gray);
descriptionText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
}
public TreeViewer getTreeViewer() {
return treeViewer;
}
public ScrolledComposite getDetailsScrolledComposite() {
return detailsScrolledComposite;
}
public Composite getDescriptionComposite() {
return descriptionComposite;
}
public Text getDescriptionText() {
return descriptionText;
}
}
DetailsUIHandlerBase.java d3d2038cee67f61ca0be7e0c832ffc95771cee0f GREEN
KISSDetailsUIRegistry.java 4ae512082e0a7751f9da1d631b1bba44c2e5e8c4 GREEN
/*-------------------------------------------------------------------------+
| Copyright 2016 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.kernel.ui.internal.introspection.details;
import java.util.HashMap;
import org.fortiss.tooling.kernel.introspection.IIntrospectionDetailsItem;
import org.fortiss.tooling.kernel.introspection.IIntrospectionItem;
import org.fortiss.tooling.kernel.introspection.items.ConnectionCompositorServiceIntrospectionDetailsItem;
import org.fortiss.tooling.kernel.introspection.items.ConstraintCheckerServiceIntrospectionDetailsItem;
import org.fortiss.tooling.kernel.introspection.items.EclipseResourceStorageServiceIntrospectionDetailsItem;
import org.fortiss.tooling.kernel.introspection.items.ElementCompositorServiceIntrospectionDetailsItem;
import org.fortiss.tooling.kernel.introspection.items.LibraryServiceIntrospectionDetailsItem;
import org.fortiss.tooling.kernel.introspection.items.MigrationServiceIntrospectionDetailsItem;
import org.fortiss.tooling.kernel.introspection.items.PersistencyServiceIntrospectionDetailsItem;
import org.fortiss.tooling.kernel.introspection.items.PrototypeServiceIntrospectionDetailsItem;
import org.fortiss.tooling.kernel.introspection.items.TransformationServiceIntrospectionDetailsItem;
import org.fortiss.tooling.kernel.ui.internal.introspection.details.handler.AllocationEditPartFactoryServiceIntrospectionDetailsUIHandler;
import org.fortiss.tooling.kernel.ui.internal.introspection.details.handler.ConnectionCompositorServiceIntrospectionDetailsUIHandler;
import org.fortiss.tooling.kernel.ui.internal.introspection.details.handler.ConstraintCheckerServiceIntrospectionDetailsUIHandler;
import org.fortiss.tooling.kernel.ui.internal.introspection.details.handler.ContextMenuServiceIntrospectionDetailsUIHandler;
import org.fortiss.tooling.kernel.ui.internal.introspection.details.handler.EclipseResourceStorageProviderIntrospectionDetailsUIHandler;
import org.fortiss.tooling.kernel.ui.internal.introspection.details.handler.EditPartFactoryServiceIntrospectionDetailsUIHandler;
import org.fortiss.tooling.kernel.ui.internal.introspection.details.handler.ElementCompositorServiceIntrospectionDetailsUIHandler;
import org.fortiss.tooling.kernel.ui.internal.introspection.details.handler.LibraryServiceIntrospectionDetailsUIHandler;
import org.fortiss.tooling.kernel.ui.internal.introspection.details.handler.MigrationServiceIntrospectionDetailsUIHandler;
import org.fortiss.tooling.kernel.ui.internal.introspection.details.handler.ModelEditorBindingServiceIntrospectionDetailsUIHandler;
import org.fortiss.tooling.kernel.ui.internal.introspection.details.handler.ModelElementHandlerServiceIntrospectionDetailsUIHandler;
import org.fortiss.tooling.kernel.ui.internal.introspection.details.handler.PersistencyServiceIntrospectionDetailsUIHandler;
import org.fortiss.tooling.kernel.ui.internal.introspection.details.handler.PrototypeServiceIntrospectionDetailsUIHandler;
import org.fortiss.tooling.kernel.ui.internal.introspection.details.handler.TransformationServiceIntrospectionDetailsUIHandler;
import org.fortiss.tooling.kernel.ui.internal.introspection.items.AllocationEditPartFactoryServiceIntrospectionDetailsItem;
import org.fortiss.tooling.kernel.ui.internal.introspection.items.ContextMenuServiceIntrospectionDetailsItem;
import org.fortiss.tooling.kernel.ui.internal.introspection.items.EditPartFactoryServiceIntrospectionDetailsItem;
import org.fortiss.tooling.kernel.ui.internal.introspection.items.ModelEditorBindingServiceIntrospectionDetailsItem;
import org.fortiss.tooling.kernel.ui.internal.introspection.items.ModelElementHandlerServiceIntrospectionDetailsItem;
/**
* Registry class to provide the details GUI for a given {@link IIntrospectionItem}.
*
* @author hoelzl
*/
public final class KISSDetailsUIRegistry {
/** Returns the singleton instance of the service. */
private static final KISSDetailsUIRegistry INSTANCE = new KISSDetailsUIRegistry();
/** Returns the singleton instance. */
public static KISSDetailsUIRegistry getInstance() {
return INSTANCE;
}
/** The registry. */
private final HashMap<Class<? extends IIntrospectionDetailsItem>, DetailsUIHandlerBase> registry =
new HashMap<Class<? extends IIntrospectionDetailsItem>, DetailsUIHandlerBase>();
/** Constructor. */
public KISSDetailsUIRegistry() {
registerHandler(AllocationEditPartFactoryServiceIntrospectionDetailsItem.class,
new AllocationEditPartFactoryServiceIntrospectionDetailsUIHandler());
registerHandler(ConnectionCompositorServiceIntrospectionDetailsItem.class,
new ConnectionCompositorServiceIntrospectionDetailsUIHandler());
registerHandler(ConstraintCheckerServiceIntrospectionDetailsItem.class,
new ConstraintCheckerServiceIntrospectionDetailsUIHandler());
registerHandler(ContextMenuServiceIntrospectionDetailsItem.class,
new ContextMenuServiceIntrospectionDetailsUIHandler());
registerHandler(EclipseResourceStorageServiceIntrospectionDetailsItem.class,
new EclipseResourceStorageProviderIntrospectionDetailsUIHandler());
registerHandler(EditPartFactoryServiceIntrospectionDetailsItem.class,
new EditPartFactoryServiceIntrospectionDetailsUIHandler());
registerHandler(ElementCompositorServiceIntrospectionDetailsItem.class,
new ElementCompositorServiceIntrospectionDetailsUIHandler());
registerHandler(LibraryServiceIntrospectionDetailsItem.class,
new LibraryServiceIntrospectionDetailsUIHandler());
registerHandler(MigrationServiceIntrospectionDetailsItem.class,
new MigrationServiceIntrospectionDetailsUIHandler());
registerHandler(ModelEditorBindingServiceIntrospectionDetailsItem.class,
new ModelEditorBindingServiceIntrospectionDetailsUIHandler());
registerHandler(ModelElementHandlerServiceIntrospectionDetailsItem.class,
new ModelElementHandlerServiceIntrospectionDetailsUIHandler());
registerHandler(PrototypeServiceIntrospectionDetailsItem.class,
new PrototypeServiceIntrospectionDetailsUIHandler());
registerHandler(PersistencyServiceIntrospectionDetailsItem.class,
new PersistencyServiceIntrospectionDetailsUIHandler());
registerHandler(TransformationServiceIntrospectionDetailsItem.class,
new TransformationServiceIntrospectionDetailsUIHandler());
}
/** Registers the given composite */
public void registerHandler(Class<? extends IIntrospectionDetailsItem> clazz,
DetailsUIHandlerBase detailsHandler) {
registry.put(clazz, detailsHandler);
}
/** Returns the composite factory for the given class. */
public DetailsUIHandlerBase getHandler(Class<? extends IIntrospectionDetailsItem> clazz) {
return registry.get(clazz);
}
}
AllocationEditPartFactoryServiceIntrospectionDetailsUIHandler.java 944cc4d5db305ceba7ca1f1f1957a5160511a228 GREEN
ConnectionCompositorServiceIntrospectionDetailsUIHandler.java bf4744afe94f1b97c2f8442466c10d4969b81854 GREEN
ConstraintCheckerServiceIntrospectionDetailsUIHandler.java 33758640bc77148162b88143dd1ed758a12bcf30 GREEN
ContextMenuServiceIntrospectionDetailsUIHandler.java 33f39e000e14a9c2661ca280e82139593852be7c GREEN
CopyClassNameToClipBoardRunnable.java 884555c7026c466d3401b272fc64b9f693074950 GREEN
EObjectAware2IntrospectionDetailsUIHandlerBase.java 18aefde758dc370f564a535d71bab9afc8bdf91f GREEN
EObjectAwareIntrospectionDetailsUIHandlerBase.java dc14e1cdcb550aaada7d35396de60cb6515d04ce GREEN
EclipseResourceStorageProviderIntrospectionDetailsUIHandler.java 987f882a82cfa20af08e85629e2767c0ebab042f GREEN
EditPartFactoryServiceIntrospectionDetailsUIHandler.java e14b000ffface065dd58f7a9799cceb74acd095e GREEN
ElementCompositorServiceIntrospectionDetailsUIHandler.java 3e5d8e4c268a4498c0b17d2ab83bf17665b37cd0 GREEN
IntrospectionDetailsUIHandlerBase.java fae98d41eaf47401b27e80da542e187d952fb287 GREEN
LibraryServiceIntrospectionDetailsUIHandler.java a17e31bfdb1215b9d50279a37165fac6db0733ea GREEN
MigrationServiceIntrospectionDetailsUIHandler.java 66c7b9094dbf373e56c5a5558bb35073e70d4ec3 GREEN
ModelEditorBindingServiceIntrospectionDetailsUIHandler.java e8c55cd97cba5b4286c9681649970e348e248bf2 GREEN
ModelElementHandlerServiceIntrospectionDetailsUIHandler.java c4f7b3ddb66b2bfa14e0dd64516d613fa54d6df0 GREEN
PersistencyServiceIntrospectionDetailsUIHandler.java 8019c9fa146eb5831be048edc94c8d284cc90595 GREEN
PrototypeServiceIntrospectionDetailsUIHandler.java b61fffe1291bec05fc0f727834be9ab0f1a7acba GREEN
TableViewerPatternFilter.java 7a7cb1f25d12b5c89c91a3e29169412de8cbb867 GREEN
TransformationServiceIntrospectionDetailsUIHandler.java 8e8d54dbc2ad0b765467a25b1fc1fdbc8c388a20 GREEN
/*-------------------------------------------------------------------------+
| Copyright 2016 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.kernel.ui.internal.introspection.details.handler;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Tree;
import org.fortiss.tooling.kernel.introspection.items.ConnectionCompositorServiceIntrospectionDetailsItem;
import org.fortiss.tooling.kernel.introspection.items.EObjectAware2IntrospectionDetailsItemBase;
import org.fortiss.tooling.kernel.service.IConnectionCompositorService;
/**
* Introspection UI handler for the {@link IConnectionCompositorService}.
*
* @author hoelzl
*/
public final class ConnectionCompositorServiceIntrospectionDetailsUIHandler
extends EObjectAware2IntrospectionDetailsUIHandlerBase {
/** {@inheritDoc} */
@Override
public Control createComposite(ScrolledComposite parent) {
String heading = "Type to search registered connection compositors:";
String footer = "Number of currently registered connection compositors: " +
getInputObject().countHandlers();
return createFilteredTreeInTabFolder(parent, heading, footer, "Registered Compositors");
}
/** {@inheritDoc} */
@Override
protected void createTreeColumns(Tree tree) {
createDefaultTreeColumns(tree, "Source / Target / Compositor", 250, "Compositor Class", 400,
"Source EObject Class", 400, "Target EObject Class", 400);
}
/** {@inheritDoc} */
@Override
protected ITreeContentProvider createContentProvider() {
return new EObjectAware2TreeContentProviderBase() {
@Override
protected EObjectAware2IntrospectionDetailsItemBase<?> getInputObject() {
return ConnectionCompositorServiceIntrospectionDetailsUIHandler.this
.getInputObject();
}
};
}
/** {@inheritDoc} */
@Override
protected ConnectionCompositorServiceIntrospectionDetailsItem getInputObject() {
return (ConnectionCompositorServiceIntrospectionDetailsItem)dataItem;
}
}
/*-------------------------------------------------------------------------+
| Copyright 2016 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.kernel.ui.internal.introspection.details.handler;
import org.conqat.ide.commons.ui.jface.TreeContentProviderBase;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.TableLabelProviderBase;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeColumn;
import org.eclipse.ui.dialogs.PatternFilter;
import org.fortiss.tooling.kernel.extension.IConstraintChecker;
import org.fortiss.tooling.kernel.introspection.IIntrospectionItem;
import org.fortiss.tooling.kernel.introspection.items.ConstraintCheckerServiceIntrospectionDetailsItem;
import org.fortiss.tooling.kernel.service.IConstraintCheckerService;
/**
* Introspection UI handler for {@link IIntrospectionItem}s provided by
* {@link IConstraintCheckerService}.
*
* @author hoelzl
*/
public final class ConstraintCheckerServiceIntrospectionDetailsUIHandler
extends IntrospectionDetailsUIHandlerBase {
/** {@inheritDoc} */
@Override
public Control createComposite(ScrolledComposite parent) {
String h = "Type to search registered checkers:";
String f = "Number of registered constraint checkers: " + countCheckers();
return createFilteredTreeInTabFolder(parent, h, f, "Registered Checkers");
}
/** Computes the number of constraint checkers. */
private int countCheckers() {
int count = 0;
for(Class<?> c : getInputObject().getHandlerKeyClasses()) {
count += getInputObject().getHandlerList(c).size();
}
return count;
}
/** {@inheritDoc} */
@Override
protected void createTreeColumns(Tree tree) {
TreeColumn col0 = new TreeColumn(tree, SWT.LEFT);
col0.setText("Model Element / Checker");
col0.setWidth(400);
TreeColumn col1 = new TreeColumn(tree, SWT.LEFT);
col1.setText("Model Element Class");
col1.setWidth(400);
TreeColumn col2 = new TreeColumn(tree, SWT.LEFT);
col2.setText("Constraint Checker Implementation Class");
col2.setWidth(400);
}
/** {@inheritDoc} */
@Override
protected ITreeContentProvider createContentProvider() {
return new TreeContentProviderBase() {
@Override
public Object[] getChildren(Object parentElement) {
if(parentElement == getInputObject()) {
return getInputObject().getHandlerKeyClasses().toArray();
} else if(parentElement instanceof Class) {
return getInputObject().getHandlerList((Class<?>)parentElement).toArray();
}
return null;
}
};
}
/** {@inheritDoc} */
@Override
protected ITableLabelProvider createLabelProvider() {
return new TableLabelProviderBase() {
@SuppressWarnings("unchecked")
@Override
public String getColumnText(Object element, int columnIndex) {
if(element instanceof Class) {
switch(columnIndex) {
case 0:
return ((Class<?>)element).getSimpleName();
case 1:
return ((Class<?>)element).getName();
}
} else if(element instanceof IConstraintChecker) {
IConstraintChecker<EObject> icc = (IConstraintChecker<EObject>)element;
switch(columnIndex) {
case 0:
return icc.getClass().getSimpleName();
case 2:
return icc.getClass().getName();
}
}
return "";
}
};
}
/** {@inheritDoc} */
@Override
protected PatternFilter createPatternFilter() {
return new TableViewerPatternFilter();
}
/** {@inheritDoc} */
@Override
protected ConstraintCheckerServiceIntrospectionDetailsItem getInputObject() {
return (ConstraintCheckerServiceIntrospectionDetailsItem)dataItem;
}
/** {@inheritDoc} */
@Override
protected boolean testSelection(Object selection) {
return true;
}
/** {@inheritDoc} */
@Override
protected void populateContextMenu(Object selection, MenuManager mgr) {
if(selection instanceof Class<?>) {
mgr.add(createCopyClassNameAction((Class<?>)selection));
} else if(selection instanceof IConstraintChecker<?>) {
mgr.add(createCopyClassNameAction(selection.getClass()));
}
}
}
/*-------------------------------------------------------------------------+
| Copyright 2016 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.kernel.ui.internal.introspection.details.handler;
import org.conqat.ide.commons.ui.jface.TreeContentProviderBase;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.TableLabelProviderBase;
import org.eclipse.jface.viewers.ViewerComparator;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeColumn;
import org.eclipse.ui.dialogs.PatternFilter;
import org.fortiss.tooling.kernel.introspection.IIntrospectionItem;
import org.fortiss.tooling.kernel.service.IConstraintCheckerService;
import org.fortiss.tooling.kernel.ui.extension.IContextMenuContributor;
import org.fortiss.tooling.kernel.ui.internal.introspection.items.ContextMenuServiceIntrospectionDetailsItem;
import org.fortiss.tooling.kernel.ui.service.IContextMenuService;
/**
* Introspection UI handler for {@link IIntrospectionItem}s provided by
* {@link IConstraintCheckerService}.
*
* @author hoelzl
*/
public final class ContextMenuServiceIntrospectionDetailsUIHandler
extends IntrospectionDetailsUIHandlerBase {
/** {@inheritDoc} */
@Override
public Control createComposite(ScrolledComposite parent) {
String h = "Type to search registered menu contributors:";
String f = "Number of registered menu contributors: " + getInputObject().getHandlerList();
return createFilteredTreeInTabFolder(parent, h, f, "Registered Contributors");
}
/** {@inheritDoc} */
@Override
protected void createTreeColumns(Tree tree) {
TreeColumn col0 = new TreeColumn(tree, SWT.LEFT);
col0.setText("Menu Section");
col0.setWidth(400);
TreeColumn col1 = new TreeColumn(tree, SWT.LEFT);
col1.setText("Menu Provider Class");
col1.setWidth(500);
}
/** {@inheritDoc} */
@Override
protected ITreeContentProvider createContentProvider() {
return new TreeContentProviderBase() {
@Override
public Object[] getChildren(Object parentElement) {
if(parentElement == getInputObject()) {
return IContextMenuService.MENU_SECTION_IDS;
} else if(parentElement instanceof String) {
return getInputObject().getHandlerList().stream()
.filter(h -> parentElement.equals(h.getMenuSectionID())).toArray();
}
return null;
}
};
}
/** {@inheritDoc} */
@Override
protected ITableLabelProvider createLabelProvider() {
return new TableLabelProviderBase() {
@Override
public String getColumnText(Object element, int columnIndex) {
if(element instanceof String && columnIndex == 0) {
return (String)element;
} else if(element instanceof IContextMenuContributor) {
IContextMenuContributor icc = (IContextMenuContributor)element;
switch(columnIndex) {
case 0:
return icc.getClass().getSimpleName();
case 1:
return icc.getClass().getName();
}
}
return "";
}
};
}
/** {@inheritDoc} */
@Override
protected boolean testSelection(Object selection) {
return selection instanceof IContextMenuContributor;
}
/** {@inheritDoc} */
@Override
protected void populateContextMenu(Object selection, MenuManager mgr) {
IContextMenuContributor c = (IContextMenuContributor)selection;
mgr.add(createCopyClassNameAction(c.getClass()));
}
/** {@inheritDoc} */
@Override
protected PatternFilter createPatternFilter() {
return new TableViewerPatternFilter();
}
/** {@inheritDoc} */
@Override
protected ViewerComparator createComparator() {
return new ViewerComparator() {
/** {@inheritDoc} */
@Override
public int category(Object element) {
if(element instanceof String) {
String section = (String)element;
for(int i = 0; i < IContextMenuService.MENU_SECTION_IDS.length; i++) {
if(section.equals(IContextMenuService.MENU_SECTION_IDS[i])) {
return i;
}
}
return IContextMenuService.MENU_SECTION_IDS.length;
}
return super.category(element);
}
};
}
/** {@inheritDoc} */
@Override
protected ContextMenuServiceIntrospectionDetailsItem getInputObject() {
return (ContextMenuServiceIntrospectionDetailsItem)dataItem;
}
}
/*-------------------------------------------------------------------------+
| Copyright 2016 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.kernel.ui.internal.introspection.details.handler;
import org.eclipse.swt.dnd.Clipboard;
import org.eclipse.swt.dnd.TextTransfer;
import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.widgets.Display;
/**
* {@link Runnable} implementation that copies a given class name to the {@link Clipboard}.
*
* @author hoelzl
*/
public final class CopyClassNameToClipBoardRunnable implements Runnable {
/** The class name. */
private final String className;
/** Constructor. */
public CopyClassNameToClipBoardRunnable(String className) {
this.className = className;
}
/** {@inheritDoc} */
@Override
public void run() {
Clipboard clipboard = new Clipboard(Display.getCurrent());
String[] content = new String[] {className};
Transfer[] transfer = new Transfer[] {TextTransfer.getInstance()};
clipboard.setContents(content, transfer);
}
}
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