VE-inspired XML plugin? [message #79188] |
Sat, 05 February 2005 22:50 |
Eclipse User |
|
|
|
Originally posted by: mmt_nin.yahoo.com
I have been searching to try to find a way to either extend the Visual
Editor, or build a new plugin that does near the same. Can someone tell me
how to make a very similar plugin that you drag/drop widgets that
generates XML? Is there already such a plugin that I haven't found? Any
and all help is deeply appreciated.
-Thanks!
|
|
|
|
|
|
Re: VE-inspired XML plugin? [message #79474 is a reply to message #79315] |
Tue, 08 February 2005 12:46 |
Eclipse User |
|
|
|
Originally posted by: tomAtLinux.gmx.at
Tom Schindl wrote:
> Joe Winchester wrote:
>
>> Hi Megan,
>>
>>> I have been searching to try to find a way to either extend the
>>> Visual Editor, or build a new plugin that does near the same. Can
>>> someone tell me how to make a very similar plugin that you drag/drop
>>> widgets that generates XML? Is there already such a plugin that I
>>> haven't found? Any and all help is deeply appreciated.
>>
>>
>>
>> The VE can be used for this, the only problem is that we don't really
>> document how. At one time we had an example plugin where you could
>> open an XML file (actually the EMF model that the visual editor uses
>> internally). This model is then able to be manipulated visually the
>> same way the VE can be now, the only difference is that there is no
>> .java code being updated or listened to for changes.
>>
>> Could you please open a bugzilla feature request for us to get this
>> example working again and I think it will be a good starting point for
>> you to look at.
Done was not sure what component is the right maybe you have to modify:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=84569
|
|
|
|
Re: VE-inspired XML plugin? [message #80107 is a reply to message #79576] |
Mon, 14 February 2005 22:07 |
Eclipse User |
|
|
|
Originally posted by: tomAtLinux.gmx.at
David J. Orme wrote:
> Megan wrote:
>
>> I have been searching to try to find a way to either extend the Visual
>> Editor, or build a new plugin that does near the same. Can someone
>> tell me how to make a very similar plugin that you drag/drop widgets
>> that generates XML? Is there already such a plugin that I haven't
>> found? Any and all help is deeply appreciated.
>
>
> There's not a plugin for VE that lets you do this, but the language and
> the engine parts have been designed.
>
> See xswt.sourceforge.net for details. The Update Manager URL is:
>
> http://xswt.sourceforge.net/updates
>
> Right now, there is a plug-in that just allows you to preview an XSWT
> layout as you type it (whenever you save).
>
> If you install via Update Manager, you will get a File/New wizard for
> creating XSWT files. And the preview pane is available through
> Window|Show View|Other..., then expand the XSWT node in the tree.
>
> I had a conversation today with Gili about integrating this engine into
> VE and this looks like something that the VE team might be interested in
> doing.
>
> Would anyone here be interested in helping?
>
As already said I would but I don't know the internals of the VE and
XSWT. As a first step I checked out the sources of XSWT. Is there any
spec, DTD which tells me what XML-Elements exists? Can I use my own in
XSWT e.g. my own NumberWidget which derives from Text?
>
> Regards,
>
> Dave Orme
|
|
|
|
Re: VE-inspired XML plugin? [message #80308 is a reply to message #79315] |
Wed, 16 February 2005 18:16 |
Eclipse User |
|
|
|
Originally posted by: michail_matjuchin.at.ibm.com
Tom Schindl wrote:
> Joe Winchester wrote:
>> Hi Megan,
>>
>>> I have been searching to try to find a way to either extend the Visual
>>> Editor, or build a new plugin that does near the same. Can someone
>>> tell me how to make a very similar plugin that you drag/drop widgets
>>> that generates XML? Is there already such a plugin that I haven't
>>> found? Any and all help is deeply appreciated.
>>
>>
>> The VE can be used for this, the only problem is that we don't really
>> document how. At one time we had an example plugin where you could open
>> an XML file (actually the EMF model that the visual editor uses
>> internally). This model is then able to be manipulated visually the
>> same way the VE can be now, the only difference is that there is no
>> .java code being updated or listened to for changes.
>>
>> Could you please open a bugzilla feature request for us to get this
>> example working again and I think it will be a good starting point for
>> you to look at.
>>
>> Best regards,
>>
>> Joe Winchester
>>
> Thanks Joe. I do so. Are there any documents I could read about the
> design of VE or do only have the source code (can I get it from cvs?).
> Do you suggest any documents I have to read before I can jump in and
> start reading the sources.
> Tom
it is easy:
public class SampleAction implements IWorkbenchWindowActionDelegate {
private IWorkbenchWindow window;
private ISelection fSelection = null;
/**
* The constructor.
*/
public SampleAction() {
}
public void selectionChanged(IAction action, ISelection selection) {
fSelection = selection;
}
/**
* The action has been activated. The argument of the method represents
the
* 'real' action sitting in the workbench UI.
*
* @see IWorkbenchWindowActionDelegate#run
*/
public void run(IAction action) {
// *****
if (fSelection instanceof IStructuredSelection
&& ((IStructuredSelection) fSelection).size() == 1) {
Object object = ((IStructuredSelection) fSelection)
.getFirstElement();
if(object instanceof EditPart) {
EditPart editPart=(EditPart)object;
IJavaObjectInstance component = (IJavaObjectInstance)
editPart.getModel();
JavaClass modelType = (JavaClass) component.eClass();
//*****
EditDomain ed = EditDomain.getEditDomain(editPart);
DiagramData dd=ed.getDiagramData();
//*****
ResourceSet resSet = new ResourceSetImpl();
URI fileURI = URI.createFileURI("c:/temp/aaa.xml");
Resource resource =
resSet.createResource(fileURI);
//*****
resource.getContents().add(dd);
//
try {
resource.save(Collections.EMPTY_MAP);
}
catch(Exception ex) {
ex.printStackTrace();
}
}
}
}
|
|
|
Re: VE-inspired XML plugin? [message #80340 is a reply to message #80308] |
Wed, 16 February 2005 23:14 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
> DiagramData dd=ed.getDiagramData();
> //*****
> ResourceSet resSet = new ResourceSetImpl();
> URI fileURI = URI.createFileURI("c:/temp/aaa.xml");
> Resource resource =
> resSet.createResource(fileURI);
>
> //*****
> resource.getContents().add(dd);
This will screw up the editor because you just moved the diagram data
from the resource inside the VE to your resource.
--
Thanks,
Rich Kulp
|
|
|
Re: VE-inspired XML plugin? [message #80384 is a reply to message #80340] |
Thu, 17 February 2005 12:59 |
Eclipse User |
|
|
|
Originally posted by: michail_matjuchin.at.ibm.com
Rich Kulp wrote:
>> DiagramData dd=ed.getDiagramData();
>> //*****
>> ResourceSet resSet = new ResourceSetImpl();
>> URI fileURI = URI.createFileURI("c:/temp/aaa.xml");
>> Resource resource =
>> resSet.createResource(fileURI);
>>
>> //*****
>> resource.getContents().add(dd);
> This will screw up the editor because you just moved the diagram data
> from the resource inside the VE to your resource.
Will it work ? we really need it...
EditPart editPart = (EditPart) object;
IJavaObjectInstance component = (IJavaObjectInstance) editPart
.getModel();
JavaClass modelType = (JavaClass) component.eClass();
// *****
EditDomain ed = EditDomain.getEditDomain(editPart);
DiagramData dd = ed.getDiagramData();
Resource res = dd.eResource();
ByteArrayOutputStream os = new ByteArrayOutputStream();
try {
res.save(os, Collections.EMPTY_MAP);
String xx = os.toString();
System.out.println("xx=" + xx);
BufferedWriter out = new BufferedWriter(new FileWriter(
"c:/temp/aaa.xml"));
out.write(xx);
out.close();
} catch (Exception ex) {
ex.printStackTrace();
}
Many Thanks.
|
|
|
|
|
|
|
|
|
|
|
|
Re: VE-inspired XML plugin? [message #605295 is a reply to message #79315] |
Wed, 16 February 2005 18:16 |
Eclipse User |
|
|
|
Originally posted by: michail_matjuchin.at.ibm.com
Tom Schindl wrote:
> Joe Winchester wrote:
>> Hi Megan,
>>
>>> I have been searching to try to find a way to either extend the Visual
>>> Editor, or build a new plugin that does near the same. Can someone
>>> tell me how to make a very similar plugin that you drag/drop widgets
>>> that generates XML? Is there already such a plugin that I haven't
>>> found? Any and all help is deeply appreciated.
>>
>>
>> The VE can be used for this, the only problem is that we don't really
>> document how. At one time we had an example plugin where you could open
>> an XML file (actually the EMF model that the visual editor uses
>> internally). This model is then able to be manipulated visually the
>> same way the VE can be now, the only difference is that there is no
>> .java code being updated or listened to for changes.
>>
>> Could you please open a bugzilla feature request for us to get this
>> example working again and I think it will be a good starting point for
>> you to look at.
>>
>> Best regards,
>>
>> Joe Winchester
>>
> Thanks Joe. I do so. Are there any documents I could read about the
> design of VE or do only have the source code (can I get it from cvs?).
> Do you suggest any documents I have to read before I can jump in and
> start reading the sources.
> Tom
it is easy:
public class SampleAction implements IWorkbenchWindowActionDelegate {
private IWorkbenchWindow window;
private ISelection fSelection = null;
/**
* The constructor.
*/
public SampleAction() {
}
public void selectionChanged(IAction action, ISelection selection) {
fSelection = selection;
}
/**
* The action has been activated. The argument of the method represents
the
* 'real' action sitting in the workbench UI.
*
* @see IWorkbenchWindowActionDelegate#run
*/
public void run(IAction action) {
// *****
if (fSelection instanceof IStructuredSelection
&& ((IStructuredSelection) fSelection).size() == 1) {
Object object = ((IStructuredSelection) fSelection)
.getFirstElement();
if(object instanceof EditPart) {
EditPart editPart=(EditPart)object;
IJavaObjectInstance component = (IJavaObjectInstance)
editPart.getModel();
JavaClass modelType = (JavaClass) component.eClass();
//*****
EditDomain ed = EditDomain.getEditDomain(editPart);
DiagramData dd=ed.getDiagramData();
//*****
ResourceSet resSet = new ResourceSetImpl();
URI fileURI = URI.createFileURI("c:/temp/aaa.xml");
Resource resource =
resSet.createResource(fileURI);
//*****
resource.getContents().add(dd);
//
try {
resource.save(Collections.EMPTY_MAP);
}
catch(Exception ex) {
ex.printStackTrace();
}
}
}
}
|
|
|
Re: VE-inspired XML plugin? [message #605304 is a reply to message #80308] |
Wed, 16 February 2005 23:14 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
> DiagramData dd=ed.getDiagramData();
> //*****
> ResourceSet resSet = new ResourceSetImpl();
> URI fileURI = URI.createFileURI("c:/temp/aaa.xml");
> Resource resource =
> resSet.createResource(fileURI);
>
> //*****
> resource.getContents().add(dd);
This will screw up the editor because you just moved the diagram data
from the resource inside the VE to your resource.
--
Thanks,
Rich Kulp
|
|
|
Re: VE-inspired XML plugin? [message #605314 is a reply to message #80340] |
Thu, 17 February 2005 12:59 |
Eclipse User |
|
|
|
Originally posted by: michail_matjuchin.at.ibm.com
Rich Kulp wrote:
>> DiagramData dd=ed.getDiagramData();
>> //*****
>> ResourceSet resSet = new ResourceSetImpl();
>> URI fileURI = URI.createFileURI("c:/temp/aaa.xml");
>> Resource resource =
>> resSet.createResource(fileURI);
>>
>> //*****
>> resource.getContents().add(dd);
> This will screw up the editor because you just moved the diagram data
> from the resource inside the VE to your resource.
Will it work ? we really need it...
EditPart editPart = (EditPart) object;
IJavaObjectInstance component = (IJavaObjectInstance) editPart
.getModel();
JavaClass modelType = (JavaClass) component.eClass();
// *****
EditDomain ed = EditDomain.getEditDomain(editPart);
DiagramData dd = ed.getDiagramData();
Resource res = dd.eResource();
ByteArrayOutputStream os = new ByteArrayOutputStream();
try {
res.save(os, Collections.EMPTY_MAP);
String xx = os.toString();
System.out.println("xx=" + xx);
BufferedWriter out = new BufferedWriter(new FileWriter(
"c:/temp/aaa.xml"));
out.write(xx);
out.close();
} catch (Exception ex) {
ex.printStackTrace();
}
Many Thanks.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05208 seconds