-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[JBIDE-19717] Visual (diagram) editor for JSR-352 batch job files #326
Conversation
This looks great! Will take some time to review but want to say Good Job. |
Yes, good job! I watched the video and it looks great. We are starting to review the code and will comment any problem we found here. |
1.) Layout is not saved/restored when you edit and close/re-open the editor. |
2.) (UPD: FIXED) Add step1 and step 2 to the diagram. Add a "next" transition from step1 to step2. Go to the source tab and rename step2 to step3, change next="step3" too. Switch to the diagram. The "next" transition is gone (a sapphire bug?). Re-open the editor. Here we go. The transition is visible again. |
It is definitely possible to write a custom diagram layout persistence service but it will require writing some hundreds lines of code. Due to my lack of time last days and low priority I skipped this feature as a possibility for future enhancements. (And also due to the fact that the default layout after reopen seems quite nice, you can even choose vertical/horizontal). |
|
what I see on diagram depends very much on what I do to get to this code. |
Maybe you could add more details about your environment to the forum in case they verify it is a Sapphire bug. |
I don't think 5) is a big problem. Especially if the palette in the editor can be folded. User can decide which palette he/she likes better to use. |
There was a bug in the lifecycle of connections (nodes added after initialization of connection service were not notified about changes of attributes so I added missing listeners.) Thank you for finding the bug. |
|
On (4) I create xml file with content. <job id="myJob" xmlns="http://xmlns.jcp.org/xml/ns/javaee" Then I close and restart Eclipse and open the file. I get the last described variant with 3 copies of middle transition. If you cannot get that, probably it is fixed in Sapphire or Gef recently which means we have to rise versions to use the diagram. |
public interface RefAttr {
} and the only service RefProposalService. New interface will be used in any model interface that needs 'ref' attribute, e.g. public interface Decision extends FlowElement, RefAttr ... Sapphire will find and implement this attribute. Now 11 subclassed services provide kind of mapping between model interfaces and BatchArtifactType. But then that mapping remains incapsulated in this service and non-reusable, while actually we might need it in other services. An utility class may keep Map<Class<? extends RefAttr>, BatchArtifactType> and provide method BatchArtifactType getArtifactType(Class<? extends RefAttr> cls) Then RefProposalService can get from context current element type and call the utility method. Profits: |
|
I will push an update of this tomorrow. |
It may be a list, or the case of StepListener be treated as a special one. |
|
About 3) I think "Go Back to Parent" should be replaced by an icon/button instead. like https://www.dropbox.com/s/j2h0fkqpqh55yed/Screenshot%202015-05-03%2012.51.40.png?dl=0 which is used in project explorer when used "go into" folder. |
@maxandersen And how about adding this icon and keeping a label (maybe shorter one) next to the icon? There can be both at the same time. I'm just afraid that such an important navigation button could get lost among others (not so important like "print" or "zoom"). |
that approach is definitely better than the current one. Maybe the icon should be moved near/next to the title of the job so it becomes apparent it is not related to zoom/print. |
I'm afraid Sapphire does not allow this. From all buttons in the title bar,I can put this one at the first place on the left, as it is, but I cannot move the whole section with buttons, it will be always aligned right. |
So I pushed the version with icon and 'Parent' label. |
|
Wouln't it be more consistent and less confusing then if it was done the same way everywhere (even on top-level)? |
Sorry, I didn't realize you need to merge this PR this week.
|
And one more: /*******************************************************************************
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Tomáš Milata - initial API and implementation
******************************************************************************/ |
@alexeykazakov License added and commits squashed. Thanks. |
Batch Editor is broken now: |
@alexeykazakov Oh, sorry about that. It is fixed now. I have malformed the XMLs when adding license header... From now on I'll remember to run tests even after adding comments. Editor is running and tests passing. Thanks. |
Features
See video https://youtu.be/wmWFQKvTWSc
Code Changes
Sapphire version
https://www.eclipse.org/forums/index.php/t/1065375/ and https://bugs.eclipse.org/bugs/show_bug.cgi?id=463917.
Notes