Search in sources :

Example 6 with RootFragment

use of org.whole.lang.commons.model.RootFragment in project whole by wholeplatform.

the class ClipboardUtils method createEditPart.

public static IEntityPart createEditPart(EditPartFactory factory, IEntity entity) {
    IGEFEditorKit commonsEditorKit = (IGEFEditorKit) ReflectionFactory.getEditorKit("org.whole.lang.commons.ui.CommonsEditorKit");
    RootFragment rootFragment = CommonsEntityFactory.instance.createRootFragment(entity.wGetAdapter(CommonsEntityDescriptorEnum.Any));
    EditPart rootFragmentPart = commonsEditorKit.getPartFactory().createEditPart(null, rootFragment);
    IEntityPart entityPart = (IEntityPart) factory.createEditPart(rootFragmentPart, entity);
    EntityUtils.remove(entity);
    return entityPart;
}
Also used : RootEditPart(org.eclipse.gef.RootEditPart) EditPart(org.eclipse.gef.EditPart) IGEFEditorKit(org.whole.lang.ui.editor.IGEFEditorKit) RootFragment(org.whole.lang.commons.model.RootFragment) IEntityPart(org.whole.lang.ui.editparts.IEntityPart)

Aggregations

RootFragment (org.whole.lang.commons.model.RootFragment)6 Graphics (org.eclipse.draw2d.Graphics)1 IFigure (org.eclipse.draw2d.IFigure)1 Rectangle (org.eclipse.draw2d.geometry.Rectangle)1 Persist (org.eclipse.e4.ui.di.Persist)1 EditPart (org.eclipse.gef.EditPart)1 RootEditPart (org.eclipse.gef.RootEditPart)1 Control (org.eclipse.swt.widgets.Control)1 IPersistenceProvider (org.whole.lang.codebase.IPersistenceProvider)1 IEntity (org.whole.lang.model.IEntity)1 ModelTransactionCommand (org.whole.lang.ui.commands.ModelTransactionCommand)1 IGEFEditorKit (org.whole.lang.ui.editor.IGEFEditorKit)1 IEntityPart (org.whole.lang.ui.editparts.IEntityPart)1 EntityFigure (org.whole.lang.ui.figures.EntityFigure)1 IEntityFigure (org.whole.lang.ui.figures.IEntityFigure)1 StackLayout (org.whole.lang.ui.layout.StackLayout)1 IEntityPartViewer (org.whole.lang.ui.viewers.IEntityPartViewer)1