Skip to content
Snippets Groups Projects
Commit 57489044 authored by Florian Hölzl's avatar Florian Hölzl
Browse files

Added MigrationProviderService introspection with UI.

refs 2460
parent cae5c385
No related branches found
No related tags found
No related merge requests found
Showing
with 151 additions and 22 deletions
......@@ -25,6 +25,7 @@ import org.fortiss.tooling.kernel.introspection.items.ConnectionCompositorServic
import org.fortiss.tooling.kernel.introspection.items.ConstraintCheckerServiceIntrospectionDetailsItem;
import org.fortiss.tooling.kernel.introspection.items.EclipseResourceStorageProviderIntrospectionDetailsItem;
import org.fortiss.tooling.kernel.introspection.items.ElementCompositorServiceIntrospectionDetailsItem;
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;
......@@ -33,6 +34,7 @@ import org.fortiss.tooling.kernel.ui.internal.introspection.details.handler.Cons
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.ElementCompositorServiceIntrospectionDetailsUIHandler;
import org.fortiss.tooling.kernel.ui.internal.introspection.details.handler.MigrationServiceIntrospectionDetailsUIHandler;
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;
......@@ -67,6 +69,8 @@ public final class KISSDetailsUIRegistry {
new EclipseResourceStorageProviderIntrospectionDetailsUIHandler());
registerHandler(ElementCompositorServiceIntrospectionDetailsItem.class,
new ElementCompositorServiceIntrospectionDetailsUIHandler());
registerHandler(MigrationServiceIntrospectionDetailsItem.class,
new MigrationServiceIntrospectionDetailsUIHandler());
registerHandler(PrototypeServiceIntrospectionDetailsItem.class,
new PrototypeServiceIntrospectionDetailsUIHandler());
registerHandler(PersistencyServiceIntrospectionDetailsItem.class,
......
......@@ -43,7 +43,7 @@ public final class ConnectionCompositorServiceIntrospectionDetailsUIHandler exte
/** {@inheritDoc} */
@Override
public Control createComposite(ScrolledComposite parent) {
String heading = "Type to serach registered connection compositors:";
String heading = "Type to search registered connection compositors:";
String footer =
"Number of currently registered connection compositors: " +
getInputObject().countHandlers();
......
......@@ -21,7 +21,9 @@ import java.util.List;
import org.conqat.ide.commons.ui.jface.TreeContentProviderBase;
import org.conqat.lib.commons.collections.Pair;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.TableLabelProviderBase;
import org.eclipse.ui.dialogs.PatternFilter;
import org.fortiss.tooling.kernel.introspection.items.EObjectAwareIntrospectionDetailsItemBase;
/**
......@@ -35,8 +37,22 @@ import org.fortiss.tooling.kernel.introspection.items.EObjectAwareIntrospectionD
public abstract class EObjectAwareIntrospectionDetailsUIHandlerBase extends
IntrospectionDetailsUIHandlerBase {
/** {@inheritDoc} */
@Override
protected ITableLabelProvider createLabelProvider() {
return new EObjectAwareTableLabelProvider();
}
/** {@inheritDoc} */
@Override
protected PatternFilter createPatternFilter() {
PatternFilter pf = new TableViewerPatternFilter();
pf.setIncludeLeadingWildcard(true);
return pf;
}
/** Table label provider for handler registrations with two classes. */
protected static class EObjectAware2TableLabelProvider extends TableLabelProviderBase {
protected static class EObjectAwareTableLabelProvider extends TableLabelProviderBase {
/** {@inheritDoc} */
@Override
public String getColumnText(Object element, int columnIndex) {
......
......@@ -17,14 +17,12 @@ $Id$
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.kernel.ui.internal.introspection.details.handler;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
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.items.EObjectAwareIntrospectionDetailsItemBase;
import org.fortiss.tooling.kernel.introspection.items.ElementCompositorServiceIntrospectionDetailsItem;
import org.fortiss.tooling.kernel.service.IConnectionCompositorService;
......@@ -43,9 +41,9 @@ public final class ElementCompositorServiceIntrospectionDetailsUIHandler extends
/** {@inheritDoc} */
@Override
public Control createComposite(ScrolledComposite parent) {
String heading = "Type to serach registered connection compositors:";
String heading = "Type to search registered element compositors:";
String footer =
"Number of currently registered connection compositors: " +
"Number of currently registered element compositors: " +
getInputObject().countHandlers();
return createFilteredTreeInTabFolder(parent, heading, footer, "Registered Compositors");
}
......@@ -77,20 +75,6 @@ public final class ElementCompositorServiceIntrospectionDetailsUIHandler extends
};
}
/** {@inheritDoc} */
@Override
protected ITableLabelProvider createLabelProvider() {
return new EObjectAware2TableLabelProvider();
}
/** {@inheritDoc} */
@Override
protected PatternFilter createPatternFilter() {
PatternFilter pf = new TableViewerPatternFilter();
pf.setIncludeLeadingWildcard(true);
return pf;
}
/** {@inheritDoc} */
@Override
protected ElementCompositorServiceIntrospectionDetailsItem getInputObject() {
......
/*--------------------------------------------------------------------------+
$Id$
| |
| 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.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.fortiss.tooling.kernel.introspection.items.EObjectAwareIntrospectionDetailsItemBase;
import org.fortiss.tooling.kernel.introspection.items.MigrationServiceIntrospectionDetailsItem;
import org.fortiss.tooling.kernel.service.IMigrationService;
import org.fortiss.tooling.kernel.ui.internal.introspection.details.DetailsUIHandlerBase;
/**
* {@link DetailsUIHandlerBase} for {@link IMigrationService}.
*
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating RED Hash:
*/
public class MigrationServiceIntrospectionDetailsUIHandler extends
EObjectAwareIntrospectionDetailsUIHandlerBase {
/** {@inheritDoc} */
@Override
public Control createComposite(ScrolledComposite parent) {
String heading = "Type to search registered migration providers:";
String footer =
"Number of currently registered migration providers: " +
getInputObject().countHandlers();
return createFilteredTreeInTabFolder(parent, heading, footer, "Registered Providers");
}
/** {@inheritDoc} */
@Override
protected void createTreeColumns(Tree tree) {
TreeColumn col0 = new TreeColumn(tree, SWT.LEFT);
col0.setText("Class / Provider");
col0.setWidth(250);
TreeColumn col1 = new TreeColumn(tree, SWT.LEFT);
col1.setText("Provider Class");
col1.setWidth(400);
TreeColumn col2 = new TreeColumn(tree, SWT.LEFT);
col2.setText("EObject Class");
col2.setWidth(400);
}
/** {@inheritDoc} */
@Override
protected ITreeContentProvider createContentProvider() {
return new EObjectAwareTreeContentProviderBase() {
@Override
protected EObjectAwareIntrospectionDetailsItemBase<?> getInputObject() {
return MigrationServiceIntrospectionDetailsUIHandler.this.getInputObject();
}
};
}
/** {@inheritDoc} */
@Override
protected MigrationServiceIntrospectionDetailsItem getInputObject() {
return (MigrationServiceIntrospectionDetailsItem)dataItem;
}
}
......@@ -34,6 +34,7 @@ import org.fortiss.tooling.kernel.introspection.IIntrospectionDetailsItem;
import org.fortiss.tooling.kernel.introspection.IIntrospectionItem;
import org.fortiss.tooling.kernel.introspection.IIntrospectiveKernelService;
import org.fortiss.tooling.kernel.introspection.KernelIntrospectionSystemService;
import org.fortiss.tooling.kernel.introspection.items.MigrationServiceIntrospectionDetailsItem;
import org.fortiss.tooling.kernel.service.IMigrationService;
import org.fortiss.tooling.kernel.service.base.ObjectAwareServiceBase;
......@@ -159,7 +160,6 @@ public class MigrationService extends ObjectAwareServiceBase<IMigrationProvider>
/** {@inheritDoc} */
@Override
public IIntrospectionDetailsItem getDetailsItem() {
// TODO Auto-generated method stub
return null;
return new MigrationServiceIntrospectionDetailsItem(handlerMap);
}
}
/*--------------------------------------------------------------------------+
$Id$
| |
| 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.introspection.items;
import java.util.List;
import java.util.Map;
import org.fortiss.tooling.kernel.extension.IMigrationProvider;
import org.fortiss.tooling.kernel.internal.MigrationService;
import org.fortiss.tooling.kernel.introspection.IIntrospectionDetailsItem;
/**
* {@link IIntrospectionDetailsItem} for the {@link MigrationService}.
*
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating RED Hash:
*/
public final class MigrationServiceIntrospectionDetailsItem extends
EObjectAwareIntrospectionDetailsItemBase<IMigrationProvider> {
/** Constructor. */
public MigrationServiceIntrospectionDetailsItem(Map<Class<?>, List<IMigrationProvider>> handlers) {
super(handlers);
}
}
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