Search in sources :

Example 1 with WholeComponentEditPolicy

use of org.whole.lang.ui.editpolicies.WholeComponentEditPolicy in project whole by wholeplatform.

the class AbstractConnectedFreeformRootPart method createEditPolicies.

// public IFigure getContentPane() {
// return pane;
// }
protected void createEditPolicies() {
    installEditPolicy(EditPolicy.CONTAINER_ROLE, new WholeContainerEditPolicy(getCommandFactory()));
    installEditPolicy(EditPolicy.COMPONENT_ROLE, new WholeComponentEditPolicy(getCommandFactory()));
    installEditPolicy(EditPolicy.LAYOUT_ROLE, new WholeFreeformLayoutEditPolicy((XYLayout) getContentPane().getLayoutManager(), getCommandFactory()) {

        protected DnDOverCompositeRequest createDnDOverCompositeRequest(IEntity entity) {
            return new DnDOverCompositeRequest(PartRequest.MOVE_ADD_CHILD, (IEntityPart) getHost(), entity, null) {

                @Override
                public IEntity getModelEntity() {
                    // FIXME workaround to get nodes composite
                    IEntity modelEntity = super.getModelEntity().wGet(0);
                    return modelEntity;
                }
            };
        }
    });
    installEditPolicy("Snap Feedback", new SnapFeedbackPolicy());
}
Also used : WholeContainerEditPolicy(org.whole.lang.ui.editpolicies.WholeContainerEditPolicy) DnDOverCompositeRequest(org.whole.lang.ui.requests.DnDOverCompositeRequest) WholeComponentEditPolicy(org.whole.lang.ui.editpolicies.WholeComponentEditPolicy) WholeFreeformLayoutEditPolicy(org.whole.lang.ui.editpolicies.WholeFreeformLayoutEditPolicy) IEntity(org.whole.lang.model.IEntity) EntityXYLayout(org.whole.lang.ui.layout.EntityXYLayout) XYLayout(org.eclipse.draw2d.XYLayout) SnapFeedbackPolicy(org.eclipse.gef.editpolicies.SnapFeedbackPolicy)

Example 2 with WholeComponentEditPolicy

use of org.whole.lang.ui.editpolicies.WholeComponentEditPolicy in project whole by wholeplatform.

the class AbstractPart method createEditPolicies.

protected void createEditPolicies() {
    installEditPolicy(EditPolicy.CONTAINER_ROLE, new WholeContainerEditPolicy(getCommandFactory()));
    installEditPolicy(EditPolicy.COMPONENT_ROLE, new WholeComponentEditPolicy(getCommandFactory()));
    installEditPolicy(EditPolicy.LAYOUT_ROLE, new WholeLayoutEditPolicy(getCommandFactory()));
// installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new WholeHilightEditPolicy());
}
Also used : WholeContainerEditPolicy(org.whole.lang.ui.editpolicies.WholeContainerEditPolicy) WholeLayoutEditPolicy(org.whole.lang.ui.editpolicies.WholeLayoutEditPolicy) WholeComponentEditPolicy(org.whole.lang.ui.editpolicies.WholeComponentEditPolicy)

Example 3 with WholeComponentEditPolicy

use of org.whole.lang.ui.editpolicies.WholeComponentEditPolicy in project whole by wholeplatform.

the class FreeformRootPart method createEditPolicies.

protected void createEditPolicies() {
    installEditPolicy(EditPolicy.CONTAINER_ROLE, new WholeContainerEditPolicy(getCommandFactory()));
    installEditPolicy(EditPolicy.COMPONENT_ROLE, new WholeComponentEditPolicy(getCommandFactory()));
    installEditPolicy(EditPolicy.LAYOUT_ROLE, new WholeFreeformLayoutEditPolicy((XYLayout) getContentPane().getLayoutManager(), getCommandFactory()) {

        @Override
        protected EditPolicy createChildEditPolicy(EditPart child) {
            return new WholeNonResizableEditPolicy();
        }

        @Override
        protected Command getCreateCommand(CreateRequest request) {
            // FIXME
            return super.getCreateCommand(request);
        }
    });
    installEditPolicy("Snap Feedback", new SnapFeedbackPolicy());
}
Also used : WholeContainerEditPolicy(org.whole.lang.ui.editpolicies.WholeContainerEditPolicy) WholeComponentEditPolicy(org.whole.lang.ui.editpolicies.WholeComponentEditPolicy) WholeFreeformLayoutEditPolicy(org.whole.lang.ui.editpolicies.WholeFreeformLayoutEditPolicy) Command(org.eclipse.gef.commands.Command) WholeNonResizableEditPolicy(org.whole.lang.ui.editpolicies.WholeNonResizableEditPolicy) CreateRequest(org.eclipse.gef.requests.CreateRequest) EditPart(org.eclipse.gef.EditPart) EntityXYLayout(org.whole.lang.ui.layout.EntityXYLayout) XYLayout(org.eclipse.draw2d.XYLayout) WholeContainerEditPolicy(org.whole.lang.ui.editpolicies.WholeContainerEditPolicy) WholeNonResizableEditPolicy(org.whole.lang.ui.editpolicies.WholeNonResizableEditPolicy) WholeFreeformLayoutEditPolicy(org.whole.lang.ui.editpolicies.WholeFreeformLayoutEditPolicy) WholeComponentEditPolicy(org.whole.lang.ui.editpolicies.WholeComponentEditPolicy) EditPolicy(org.eclipse.gef.EditPolicy) SnapFeedbackPolicy(org.eclipse.gef.editpolicies.SnapFeedbackPolicy)

Example 4 with WholeComponentEditPolicy

use of org.whole.lang.ui.editpolicies.WholeComponentEditPolicy in project whole by wholeplatform.

the class AbstractFreeformContentPanePart method createEditPolicies.

protected void createEditPolicies() {
    installEditPolicy(EditPolicy.COMPONENT_ROLE, new WholeComponentEditPolicy(getCommandFactory()));
    installEditPolicy(EditPolicy.LAYOUT_ROLE, new WholeLayoutEditPolicy(getCommandFactory()));
}
Also used : WholeLayoutEditPolicy(org.whole.lang.ui.editpolicies.WholeLayoutEditPolicy) WholeComponentEditPolicy(org.whole.lang.ui.editpolicies.WholeComponentEditPolicy)

Example 5 with WholeComponentEditPolicy

use of org.whole.lang.ui.editpolicies.WholeComponentEditPolicy in project whole by wholeplatform.

the class AbstractFreeformNodePart method createEditPolicies.

protected void createEditPolicies() {
    installEditPolicy(EditPolicy.COMPONENT_ROLE, new WholeComponentEditPolicy(getCommandFactory()));
    installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new WholeNodeEditPolicy());
}
Also used : WholeNodeEditPolicy(org.whole.lang.ui.editpolicies.WholeNodeEditPolicy) WholeComponentEditPolicy(org.whole.lang.ui.editpolicies.WholeComponentEditPolicy)

Aggregations

WholeComponentEditPolicy (org.whole.lang.ui.editpolicies.WholeComponentEditPolicy)5 WholeContainerEditPolicy (org.whole.lang.ui.editpolicies.WholeContainerEditPolicy)3 XYLayout (org.eclipse.draw2d.XYLayout)2 SnapFeedbackPolicy (org.eclipse.gef.editpolicies.SnapFeedbackPolicy)2 WholeFreeformLayoutEditPolicy (org.whole.lang.ui.editpolicies.WholeFreeformLayoutEditPolicy)2 WholeLayoutEditPolicy (org.whole.lang.ui.editpolicies.WholeLayoutEditPolicy)2 EntityXYLayout (org.whole.lang.ui.layout.EntityXYLayout)2 EditPart (org.eclipse.gef.EditPart)1 EditPolicy (org.eclipse.gef.EditPolicy)1 Command (org.eclipse.gef.commands.Command)1 CreateRequest (org.eclipse.gef.requests.CreateRequest)1 IEntity (org.whole.lang.model.IEntity)1 WholeNodeEditPolicy (org.whole.lang.ui.editpolicies.WholeNodeEditPolicy)1 WholeNonResizableEditPolicy (org.whole.lang.ui.editpolicies.WholeNonResizableEditPolicy)1 DnDOverCompositeRequest (org.whole.lang.ui.requests.DnDOverCompositeRequest)1