Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Composite invisible?(LaunchConfigurationTab)
Composite invisible? [message #493163] Fri, 23 October 2009 12:48 Go to next message
Alexander Mack is currently offline Alexander MackFriend
Messages: 100
Registered: July 2009
Senior Member
Hello,
I am creating my own LaunchGonfigurationTab. Initially the method createControl is called by the Eclipse Framework if you extend a class from AbstractLaunchConfigurationTab.

The problem is that nothing of the components I add to the composite are displayed:

public void createControl(Composite parent) {
parent.setLayout(new RowLayout(SWT.HORIZONTAL));
parent.getLayout();
Composite comp = new Composite(parent, SWT.NONE);

//-Project-Group
Group lProjectGroup = new Group(comp,SWT.NONE);
lProjectGroup.setText("Project Properties");
RowLayout lGroupRowLayout = new RowLayout(SWT.HORIZONTAL);
lProjectGroup.setLayout(lGroupRowLayout);
GridLayout lProjectGroupLayout = new GridLayout(3, false);
lProjectGroup.setLayout(lProjectGroupLayout);

//ProjectLabel
Label lProjectText = new Label(lProjectGroup, SWT.NONE);
lProjectText.setText("Project:");


//Project-Goup Textfield
GridData lProjectGrid = new GridData(GridData.FILL_HORIZONTAL);
lProjectGrid.widthHint = 500;
mProjectTextfield = new Text(lProjectGroup, SWT.BORDER);
mProjectTextfield.setLayoutData(lProjectGrid);
mProjectTextfield.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
updateLaunchConfigurationDialog();
}
});
....
}

I would appreciate any help..
Thanks and best regards
Alex
Re: Composite invisible? [message #493260 is a reply to message #493163] Sat, 24 October 2009 01:20 Go to previous messageGo to next message
Remy Suen is currently offline Remy SuenFriend
Messages: 462
Registered: July 2009
Senior Member
On Fri, 23 Oct 2009 08:48:14 -0400, Alexander Mack wrote:
> The problem is that nothing of the components I add to the composite are
> displayed:
>
> public void createControl(Composite parent) {
> parent.setLayout(new RowLayout(SWT.HORIZONTAL));
parent.getLayout();
> Composite comp = new Composite(parent, SWT.NONE);

Your 'comp' Composite needs a layout.

Regards,
Remy
Re: Composite invisible? [message #493464 is a reply to message #493163] Mon, 26 October 2009 12:29 Go to previous messageGo to next message
Alexander Mack is currently offline Alexander MackFriend
Messages: 100
Registered: July 2009
Senior Member
Hello, first: Thanks for your answer!
Okay I solved the problem with the layout for now, but there is still one problem left:

I want not the standard size so I resize the parent shell. Problem is that all components are only visible after resizing the window?!
I really don't know why and tried everthing like parent.getShell().layout()/update() e.c.

Here is some code:
protected Control createContents(Composite parent) {
parent.getShell().setSize(999, 999);
mComp = new Composite(parent, SWT.NONE);
mComp.setFont(parent.getFont());
mComp.setLayout(new GridLayout());
mComp.setLayoutData(new RowData());

//Preference Group
Group lPreferenceGroup = new Group(mComp,SWT.NONE);
lPreferenceGroup.setText("Preferences");
GridData lPreferenceGridData = new GridData();
lPreferenceGridData.horizontalAlignment = GridData.FILL;
lPreferenceGridData.grabExcessHorizontalSpace = true;
lPreferenceGroup.setLayoutData(lPreferenceGridData);
GridLayout lPreferenceGridLayout = new GridLayout(3, false);
lPreferenceGroup.setLayout(lPreferenceGridLayout);

//Location Label
Label lGeneratorMainFile = new Label(lPreferenceGroup, SWT.NONE);
lGeneratorMainFile.setText("Java Generator Location: ");


//Location Textfield layout
GridData lGeneratorLocationTextGridData = new GridData();
lGeneratorLocationTextGridData.horizontalAlignment = GridData.FILL;
lGeneratorLocationTextGridData.grabExcessHorizontalSpace = true;

//Location textfield
mGeneratorLocationText = new Text(lPreferenceGroup, SWT.BORDER);
mGeneratorLocationText.setLayoutData(lGeneratorLocationTextG ridData);
...
}

I would appreciate any help.
Best regards,
Alex
Re: Composite invisible? [message #493716 is a reply to message #493464] Tue, 27 October 2009 16:26 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2151
Registered: July 2009
Senior Member
Moving your "parent.getShell().setSize(999, 999);" to the end of your
createContents(...) implementation will probably fix this.

Grant


"Alexander Mack" <alex043@gmx.de> wrote in message
news:hc44o3$qk6$1@build.eclipse.org...
> Hello, first: Thanks for your answer!
> Okay I solved the problem with the layout for now, but there is still one
problem left:
>
> I want not the standard size so I resize the parent shell. Problem is that
all components are only visible after resizing the window?!
> I really don't know why and tried everthing like
parent.getShell().layout()/update() e.c.
>
> Here is some code:
> protected Control createContents(Composite parent) {
> parent.getShell().setSize(999, 999);
> mComp = new Composite(parent, SWT.NONE);
> mComp.setFont(parent.getFont());
> mComp.setLayout(new GridLayout());
> mComp.setLayoutData(new RowData());
>
> //Preference Group
> Group lPreferenceGroup = new Group(mComp,SWT.NONE);
> lPreferenceGroup.setText("Preferences");
> GridData lPreferenceGridData = new GridData();
> lPreferenceGridData.horizontalAlignment = GridData.FILL;
> lPreferenceGridData.grabExcessHorizontalSpace = true;
> lPreferenceGroup.setLayoutData(lPreferenceGridData);
> GridLayout lPreferenceGridLayout = new GridLayout(3, false);
> lPreferenceGroup.setLayout(lPreferenceGridLayout);
>
> //Location Label
> Label lGeneratorMainFile = new Label(lPreferenceGroup, SWT.NONE);
> lGeneratorMainFile.setText("Java Generator Location: ");
>
>
> //Location Textfield layout
> GridData lGeneratorLocationTextGridData = new GridData();
> lGeneratorLocationTextGridData.horizontalAlignment = GridData.FILL;
> lGeneratorLocationTextGridData.grabExcessHorizontalSpace = true;
>
> //Location textfield
> mGeneratorLocationText = new Text(lPreferenceGroup, SWT.BORDER);
> mGeneratorLocationText.setLayoutData(lGeneratorLocationTextG ridData);
> ..
> }
>
> I would appreciate any help.
> Best regards,
> Alex
>
Re: Composite invisible? [message #493865 is a reply to message #493163] Wed, 28 October 2009 10:25 Go to previous messageGo to next message
Alexander Mack is currently offline Alexander MackFriend
Messages: 100
Registered: July 2009
Senior Member
Hello, first: Thanks for your answer.

I tried that before but if I put parent.getShell().setSize(1000, 600); at the end of the Method I'll get the following error:

"The currently displayed page contains invalid values"

Don't know why and how to solve it, why does it not work?

Best regards
Alex

Re: Composite invisible? [message #495801 is a reply to message #493163] Fri, 06 November 2009 08:40 Go to previous messageGo to next message
Alexander Mack is currently offline Alexander MackFriend
Messages: 100
Registered: July 2009
Senior Member
Hello again,
does nobody know the answer?
The problem still exists.
If I open the preferene page window the first time and select my preference page every component is visible.
If I open the preference page for the second time (my page is now selected initially) the components are all invisible. Only rezising the window makes them visible...

I don't really know what's the problem, so I would appreciate any help.

Thanks and best regards
Alex
Re: Composite invisible? [message #495830 is a reply to message #495801] Fri, 06 November 2009 10:45 Go to previous messageGo to next message
Juan is currently offline JuanFriend
Messages: 29
Registered: July 2009
Junior Member
composite.layout();
composite.update();

Have you tried this?

Good luck!


Alexander Mack escribiĆ³:
> Hello again,
> does nobody know the answer?
> The problem still exists.
> If I open the preferene page window the first time and select my
> preference page every component is visible.
> If I open the preference page for the second time (my page is now
> selected initially) the components are all invisible. Only rezising the
> window makes them visible...
>
> I don't really know what's the problem, so I would appreciate any help.
>
> Thanks and best regards
> Alex
Re: Composite invisible? [message #495893 is a reply to message #493163] Fri, 06 November 2009 14:32 Go to previous messageGo to next message
Alexander Mack is currently offline Alexander MackFriend
Messages: 100
Registered: July 2009
Senior Member
Hello & thanks for your answer!
OMG, I thought I tried this before Evil or Very Mad
But that's it, now it works fine...

Great thanks for your help

Best regards Alex
Re: Composite invisible? [message #521571 is a reply to message #495893] Thu, 18 March 2010 06:35 Go to previous messageGo to next message
Jason  is currently offline Jason Friend
Messages: 17
Registered: September 2009
Junior Member
Hi,

I am trying to do the same thing and create my own launch configuration tab.

I was able to get my controls to display ok, but I am not sure where to go from here.

I have the following questions:

1. How do I enable the Apply/Revert buttons in the launch config dialog? I have a set of radio buttons, and when one changes I expect Apply to be enabled. I tried using the function setDirty(true) but this doesn't seem to do anything.

2. How do I save my settings when they change? If someone selects an item in a control, how does that change persist?


Any help would be greatly appreciated, I am really stuck at the moment.


Thanks,
Jason
Re: Composite invisible? [message #522404 is a reply to message #521571] Mon, 22 March 2010 10:04 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2151
Registered: July 2009
Senior Member
The eclipse.platform newsgroup is probably a better place for this question.
It doesn't really have anything to do with swt.

Grant


"Jason" <nosage05@hotmail.com> wrote in message
news:hnshju$avp$1@build.eclipse.org...
> Hi,
>
> I am trying to do the same thing and create my own launch configuration
tab.
>
> I was able to get my controls to display ok, but I am not sure where to go
from here.
>
> I have the following questions:
>
> 1. How do I enable the Apply/Revert buttons in the launch config dialog? I
have a set of radio buttons, and when one changes I expect Apply to be
enabled. I tried using the function setDirty(true) but this doesn't seem to
do anything.
>
> 2. How do I save my settings when they change? If someone selects an item
in a control, how does that change persist?
>
>
> Any help would be greatly appreciated, I am really stuck at the moment.
>
>
> Thanks,
> Jason
>
Previous Topic:Calculate with pixels of text widget
Next Topic:Add border to sourceviewer
Goto Forum:
  


Current Time: Sat Aug 24 17:32:09 GMT 2019

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

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

Back to the top