How do I create a custom editor with the BPMN2 Modeler? [message #1729946] |
Wed, 20 April 2016 12:39  |
Eclipse User |
|
|
|
I have added a new Work Definitions which gets picked up under Custom Tasks in the editor:
[
"name" : "BooleanQuestion",
"parameters" : [
"Question" : new StringDataType()
],
"displayName" : "Yes/No Question",
"eclipse:customEditor" : "com.common.workeditor.MyWorkEditor"
]
The editor I have defined looks like this:
public class MyWorkEditor extends Dialog implements WorkEditor {
private final String title = "My editor";
protected MyWorkEditor(Shell parentShell) {
super(parentShell);
throw new RuntimeException("sad");
}
@Override
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
newShell.setText(title);
}
protected Control createDialogArea(Composite parent) {
Composite composite = (Composite) super.createDialogArea(parent);
GridLayout gridLayout = new GridLayout();
gridLayout.numColumns = 2;
composite.setLayout(gridLayout);
//Work work = (Work) getValue();
Label nameLabel = new Label(composite, SWT.NONE);
nameLabel.setText("Name: "); //$NON-NLS-1$
nameLabel.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false, 1, 1));
Text nameText = new Text(composite, SWT.NONE);
nameText.setEditable(false);
nameText.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1));
String name = "MyName";
nameText.setText(name == null ? "" : name); //$NON-NLS-1$
return composite;
}
@Override
public void setWorkDefinition(WorkDefinition definition) {
// TODO Auto-generated method stub
}
@Override
public void setWork(Work work) {
// TODO Auto-generated method stub
}
@Override
public boolean show() {
int result = open();
return result == OK;
}
@Override
public Work getWork() {
// TODO Auto-generated method stub
return null;
}
}
Using the old Drools plugin for Eclipse I could simply double click the node and use a custom editor (not this exact one, but in similar). However, double clicking my Yes/No Question doesn't do anything. Am I on the wrong path here?
|
|
|
Re: How do I create a custom editor with the BPMN2 Modeler? [message #1729970 is a reply to message #1729946] |
Wed, 20 April 2016 15:36   |
Eclipse User |
|
|
|
Hi Jonas,
I'm sorry, but the ability to provide your own custom editor is not yet implemented. Instead, the parameters will appear in the "Custom Task" tab of the property sheet, for example:

If you absolutely must have this functionality, please file an enhancement request - we'll try to get it into the next Neon release.
Cheers,
Bob
|
|
|
|
Powered by
FUDForum. Page generated in 0.04303 seconds