FieldEditors in a view - GridLayout gets messed up [message #464583] |
Sun, 11 March 2007 10:36 |
Eclipse User |
|
|
|
Originally posted by: roger.kristiansen.gmail.com
I hope this is the correct group for posting this question.
The issue is this: I need, for various reasons, to create a preference
_view_, not a page, and I thought using the various subclasses of
FieldEditor would make sense also in this case. What I don't understand,
though, is that no matter how many columns I configure the parent
composite with, it seems to always end up with _two_.
I'm quite new to GUI programming, so am I misunderstanding how these are
supposed to be filled into the GridLayout? I have added the code to this
posting, as well as a link to a pastebin (for syntax highlighting ;) and
an image of the resulting view.
Pastebin: http://pastebin.ca/390292
Image: http://img241.imageshack.us/img241/5452/screenshoths2.png
public class ConfigurationView extends ViewPart {
public static final String ID =
"edos.distribution.rcp.configuration.views.configurationview ";
private Composite composite;
public void createPartControl(Composite parent) {
composite = new Composite(parent, SWT.NONE);
composite.setLayout(new GridLayout(3, false));
// Peer type
RadioGroupFieldEditor peerType = new RadioGroupFieldEditor(
"edos.peer.peertype",
"Peer type",
3,
new String[][] {
{"Client", "client"},
{"Mirror", "mirror"},
{"Publisher", "publisher"}
},
composite,
true);
peerType.fillIntoGrid(composite, 3);
// Path do repositories
DirectoryFieldEditor repositoryPath = new DirectoryFieldEditor(
"edos.release.repository.path",
"Release repository path",
composite);
repositoryPath.fillIntoGrid(composite, 3);
FieldEditor publisherIP = new StringFieldEditor(
"edos.index.publisherip",
"Publisher IP Address",
composite);
publisherIP.fillIntoGrid(composite, 3);
}
public void setFocus() {
}
}
Thanks,
Roger
|
|
|
Powered by
FUDForum. Page generated in 0.05772 seconds