Composite invisible? [message #493163] |
Fri, 23 October 2009 08:48  |
Eclipse User |
|
|
|
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 #493464 is a reply to message #493163] |
Mon, 26 October 2009 08:29   |
Eclipse User |
|
|
|
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 12:26   |
Eclipse User |
|
|
|
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 #522404 is a reply to message #521571] |
Mon, 22 March 2010 06:04  |
Eclipse User |
|
|
|
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
>
|
|
|
Powered by
FUDForum. Page generated in 0.04626 seconds