Eclipse Plug-in Workbench & GUI design [message #328868] |
Thu, 05 June 2008 15:19 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: maxipower_q.yahoo.com
I'm designing a renaming plug-in for my project. So i must take 3 strings
from user. And also there should be a button.
I read some tutorials but i couldn't find what i'm looking for, so i have
2 questions;
1. Could someone find me an example code that describes how can i create a
workbench with textFields and Butons?
2. It's easy to do them with Java GUI. But -for example- when i put the
GUI code inside the Hello-World example's Application class, it doesn't
opens a GUI window when i pressed the plug-in's button. It says "The
chosen operation is not currently available". Can you tell me how to use
GUI with plug-in correctly ?
It's enough for me if you can answer one of this questions.
i prefer the first question, because using workbench looks a better way to
write plug-ins.
Thanks...
|
|
|
|
Re: Eclipse Plug-in Workbench & GUI design [message #328895 is a reply to message #328875] |
Fri, 06 June 2008 08:29 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: maxipower_q.yahoo.com
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 ?
|
|
|
Re: Eclipse Plug-in Workbench & GUI design [message #328904 is a reply to message #328895] |
Fri, 06 June 2008 10:00 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
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 ?
|
|
|
|
Re: Eclipse Plug-in Workbench & GUI design [message #328964 is a reply to message #328940] |
Mon, 09 June 2008 13:09 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: eclipse-news.rizzoweb.com
Cumhur Kilic wrote:
> Thanks for your help. Links are really helpful.
>
> I checked these links and some books, but all i can find ;
> How to write plugins, and How to write SWT codes.
> I couldn't find any tutorial or example about one really important thing:
>
> Plugins has certain parts like: Application class, View Class,
> Perspective Class..
> Where and How Should I Put My SWT Code inside the Plugin Code ??
Get and read this book - it will give you most of the answers I think
you are looking for:
http://www.qualityeclipse.com/
You might want to ask the authors if a new edition is forthcoming - the
edition I have only covers up to Eclipse 3.2
Hope this helps,
Eric
|
|
|
Powered by
FUDForum. Page generated in 0.04094 seconds