Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsXWT. How to set absolute (null) layout?
https://www.eclipse.org/forums/index.php/mv/msg/179240/569101/#msg_569101
I want to use this Composite in XWT, but use instead absolute layout.
How can I do this? We don't have class with name "AbsoluteLayout". I've tried to use attribute layout="null", but this also does not work.
org.eclipse.e4.xwt.XWTException: Converter is missing of type: org.eclipse.swt.widgets.Layout from String
--
Konstantin Scheglov,
Instantiations, Inc.]]>Konstantin Scheglov2010-02-27T14:27:48-00:00Re: XWT. How to set absolute (null) layout?
https://www.eclipse.org/forums/index.php/mv/msg/179240/569440/#msg_569440
There are plenty of xwt snippets in the tests plugins (org.eclipse.e4.xwt.tests).]]>Erdal Karaca2010-03-05T12:36:30-00:00Re: XWT. How to set absolute (null) layout?
https://www.eclipse.org/forums/index.php/mv/msg/179240/569469/#msg_569469
I would like to change it at some usage points to absolute layout.
I.e. I mean that not all components have absolute layout as implicit, sometimes I need to set it explicitly.
--
Konstantin Scheglov,
Instantiations, Inc.]]>Konstantin Scheglov2010-03-05T13:33:33-00:00Re: XWT. How to set absolute (null) layout?
https://www.eclipse.org/forums/index.php/mv/msg/179240/569485/#msg_569485
<MyComposite.layout>
<AbsoluteLayout />
</MyComposite.layout>
Though, I am not sure what this "Absolute Layout" is all about as there is no such thing in SWT. AFAIK, in swt, you always need a layout to be set to get the controls rendered...
You would need to make the AbsoluteLayout class visible to XWT:
where com.example.mywidgets is the package that contains MyComposite and AbsoluteLayout.
Regarding the converter exception: You need a converter that can translate the "null" string to a null object.
I am not sure if xwt has such a converter. Then, you could do this, I guess:
<MyComposite layout="null" />
See XWT.registerConvertor().]]>Erdal Karaca2010-03-05T19:42:17-00:00Re: XWT. How to set absolute (null) layout?
https://www.eclipse.org/forums/index.php/mv/msg/179240/569516/#msg_569516
It is not my custom layout.
So, I wonder why I can set "normal" layout like RowLayout, but can not set such basic layout as absolute.
Would be good if there was already support for setting absolute layout in XWT, for completeness of layouts support.
Thank you for hint about converter.
--
Konstantin Scheglov,
Instantiations, Inc.]]>Konstantin Scheglov2010-03-05T20:23:33-00:00Re: XWT. How to set absolute (null) layout?
https://www.eclipse.org/forums/index.php/mv/msg/179240/570115/#msg_570115
APIs.
yves
"Konstantin Scheglov" <Konstantin.Scheglov@gmail.com> wrote in message
news:hmr17f$9q5$1@build.eclipse.org...
> My custom component MyComposite already has RowLayout set.
> I would like to change it at some usage points to absolute layout.
> I.e. I mean that not all components have absolute layout as implicit,
> sometimes I need to set it explicitly.
> --
> Konstantin Scheglov,
> Instantiations, Inc.]]>Yves YANG2010-03-12T10:21:16-00:00Re: XWT. How to set absolute (null) layout?
https://www.eclipse.org/forums/index.php/mv/msg/179240/570184/#msg_570184
> I think it is a dynamic aspect, which can be handled by Java using SWT/Jface
> APIs.
Why is this dynamic aspect?
Why is it different than setting any other layout, such as RowLayout or GridLayout?
For example NetBeans also uses XML for storing layouts, but it allows you set "Null layout".
--
Konstantin Scheglov,
Instantiations, Inc.]]>Konstantin Scheglov2010-03-12T10:56:44-00:00Re: XWT. How to set absolute (null) layout?
https://www.eclipse.org/forums/index.php/mv/msg/179240/570286/#msg_570286
Konstantin.Scheglov@gmail.com> wrote in message
news:hnd6ld$qnd$1@build.eclipse.org...
> Yves YANG wrote on Fri, 12 March 2010 08:48
>> I think it is a dynamic aspect, which can be handled by Java using
>> SWT/Jface APIs.
>
>
> Why is this dynamic aspect?
It is because the change occurs after the UI resource is loaded and in
general, it is relative to an event.
> Why is it different than setting any other layout, such as RowLayout or
> GridLayout?
>
> For example NetBeans also uses XML for storing layouts, but it allows you
> set "Null layout".
You can set any Layout, which is used when the resource gets loaded.
Regards
Yves YANG
>
> --
> Konstantin Scheglov,
> Instantiations, Inc.]]>Yves YANG2010-03-12T20:50:18-00:00Re: XWT. How to set absolute (null) layout?
https://www.eclipse.org/forums/index.php/mv/msg/179240/570348/#msg_570348
I don't want to change layout as result of some event, such as when user clicks on Button. I just want to set "null" layout statically, in XWT, for some Composite subclass.
You probably think that all Composites have "null" layout by default, I also was some time under such impression, but it is not. So, if we want to use "null" layout on such Composite, we have to set it. But it seems that right now XWT does not provide such feature. This is not good, because breaks symmetry in using layouts.
--
Konstantin Scheglov,
Instantiations, Inc.]]>Konstantin Scheglov2010-03-12T21:05:56-00:00Re: XWT. How to set absolute (null) layout?
https://www.eclipse.org/forums/index.php/mv/msg/179240/570356/#msg_570356
As for using a null layout manager, you may want to use the FormLayout. It will allow you to set the x,y coordinates of your widgets in the same way (at I think it would be in the same way as a null layout manager).
Here is an example of creating a composite that uses a FormLayout to place a single button 10 pixels down and 10 pixels to the right in the composite:
<Composite xmlns="http://www.eclipse.org/xwt/presentation"
xmlns:x="http://www.eclipse.org/xwt"
xmlns:c="clr-namespace:sample.hello"
xmlns:j="clr-namespace:java.lang"
x:Class="sample.hello.HelloWorld"
bounds="0,0,449,171">
<Composite.layout>
<FormLayout /> <!--The composite uses a FormLayout -->
</Composite.layout>
<Button text="Some Button">
<Button.layoutData>
<!--The button is placed 0% plus 10 pixels from the composite's top
and 0% plus 10 pixels from the composite's left side
NOTE: the percent is the of either the composites height (for top)
or the composites width (for left).
SO the end result is that the top, left corner of the button
is placed 10 pixels down and 10 pixels to the right -->
<FormData top="0,10" left="0,10"/>
</Button.layoutData>
</Button>
</Composite>]]>Frank Gualtieri2010-03-12T21:38:26-00:00