[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
RE: [ve-dev] Customised Swing layout manager
|
Rashmi,
>On choosing MyLayout from
the Drop Down list in property palette the Layoutpolicyfactory is initialized
to UnKnownLayout2PolicyFactory .
The UnKnownLayout2PolicyFactory is the
default policy factory returned from the call in ContainterGraphicalEditPart.createLayoutEditPolicy
to BeanAwtUtilities.getLayoutPolicyFactoryFromLayoutManger(layoutManagerProxy,
EditDomain.getEditDomain(this). If your layout manager implements java.awt.LayoutManager2,
and it can't find the policy factory, it returns this default class.
>I am trying to analyze why
my LayoutPolicyFactory is not being initialized.
Set a breakpoint in VisualUtilities.getLayoutPolicyFactory(EClassifier
layoutManagerClass, EditDomain editDomain)... this is where it finds the
decorator for your layout class if the override file worked okay.
Hope this helps...
Peter Walker
-------------------------------------
Eclipse VE Development
"Rashmi H. Ramachandra"
<rashmi.ramchandra@xxxxxxxxxxxxxxxxxx>
Sent by: ve-dev-bounces@xxxxxxxxxxx
09/12/2005 07:13 AM
Please respond to
Discussions people developing code for the Visual Editor project |
|
To
| "Discussions people
developing code for the Visual Editor project" <ve-dev@xxxxxxxxxxx>
|
cc
|
|
Subject
| RE: [ve-dev] Customised Swing
layout manager |
|
Hi Joe,
I was able to get
to the point where the Eclipse ve identifies and initializes the LayoutPolicyFactory.
On choosing MyLayout from
the Drop Down list in property palette the Layoutpolicyfactory is initialized
to UnKnownLayout2PolicyFactory . I am trying to analyze why my LayoutPolicyFactory
is not being initialized. Will get back to you soon with the results.
Thank You
Rashmi Ramachandra.
-----Original Message-----
From: ve-dev-bounces@xxxxxxxxxxx [mailto:ve-dev-bounces@xxxxxxxxxxx]On
Behalf Of Rashmi H. Ramachandra
Sent: Monday, September 12, 2005 2:41 PM
To: Discussions people developing code for the Visual Editor project
Subject: NL:Re: [ve-dev] Customised Swing layout manager
Hi Joe,
Selection of my LayoutManager from the drop
down list does not log any messages to the Error log view. MyLayout
and MyLayoutPolicyFactory
are in separate packages. I have followed "Extending
The Visual Editor" tutorial
from the link http://www.eclipse.org/articles/index.html,
while creating the project. According to the article I have created a classpath
container. The class path container is pointing to the jar, which contains
my layout manager and my custom widgets.Custom widgets part has a customized
container (JPanel) that uses MyLayout and a custom component(JTextField)
. I am able to use the custom widgets and MyLayout with out any compilation
errors. The custom component is also visible in the correct position when
I add it to the container by manually providing the constraints like
container.add(component, myLayoutxconstraints(x,y,height,width)).But I
am not able to resize and move the component on the visual editor. For
this I have tried to implement the LayoutPolicyFactory and other classes
related to my requirement.
I am not adding the override
folder and the package related to the LayoutPolicyFactory to the jar pointed
by class path container. I am testing my project by running it as a Eclipse
Application from the run menu(invoking second workbench).The eclipse environment
should pick up the plugin class , overrides and the classes related to
LayoutPolicyFactory , when I deploy my project as a Eclipse application
to a workbench.
In this context do I need to write proxy.jars document pointing to
the paths? As all the class object can be found in the /bin folder
of the project.
I have deployed the project to
workbench in debug mode. And opened the Visual Editor on a test.java class
that's using Mylayout . How do I debug into LayoutPolicyFactory and ContainerGraphicalEditPart
from the debug mode ?
Thank You and Regards,
Rashmi Ramachandra
-----Original Message-----
From: ve-dev-bounces@xxxxxxxxxxx [mailto:ve-dev-bounces@xxxxxxxxxxx]On
Behalf Of Joe Winchester
Sent: Friday, September 09, 2005 6:38 PM
To: Discussions people developing code for the Visual Editor project
Subject: NL:Re: [ve-dev] Customised Swing layout manager
Hi Rashmi,
Is there anything being written to the ErrorLog when you select your layout
manager from the drop down list in the property sheet ? You can see
this using the Show View>Error Log.
You have myPackage as being the package with the MyLayout and also with
the MyLayoutPolicyFactory. The VE has two sides to it - one is the
Eclipse IDE that runs the viewer and editor code into which the MyLayoutPolicyFactory
should go. The other is the VM that the VE uses to create its JavaBeans
and this is the one MyLayout should be in. The same packages are
not shared between the two.
The user experience for your user should be that the MyLayout.class file
is in the build path of their Java project. By default it won't be
(because it's not part of the JFC classes) so your user must do something
to add it. The way the VE tends to do this is with a classpath container,
and the tutorial on http://www.eclipse.org/articles/Article-VE-Custom-Widget/customwidget.html
shows how to create a container.
In your plugin you should keep separate the code that runs in the IDE and
is part of your plugin (which includes MyLayoutPolicyFactory) and the code
that runs in the VE's target VM. If you look at something like the
org.eclipse.ve.swt plugin you will see separate source folders - one called
ve_swt and one called vm_swt. Look also at the file proxy.jars that
redirects the VE in develpment mode so where it looks for a .jar file on
the target VM it instead looks inside the /bin folder in the workbench.
To see whether your code is working or not a good place to start would
be to maually change a JPanel to use your layout manager (i.e. using the
Java source code) and make sure this compiles. Then open the VE in
debug mode and debug into the ContainerGraphicalEditPart and the method
createLayoutEditPolicy() which will go down the path where it looks for
the correct policy factory to use for the layout manager.
Best regards,
Joe Winchester
Please respond to Discussions
people developing code for the Visual Editor project <ve-dev@xxxxxxxxxxx>
Sent by:
ve-dev-bounces@xxxxxxxxxxx
To:
"Discussions people developing
code for the Visual Editor project" <ve-dev@xxxxxxxxxxx>
cc:
Subject: Re:
[ve-dev] Customised Swing layout manager
Hi All,
On creating a custom LayoutManager.override,
I have been able to get the new LayoutManager display name shown in list
for layout property in the property editor . The code I used in the
.override file is as below.
<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:org.eclipse.ve.internal.jcm="http:///org/eclipse/ve/internal/jcm.ecore"
xmlns:org.eclipse.ve.internal.cde.decorators="http:///org/eclipse/ve/internal/cde/decorators.ecore"
xmlns:org.eclipse.jem.java="java.xmi" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns:event="event.xmi">
<event:Add featureName="eAnnotations">
<addedEObjects xsi:type="ecore:EAnnotation"
source="org.eclipse.ve.LayoutInfo">
<details
key="org.eclipse.ve.internal.jfc.core.layoutManagerClass"
value="mypackage.MyLayout"/>
<details
key="org.eclipse.ve.internal.jfc.core.layoutManagerDisplayName"
value="MyLayout"/>
</addedEObjects>
</event:Add>
</xmi:XMI>
How do We know that the class MyLayout has been initialized and recognised
the LayoutManager class by VE. I have tried adding breakpoints to my LayoutManager
class and running VE in debug mode. I have not been able to trace the class
as the breakpoints are not being recognised.
MyLayout.override file is as
below
<?xml version="1.0" encoding="UTF-8"?>
<event:AddMany xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:org.eclipse.ve.internal.jcm="http:///org/eclipse/ve/internal/jcm.ecore"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns:codeGenHelpers="platform:/plugin/org.eclipse.ve.java.core/overrides/codegenHelpers.ecore"
xmlns:event="event.xmi"
featureName="eAnnotations">
<addedEObjects xsi:type="org.eclipse.ve.internal.jcm:BeanDecorator">
<keyedValues xsi:type="ecore:EStringToStringMapEntry"
key="org.eclipse.ve.internal.jfc.core.layoutpolicyfactoryclassnamekey"
value="My_Plugin/mypackage.MyLayoutPolicyFactory"/>
</addedEObjects>
<addedEObjects xsi:type="codeGenHelpers:CodeGenHelperClass"
source="codegen.CodeGenHelperClass"
modelled="true"/>
</event:AddMany>
Breakpoint added to MyLayoutPolicyFactory
are not being recognized while testing the plugin.Is there anything wrong
in the above declaration?
How do I run eclipse 3.1 in debug mode to track the process of execution
of the classes that are referenced in the .override files?
Thank You & Best Regards,
Rashmi Ramachandra
-----Original Message-----
From: ve-dev-bounces@xxxxxxxxxxx [mailto:ve-dev-bounces@xxxxxxxxxxx]On
Behalf Of Peter Walker
Sent: Friday, August 26, 2005 9:00 PM
To: Discussions people developing code for the Visual Editor project
Subject: NL:Re: [ve-dev] Customised Swing layout manager
Rashmi,
To clarify about what override file to create, for SWT layouts use Layout.override,
for AWT/Swing layouts, use LayoutManager.override.
Regards...
Peter Walker
Rich Kulp/Raleigh/IBM@IBMUS
Sent by: ve-dev-bounces@xxxxxxxxxxx
08/26/2005 09:50 AM
Please respond to
Discussions people developing code for the Visual Editor project |
|
To
| Discussions people
developing code for the Visual Editor project <ve-dev@xxxxxxxxxxx>
|
cc
|
|
Subject
| Re: [ve-dev] Customised Swing
layout manager |
|
Hi,
A little typo, to get your layout manager to show in the property sheet
you create an override for Layout.override, not Container.override. You
just create a new override, put the extension point in to pick it up as
an override and add another annotation. See the Layout.override that already
exists to see how to do that.
Rich
Joe Winchester <WINCHEST@xxxxxxxxxx>
Sent by: ve-dev-bounces@xxxxxxxxxxx
08/26/2005 08:24 AM
Please respond to
Discussions people developing code for the Visual Editor project |
|
To
| Discussions people
developing code for the Visual Editor project <ve-dev@xxxxxxxxxxx>
|
cc
|
|
Subject
| Re: [ve-dev] Customised Swing
layout manager |
|
Hi Rashmi,
The best way is to look at how this is done for a layout manager like,
say, BorderLayout. There is a file BorderLayout.override and
this defines the decorator for a factory, and the factory lets you control
things like GEF edit policies (that you will need to build). Look
at the existing factories and you should get a feel for how to do this.
To get your layout manager to appear in the drop down list of available
layout managers in the property sheet look at Container.override. You
could change the base file to add your own which would work OK for you,
but better would be to have your own Container.override in your own plugin
and defined your own layout manager.
If you need help understanding how to create a plugin and get started with
.override try the Visual Editor tutorial on eclipse corner and the VE homepage.
Best regards and please keep us informed of how you get on,
Joe Winchester
Please respond to Discussions
people developing code for the Visual Editor project <ve-dev@xxxxxxxxxxx>
Sent by:
ve-dev-bounces@xxxxxxxxxxx
To:
<ve-dev@xxxxxxxxxxx>
cc:
Subject: [ve-dev]
Customised Swing layout manager
Hi all,
I have implemented a swing layout manager along with the constraints class.
I loaded it to the eclipse enviroment as a bundle in the plugin. Now when
i use this layout in a visual class I am able to arrange the components
by changing the constraints values from the source view. But i am unable
to move the component on the design view(changing the constraints from
the properties and design view) .Can you help me out to solve my layout
poblem. Do i need to implement some a layout assistant that will interface
with my layout manager and the visualeditor.
Best Regards
-Rashmi
_______________________________________________
ve-dev mailing list
ve-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ve-dev
_______________________________________________
ve-dev mailing list
ve-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ve-dev_______________________________________________
ve-dev mailing list
ve-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ve-dev_______________________________________________
ve-dev mailing list
ve-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ve-dev
_______________________________________________
ve-dev mailing list
ve-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ve-dev