Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Deferred Layouting (i.e. not showing graphic ressources on object-generation-time)
Deferred Layouting (i.e. not showing graphic ressources on object-generation-time) [message #437064] Fri, 28 May 2004 12:17 Go to next message
Eclipse UserFriend
Originally posted by: bertram.herzog.web.de

Hello altogether!

I have a quick question, which is probably not too hard for most of the
SWT-Layout-cracks among you.

Is there a possibility to do a "deferred layouting" in SWT?

I want to create a Text Box and a its Label, and then have it layouted
by another Class. However, once the widget is created, it's displayed.
I guess that's how it is in SWT, or is there some equivalent to
JPanel.add() in SWT?

Here my idea in Code...
Group g = new Group(shell, SWT.NONE);
g.setLayout(new RowLayout(SWT.VERTICAL); // puts line below line...

Label descriptor = new Label(group, SWT.NONE);
descriptor.setText("Name");

Text nameField = new Text(group, SWT.NONE);
nameField.setTextLimit(FIELD_LENGTH);
nameField.setText(someMethod.retrievePreferredText(name));

nameRow = new GroupDataRow(group, (Label)descriptor,(Control)nameField);

(with GroupDataRow(Composite parent, Label label, Control
TextBoxOrDropDownBoxorComposite) )

Why do I want to do this? -- Have groups filled dynamically, either with
a TextWidget, or a comboBox instead.

Thank you for any hints!

Cheers, Bertram
Re: Deferred Layouting (i.e. not showing graphic ressources on object-generation-time) [message #437066 is a reply to message #437064] Fri, 28 May 2004 12:45 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
Hi Bertram,

The easiest approaches to having a widget position dynamically change are:

1. create/dispose them as needed, see
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/plat form-swt-home/snippits/snippet98.html
2. use a org.eclipse.swt.custom.StackLayout

Grant

"Bertram Herzog" <bertram.herzog@web.de> wrote in message
news:c97a6p$n2k$1@eclipse.org...
> Hello altogether!
>
> I have a quick question, which is probably not too hard for most of the
> SWT-Layout-cracks among you.
>
> Is there a possibility to do a "deferred layouting" in SWT?
>
> I want to create a Text Box and a its Label, and then have it layouted
> by another Class. However, once the widget is created, it's displayed.
> I guess that's how it is in SWT, or is there some equivalent to
> JPanel.add() in SWT?
>
> Here my idea in Code...
> Group g = new Group(shell, SWT.NONE);
> g.setLayout(new RowLayout(SWT.VERTICAL); // puts line below line...
>
> Label descriptor = new Label(group, SWT.NONE);
> descriptor.setText("Name");
>
> Text nameField = new Text(group, SWT.NONE);
> nameField.setTextLimit(FIELD_LENGTH);
> nameField.setText(someMethod.retrievePreferredText(name));
>
> nameRow = new GroupDataRow(group, (Label)descriptor,(Control)nameField);
>
> (with GroupDataRow(Composite parent, Label label, Control
> TextBoxOrDropDownBoxorComposite) )
>
> Why do I want to do this? -- Have groups filled dynamically, either with
> a TextWidget, or a comboBox instead.
>
> Thank you for any hints!
>
> Cheers, Bertram
Re: Deferred Layouting (i.e. not showing graphic ressources on object-generation-time) [message #437081 is a reply to message #437066] Fri, 28 May 2004 14:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bertram.herzog.web.de

Hi Grant,

thanks for the quick answer! However, I cannot really get ahead with
your suggestions.
ad 1.) In my understanding, I am creating the widgets in the top level
class, because I think this is the place I also have the possibility of
dynamically filling the text-fields of each label etc. and saving my
presets which were entered into the Text-Widgets. Having the
event-handling also encapsulated in this class. Thus the snippet-example
you gave me disposes not only the graphical representation of the
widget, but also all of its data.

ad 2.) The StackLayout reminds me of the awt.StackLayout, which is
somehow like a Tab-Layout without Tabs. This is certainly a good layout
for implementing a Wizard-like application logic. However, if I
dynamically want to fill a group with tuples of a Label and a
Text-|{Composite of buttons} according to user preferences (so the user
can choose in another part of the app, which tuples to show), none of
the two suggestions seem to match the problem.

Sorry to say this, and thanks a lot for your time in answering so far,
Bertram

Grant Gayed wrote:

> Hi Bertram,
>
> The easiest approaches to having a widget position dynamically change are:
>
> 1. create/dispose them as needed, see
> http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/plat form-swt-home/snippits/snippet98.html
> 2. use a org.eclipse.swt.custom.StackLayout
>
> Grant
>
> "Bertram Herzog" <bertram.herzog@web.de> wrote in message
> news:c97a6p$n2k$1@eclipse.org...
>
>>Hello altogether!
>>
>>I have a quick question, which is probably not too hard for most of the
>>SWT-Layout-cracks among you.
>>
>>Is there a possibility to do a "deferred layouting" in SWT?
>>
>>I want to create a Text Box and a its Label, and then have it layouted
>>by another Class. However, once the widget is created, it's displayed.
>>I guess that's how it is in SWT, or is there some equivalent to
>>JPanel.add() in SWT?
>>
>>Here my idea in Code...
>>Group g = new Group(shell, SWT.NONE);
>>g.setLayout(new RowLayout(SWT.VERTICAL); // puts line below line...
>>
>>Label descriptor = new Label(group, SWT.NONE);
>>descriptor.setText("Name");
>>
>>Text nameField = new Text(group, SWT.NONE);
>>nameField.setTextLimit(FIELD_LENGTH);
>>nameField.setText(someMethod.retrievePreferredText(name));
>>
>>nameRow = new GroupDataRow(group, (Label)descriptor,(Control)nameField);
>>
>>(with GroupDataRow(Composite parent, Label label, Control
>>TextBoxOrDropDownBoxorComposite) )
>>
>>Why do I want to do this? -- Have groups filled dynamically, either with
>>a TextWidget, or a comboBox instead.
>>
>>Thank you for any hints!
>>
>>Cheers, Bertram
>
>
>
Re: Deferred Layouting (i.e. not showing graphic ressources on object-generation-time) [message #437090 is a reply to message #437081] Fri, 28 May 2004 15:08 Go to previous message
Aris Basic is currently offline Aris BasicFriend
Messages: 16
Registered: July 2009
Junior Member
I am using dynamical gui creation with sort of forms that can change
depending on
type of object (in tree for example).

For that i created a controling object that itself has a group (or
composite)
(in your case this can also hold the data you need for your text
widgets/labels)
and then with each change i can tell my control object to dispose its child
(usally another composite
with the form in my case) and recreate a form for my specifc type.

I dotn know will this help you but thats what I am doing maybe you coudl use
similar approach


Aris

"Bertram Herzog" <bertram.herzog@web.de> wrote in message
news:c97h3a$2r1$1@eclipse.org...
> Hi Grant,
>
> thanks for the quick answer! However, I cannot really get ahead with
> your suggestions.
> ad 1.) In my understanding, I am creating the widgets in the top level
> class, because I think this is the place I also have the possibility of
> dynamically filling the text-fields of each label etc. and saving my
> presets which were entered into the Text-Widgets. Having the
> event-handling also encapsulated in this class. Thus the snippet-example
> you gave me disposes not only the graphical representation of the
> widget, but also all of its data.
>
> ad 2.) The StackLayout reminds me of the awt.StackLayout, which is
> somehow like a Tab-Layout without Tabs. This is certainly a good layout
> for implementing a Wizard-like application logic. However, if I
> dynamically want to fill a group with tuples of a Label and a
> Text-|{Composite of buttons} according to user preferences (so the user
> can choose in another part of the app, which tuples to show), none of
> the two suggestions seem to match the problem.
>
> Sorry to say this, and thanks a lot for your time in answering so far,
> Bertram
>
> Grant Gayed wrote:
>
> > Hi Bertram,
> >
> > The easiest approaches to having a widget position dynamically change
are:
> >
> > 1. create/dispose them as needed, see
> >
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/plat form-swt-home/snippits/snippet98.html
> > 2. use a org.eclipse.swt.custom.StackLayout
> >
> > Grant
> >
> > "Bertram Herzog" <bertram.herzog@web.de> wrote in message
> > news:c97a6p$n2k$1@eclipse.org...
> >
> >>Hello altogether!
> >>
> >>I have a quick question, which is probably not too hard for most of the
> >>SWT-Layout-cracks among you.
> >>
> >>Is there a possibility to do a "deferred layouting" in SWT?
> >>
> >>I want to create a Text Box and a its Label, and then have it layouted
> >>by another Class. However, once the widget is created, it's displayed.
> >>I guess that's how it is in SWT, or is there some equivalent to
> >>JPanel.add() in SWT?
> >>
> >>Here my idea in Code...
> >>Group g = new Group(shell, SWT.NONE);
> >>g.setLayout(new RowLayout(SWT.VERTICAL); // puts line below line...
> >>
> >>Label descriptor = new Label(group, SWT.NONE);
> >>descriptor.setText("Name");
> >>
> >>Text nameField = new Text(group, SWT.NONE);
> >>nameField.setTextLimit(FIELD_LENGTH);
> >>nameField.setText(someMethod.retrievePreferredText(name));
> >>
> >>nameRow = new GroupDataRow(group, (Label)descriptor,(Control)nameField);
> >>
> >>(with GroupDataRow(Composite parent, Label label, Control
> >>TextBoxOrDropDownBoxorComposite) )
> >>
> >>Why do I want to do this? -- Have groups filled dynamically, either with
> >>a TextWidget, or a comboBox instead.
> >>
> >>Thank you for any hints!
> >>
> >>Cheers, Bertram
> >
> >
> >
Previous Topic:Is there a way to run GUI C++ application in Eclipse Composite?
Next Topic:Traverse (tab) through tablecolumns in a table
Goto Forum:
  


Current Time: Thu Apr 25 13:03:22 GMT 2024

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

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

Back to the top