Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Eclipse Plug-in Workbench & GUI design
Eclipse Plug-in Workbench & GUI design [message #328868] Thu, 05 June 2008 15:19 Go to next message
Eclipse UserFriend
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 #328875 is a reply to message #328868] Thu, 05 June 2008 16:53 Go to previous messageGo to next message
Wayne Beaton is currently offline Wayne BeatonFriend
Messages: 554
Registered: December 2017
Senior Member
Maybe start here:

http://www.javalobby.org/eps/swt_intro/?source=archives

There are other SWT resources at:

http://www.eclipse.org/resources/?sort=date&category=SWT

Of course, then there's the SWT page:

http://www.eclipse.org/swt

which has a link to a bunch of snippets that show you how to use much
of the functionality.

http://www.eclipse.org/swt/snippets

HTH,

Wayne

On Thu, 2008-06-05 at 15:19 +0000, Cumhur Kilic wrote:
> 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 messageGo to next message
Eclipse UserFriend
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 messageGo to next message
Eclipse UserFriend
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 #328940 is a reply to message #328875] Sat, 07 June 2008 07:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: maxipower_q.yahoo.com

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 ??



Wayne Beaton wrote:

> Maybe start here:

> http://www.javalobby.org/eps/swt_intro/?source=archives

> There are other SWT resources at:

> http://www.eclipse.org/resources/?sort=date&category=SWT

> Of course, then there's the SWT page:

> http://www.eclipse.org/swt

> which has a link to a bunch of snippets that show you how to use much
> of the functionality.

> http://www.eclipse.org/swt/snippets

> HTH,

> Wayne
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
Eclipse UserFriend
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
Previous Topic:[JFace] Long-running operations in a Wizard
Next Topic:how to find plugin and its id
Goto Forum:
  


Current Time: Tue Jul 16 13:34:27 GMT 2024

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

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

Back to the top