Home » Modeling » Graphiti » First Editor
| |
Re: First Editor [message #727575 is a reply to message #727146] |
Wed, 21 September 2011 10:43   |
Eclipse User |
|
|
|
At first, thanks 
But thats just that is my problem, how should I open an editor wich doesnt exist?
I just wrote the .java files and wrote everything I need into the plugin.xml.
So if I start a second instance of eclipse, what should I do?
I create a sample project, from the examples, I create in that project a diagram file, from the examples and now? Its everything from the example editor, and nothing from my own editor.
If I create in my developing eclipse a diagram file from the wizard, how should I open it? There is, in my opinion, no way to open it and nowhere in the tutorial is that explained.
Edit: Maybe I read the word "editor" it too often, I suggest you mean the following:
create a diagram file in the developing eclipse, open a new instance and open the diagram via File->Open File.
I did that, but it throws an exception:
Unable to create editor ID org.eclipse.graphiti.ui.editor.DiagramEditor: Unknown editor input: org.eclipse.ui.ide.FileStoreEditorInput@5797c16c
I think the stacktrace is not necessary.
I hope you can help me again.
[Updated on: Wed, 21 September 2011 11:05] by Moderator
|
|
|
Re: First Editor [message #727610 is a reply to message #727575] |
Wed, 21 September 2011 12:05   |
Eclipse User |
|
|
|
mr_sniper wrote on Wed, 21 September 2011 11:43
create a diagram file in the developing eclipse, open a new instance and open the diagram via File->Open File.
I did that, but it throws an exception:
Unable to create editor ID org.eclipse.graphiti.ui.editor.DiagramEditor: Unknown editor input: org.eclipse.ui.ide.FileStoreEditorInput@5797c16c
To clarify: we have the "first" eclipse instance ("developing eclipse") and the "second " eclipse instance (the one started from our first one). Each instance has its own workspace, so you can't (well, you should't) create the diagram in the first and try to open from the second - because the graphiti editor expects to see its input in its running workspace [1]
So, you should test the full workflow (create a new diagram, open the editor) in the "second" instance.
First try it with the tutorial [2] diagram type (.diagram) and the standard Graphiti editor (DiagramEditor).
If this works for you, please clarify what you want to do:
In a first scenario the graphiti developer defines its own diagramtype, (extension "org.eclipse.graphiti.ui.diagramTypes") and provider ("org.eclipse.graphiti.ui.diagramTypeProviders") and code the Features.
In this scenario, you will edit "your" diagram, with all your defined ui elements, behaviours etc (totally different from the tutorial). You can call this "your editor" (as different from the tutorial), though it actually it's the same defined editor in the graphiti plugin.xml , with same default extension and same underlying Java class (DiagramEditor).
In a second scenario, you can add you own editor definition (extension point "org.eclipse.ui.editors" in your plugin.xml), so you have your own name for the editor (appears in the menus, "open with..."), icon, default extension, etc, but using the same graphiti DiagramEditor java class.
In a third scenario you can code your own editor (extending DiagramEditor). This is less needed and frequent, I think, and not much supported by Graphiti today.
I suspect that when you speak of "your editor" you are alluding to scenario 1, (your own diagramtype/provider, actually).
Then, what matters is that, when the diagram is created, it is created with "your" diagramType id (you can check it reading the xml source; look for the tag <pi:Diagram...> ). If that is so, the when you click on it it will open what you call "your editor" (actually, graphiti default editor; he will discover the typediagram and use "your" diagramTypeProvider, etc)
[1] I'm not sure if this prohibition is justified, and if that expection is kind of a bug, but nevertheless...
[2] Actually, the diagram type with its extension and its association with the DiagramEditor is specified not in the tutorial plugings but in the core graphiti plugin (I wonder if this is right...)
[Updated on: Wed, 21 September 2011 12:19] by Moderator
|
|
|
Re: First Editor [message #728961 is a reply to message #727610] |
Sat, 24 September 2011 11:18   |
Eclipse User |
|
|
|
Hey 
thank you again, now it works, a bit -.-
I dont want to say it, but I think I have to, I tried it with a new instance of eclipse, wich Ive opened by myself.
Ive never tried to start it out of the working eclipse -> couldnt test my own editor.
And I had a fault in my plugin.xml.
Next issue is, if I create a new diagram, there is no EClass in the menu.
So I couldnt create anything.
The only thing I get is an exception:
Contributor mytutorial.PropertyContributor cannot be created.
I looked it up and found it in the tutorial.
But now, I got no object and no exception, it happens nothing.
I am sorry, I realy try to make this tutorial and just want to test Graphiti, but until now, it wont let me.
Maybe my plugin.xml is wrong?
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.graphiti.ui.diagramTypes">
<diagramType
id="mytutorial.MyTutorialDiagramType"
name="My Graphiti Tutorial Diagram Type"
type="mytutorial">
</diagramType>
</extension>
<extension
point="org.eclipse.graphiti.ui.diagramTypeProviders">
<diagramTypeProvider
class="Graphiti.MyTutorialDiagramTypeProvider"
id="mytutorial.MyTutorialDiagramTypeProvider"
name="My tutorial editor Test">
<diagramType
id="mytutorial.MyTutorialDiagramType">
</diagramType>
</diagramTypeProvider>
</extension>
<extension
point="org.eclipse.ui.views.properties.tabbed.propertyContributor">
<propertyContributor contributorId="mytutorial.PropertyContributor">
<propertyCategory category="Graphiti">
</propertyCategory>
</propertyContributor>
</extension>
<extension
point="org.eclipse.ui.views.properties.tabbed.propertyTabs">
<propertyTabs contributorId="mytutorial.PropertyContributor">
<propertyTab label="Main" category="Graphiti"
id="graphiti.main.tab">
</propertyTab>
</propertyTabs>
</extension>
<extension
point="org.eclipse.ui.views.properties.tabbed.propertySections">
<propertySections contributorId="mytutorial.PropertyContributor">
<propertySection tab="graphiti.main.tab"
class="Graphiti.MyTutorialEClassSection"
filter="Graphiti.MyTutorialEClassFilter"
id="graphiti.main.tab.emfclass">
</propertySection>
</propertySections>
</extension>
</plugin>
[Updated on: Sat, 24 September 2011 11:18] by Moderator
|
|
| | | | | | |
Re: First Editor [message #757306 is a reply to message #731930] |
Thu, 17 November 2011 11:00   |
Eclipse User |
|
|
|
Hernan wrote on Mon, 03 October 2011 09:57Soeren wrote on Sun, 02 October 2011 10:20Last try, to see if this forum is usefull -.-'
Well, that comment is certainly not useful.
Thats right and I am sorry about it.
I worked on my editor daily and couldnt wait for an answer...
Hernan wrote on Mon, 03 October 2011 09:57
Quote:
Next line wich is not explained in the Tutorial is:
boxAnchor.setReferencedGraphicsAlgorithm(roundedRectangle);
This is in TutorialAddEClassFeature.java, looks inconsistent to me, because roundedRectangle is declared outside of
public PictogramElement add(IAddContext context) { ... }
Uh? That does not make sense. Read again (the method and your question).
Maybe I havent explained it well enough.
In "Add Connection Feature" - "Anchors", we have to add
boxAnchor.setReferencedGraphicsAlgorithm(roundedRectangle);
But in my point of view ( and Eclipse says that also ), we couldnt use "roundedRectangle".
The class ExampleUtil ("Create Feature") isnt available as well.
I had to ask for it and got the hint to look into your SVN.
Sören
|
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Re: First Editor [message #894408 is a reply to message #894086] |
Mon, 09 July 2012 02:56  |
Eclipse User |
|
|
|
I think the difference between triggering a resize interactively by the user
and programmatically is that in the interactive case the user alread resized
the outermost shape by his drag operation, so you would normally not change
the outermost shape's size in your resize feature. So triggering the resize
feature programmatically would the require this change on the outermost
shape additionally.
In this reply I assume that the anchors are defined for your outermost
shape.
Michael
|
|
|
Goto Forum:
Current Time: Tue Jul 22 19:16:36 EDT 2025
Powered by FUDForum. Page generated in 0.09585 seconds
|