Home » Eclipse Projects » Eclipse Platform » Eclipse Plug-in Workbench & GUI design
| | |
Re: Eclipse Plug-in Workbench & GUI design [message #328904 is a reply to message #328895] |
Fri, 06 June 2008 06:00   |
Eclipse User |
|
|
|
Originally posted by: andreas.bjoru.bouvet.no
Try using the 'RCP application with a view' example. A ViewPart class
will be generated for you and you can modify it to your needs. The
following example shows a modified View.class (unless you modified the
name of the class) displaying a label, textfield and a button. The
button pops up a messagedialog with the value of the textfield:
public class View extends ViewPart {
public static final String ID = "delete.me.view";
private Text txtField;
private Button button;
@Override
public void createPartControl(Composite parent) {
parent.setLayout(new GridLayout(3, false));
Label label = new Label(parent, SWT.BEGINNING);
label.setText("Enter text:");
txtField = new Text(parent, SWT.BORDER);
txtField.setLayoutData(new
GridData(GridData.FILL_HORIZONTAL));
button = new Button(parent, SWT.PUSH);
button.setText("Click Me");
button.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event event) {
MessageDialog.openInformation(getSite().getShell(), "MyDialog", "Text:
'" + txtField.getText() + "'");
}
});
}
@Override
public void setFocus() {
txtField.setFocus();
}
}
Hope this helps..
-----Original Message-----
From: Cumhur Kilic [mailto:maxipower_q@yahoo.com]
Posted At: 6. juni 2008 10:30
Posted To: eclipse.platform
Conversation: Eclipse Plug-in Workbench & GUI design
Subject: Re: Eclipse Plug-in Workbench & GUI design
Thanks for links. specially Ben Galbraith's lesson is really helpful to
understand SWT.
But, all these information in the links are about how to write SWT
codes.
Could you tell me how can i use SWT inside a plug-in?
Plug-in has some unchangeable parts like Application Class and
Perspective
Class.
Where should i write the SWT code inside my Eclipse Plug-in Project ?
|
|
| | |
Goto Forum:
Current Time: Wed Apr 23 01:44:15 EDT 2025
Powered by FUDForum. Page generated in 0.04480 seconds
|