Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » RootPaneCreationPolicy
RootPaneCreationPolicy [message #120692] Thu, 16 March 2006 13:33 Go to next message
Eclipse UserFriend
Originally posted by: markus.wawra.shark-soft.com

Hi!

If I create a new visual class which extends JFrame, VE creates a
constructor, a contentPane with BorderLayout and a main method to run it.
If I take my own STFrame, which extends JFrame, as superclass nothing is
created. I wonder how I can tell VE to create these things for my class as
well and how I can change that text.

The only thing I found so far is the RootPaneCreationPolicy. But that
works just for STFrames that are dropped from the palette. At least that
is what my test made me think.

I've done my tests with the RootPaneCreationPolicy the way it is described
in

http://dev.eclipse.org/newslists/news.eclipse.tools.ve/msg00 391.html
I guess that's not the right way to solve my "STFrame-as-superclass"
problem, am I right?

Regards,

Markus
Re: RootPaneCreationPolicy [message #120765 is a reply to message #120692] Thu, 16 March 2006 16:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wolfgang.gahleitner.ams-engineering.com

Hi Markus,

I assume that you create your class with the "New Visual Class"-wizard and
not by dragging a STFrame from the palette into the editor. Therefore you
have to extend the "org.eclipse.ve.java.core.newStyleComponent" extension
point, which allows you to add your own base class to the "New Visual
Class"-wizard. Moreover, you can define a Java Emitter Template for
generating the source code and a IVisualClassCreationSourceContributor to
declare where the template is located. Look at
" org.eclipse.ve.internal.jfc.codegen.wizards.contributors.Con tentPaneSourceC
ontributor" and
" org.eclipse.ve.jfc/templates/org/eclipse/ve/internal/jfc/cod egen/jjet/wizar
ds/contributors/JContentPaneSourceTemplate.javajet" to see how a new
JFrame-based visual class is created.

hth
Wolfgang
Re: RootPaneCreationPolicy [message #120768 is a reply to message #120765] Fri, 17 March 2006 14:45 Go to previous message
Eclipse UserFriend
Originally posted by: markus.wawra.shark-soft.com

Thank you, Wolfgang!

You assumed right.

I hoped it can be done with a template like the JContentPaneSourceTemplate
but didn't find where it is linked to the JFrame (didn't look into the
plugin.xml). Today I wrote an template for my class, together with a Class
similar to the ContentPaneSourceContibutor and a Class similar to the
JFCVisualPlugin and added that all to my plug-in.

In the plugin.xml I added the following (taken from org.eclipse.ve.swt):

<extension point="org.eclipse.ve.java.core.newStyleComponent">
<category
name="ST"
id="my.cat"
priority="10"
defaultExpand="false">
</category>
<visualElement
pluginId="my.plugin"
container="my.container"
type="my.controls.STFrame"
icon="icons/STIcons/frame_obj.gif"
category="my.cat"
contributor="my.codegen.STContentPaneSourceContributor"
name="STFrame">
</visualElement>
</extension>

But if I create a new STFrame with the Wizard the code still isn't created.
What might be wrong?
Did I forget something?

Regards,
Markus
Re: RootPaneCreationPolicy [message #612324 is a reply to message #120692] Thu, 16 March 2006 16:00 Go to previous message
Wolfgang Gahleitner is currently offline Wolfgang GahleitnerFriend
Messages: 3
Registered: July 2009
Junior Member
Hi Markus,

I assume that you create your class with the "New Visual Class"-wizard and
not by dragging a STFrame from the palette into the editor. Therefore you
have to extend the "org.eclipse.ve.java.core.newStyleComponent" extension
point, which allows you to add your own base class to the "New Visual
Class"-wizard. Moreover, you can define a Java Emitter Template for
generating the source code and a IVisualClassCreationSourceContributor to
declare where the template is located. Look at
" org.eclipse.ve.internal.jfc.codegen.wizards.contributors.Con tentPaneSourceC
ontributor" and
" org.eclipse.ve.jfc/templates/org/eclipse/ve/internal/jfc/cod egen/jjet/wizar
ds/contributors/JContentPaneSourceTemplate.javajet" to see how a new
JFrame-based visual class is created.

hth
Wolfgang
Re: RootPaneCreationPolicy [message #612326 is a reply to message #120765] Fri, 17 March 2006 14:45 Go to previous message
Markus is currently offline MarkusFriend
Messages: 52
Registered: July 2009
Member
Thank you, Wolfgang!

You assumed right.

I hoped it can be done with a template like the JContentPaneSourceTemplate
but didn't find where it is linked to the JFrame (didn't look into the
plugin.xml). Today I wrote an template for my class, together with a Class
similar to the ContentPaneSourceContibutor and a Class similar to the
JFCVisualPlugin and added that all to my plug-in.

In the plugin.xml I added the following (taken from org.eclipse.ve.swt):

<extension point="org.eclipse.ve.java.core.newStyleComponent">
<category
name="ST"
id="my.cat"
priority="10"
defaultExpand="false">
</category>
<visualElement
pluginId="my.plugin"
container="my.container"
type="my.controls.STFrame"
icon="icons/STIcons/frame_obj.gif"
category="my.cat"
contributor="my.codegen.STContentPaneSourceContributor"
name="STFrame">
</visualElement>
</extension>

But if I create a new STFrame with the Wizard the code still isn't created.
What might be wrong?
Did I forget something?

Regards,
Markus
Previous Topic:Loading Java class in the Plugin environment
Next Topic:Problem instaling VE v1.2M2 in Eclipse-SDK-3.2M5a
Goto Forum:
  


Current Time: Fri Apr 19 09:11:42 GMT 2024

Powered by FUDForum. Page generated in 0.02062 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top