use of com.liferay.ide.kaleo.ui.editor.WorkflowDefinitionEditor in project liferay-ide by liferay.
the class UseNodeWizardsActionHandler method init.
@Override
public void init(SapphireAction action, ActionHandlerDef def) {
super.init(action, def);
if (action.getType() == SapphireActionType.TOGGLE) {
ISapphirePart diagramPart = getPart();
WorkflowDefinitionEditor definitionEditor = diagramPart.adapt(WorkflowDefinitionEditor.class);
if (definitionEditor != null) {
setChecked(definitionEditor.isNodeWizardsEnabled());
definitionEditor.addPropertyListener(new IPropertyListener() {
public void propertyChanged(Object source, int propId) {
if (propId == WorkflowDefinitionEditor.PROP_NODE_WIZARDS_ENABLED) {
setChecked(definitionEditor.isNodeWizardsEnabled());
}
}
});
}
}
}
use of com.liferay.ide.kaleo.ui.editor.WorkflowDefinitionEditor in project liferay-ide by liferay.
the class UseNodeWizardsActionHandler method run.
@Override
protected Object run(Presentation context) {
ISapphirePart part = context.part();
WorkflowDefinitionEditor definitionEditor = part.adapt(WorkflowDefinitionEditor.class);
definitionEditor.setNodeWizardsEnabled(isChecked());
return null;
}
use of com.liferay.ide.kaleo.ui.editor.WorkflowDefinitionEditor in project liferay-ide by liferay.
the class StartTransitionActionHandler method run.
@Override
protected Object run(Presentation context) {
WorkflowDefinitionEditor editor = context.part().adapt(WorkflowDefinitionEditor.class);
SapphireDiagramEditor diagramEditor = editor.getDiagramEditor();
ISapphirePart part = context.part();
DiagramNodePart diagramPart = part.nearest(DiagramNodePart.class);
SapphireDiagramEditorPagePart editorPart = part.nearest(SapphireDiagramEditorPagePart.class);
ConnectionPalette connectionPalette = editorPart.getConnectionPalettes().get(0);
CreationFactory factory = new ConnectionCreationFactory(connectionPalette.getConnectionDef());
ConnectionCreationTool tool = new ConnectionCreationTool(factory);
diagramEditor.getEditDomain().setActiveTool(tool);
Event e = new Event();
e.x = diagramPart.getNodeBounds().getX();
e.y = diagramPart.getNodeBounds().getY();
e.widget = diagramEditor.getGraphicalViewer().getControl();
e.button = 1;
MouseEvent me = new MouseEvent(e);
tool.mouseDown(me, diagramEditor.getGraphicalViewer());
return null;
}
use of com.liferay.ide.kaleo.ui.editor.WorkflowDefinitionEditor in project liferay-ide by liferay.
the class NewNodeAddActionHandler method run.
@Override
public Object run(Presentation context) {
Object retval = null;
if (canRunWizard(context)) {
NewNodeOp op = createOp(context);
WorkflowDefinition oldWorkflowDefinition = (WorkflowDefinition) getModelElement();
WorkflowDefinition newWorkflowDefinition = op.getWorkflowDefinition().content(true);
newWorkflowDefinition.copy(oldWorkflowDefinition);
// When WorkflowDefinition.getSchemaVersion(),
// VersionedSchemaDefaultValueService.compute()
// can't get the version, always returns the default value, directly
// set the schema version here.
newWorkflowDefinition.setSchemaVersion(oldWorkflowDefinition.getSchemaVersion().content());
NewNodeOpWizard wizard = createNewNodeWizard(op, this, context);
WorkflowDefinitionEditor definitionEditor = context.part().adapt(WorkflowDefinitionEditor.class);
op.setUseNodeWizards(definitionEditor.isNodeWizardsEnabled());
runWizard(context, wizard);
definitionEditor.setNodeWizardsEnabled(op.isUseNodeWizards().content());
} else {
retval = insertDiagramPart(context, true);
}
return retval;
}
Aggregations