How to create a view in eclipse which contains SWT components? - java

I am trying to create a view in eclipse. I want my view to contain a Textfield and a button. the action is triggered by clicking on the button and some processing will be done on the inserted query in the textfield. can anyone suggest me a link to a tutorial or example doing that?
Thanks

You can create two quick samples that together show you what you've asked for. You do that by using the new project wizard to create a plugin project. One of the last wizard pages has a list of templates to choose from. If you create a plugin using the "with a view" template, you'll see how to create a view. Go back and create a second plugin with the "multi-page editor" template and you'll see examples of buttons, their event handlers and text fields. It should be easy to see how to code up the buttons and texts in the view.

Related

How to write dynamic about menu in eclipse

I need to add dynamic content inside about menu in eclipse application.
Any idea about the About menu plugin??
In the Branding tab inside product file i am adding static content in the About dialog. Now i need to add some dynamic content that will be decided in the run time of the application.
Is there any method to override to get the dynamic content inside the About menu???
Please can anyone help me.
The about dialog org.eclipse.ui.internal.dialogs.AboutDialog does not support any dynamic context.
The main text comes from the aboutText property defined in the org.eclipse.core.runtime.products product definition.
The images come from the installed bundle groups.
The data on the branding / feature dialog just comes from the feature and branding plugin and is also not dynamic.

Highlight lines of code in an editor programmatically made using jface, eclipse SWT

I am currently using a bunch of eclipse, jface libraries to build a small editor. I am using eclipse's SourceViewer for it. I am trying to highlight/change the color of parts of my code in eclipse however I don't think I can use the concept of damager, repairer and PresentationReconciler because I want to highlight lines of code based on user selection. So if a user selects some code I can get the selected code by using
SourceViewer.getSelectionProvider().getSelection();
Which would return an ISelection and thats what I want to "Highlight". I am currently able to create Annotations which essentially creates squigglies under the text the user selects I would rather change the color of the selected text. Would much appreciate any help.
edit:
I am not developing as an eclipse plugin but as a standalone application using the plugin api's.

How to remove wizard container title bar in swt/jface

I have created a wizard in swt/jface. and i would like to remove the wizard container bar. I checked the documentation of the wizard page but couldn't find anything. Is their is a way to do this.Here a pic to explain better
So i need to remove this red rectangaled part
The first thing I'd try would be to try returning null from the methods that populate that area of the wizard UI.
If that doesn't work, you can always look into the Eclipse implementation of Wizard and WizardPage to see what draws that area and implement your own version that draws what you want - IWizard and IWizardPage are just interfaces after all. I've done something similar (though this was a few years ago) for implementing a much more customized wizard that ended up containing a GEF editor inside it as well.

Custom SWT list item

I am developing an application which basically just loads plugins inside a folder. It should list the loaded plugins in a SWT GUI. The items of the list should show more information than just one string. For example it should have one line which displays the plugins name, one line which displays a description and one for the version. How could I extend a SWT control or the JFace ListViewer so that it behaves like this? I did not find any information when searching for "custom swt list item" or similar terms. Is it actually possible?

Is there a confirm dialog with preview button upon delete in RCP Application?

I am creating a delete-object confirm dialog. e.g."Are you sure you want to delete this item?". My items are in a tree view, therefore they could have many children and grandchildren.
I was wondering if there is any thing similar to when we try to delete e.g. a package in Eclipse projects package explorer, where a "preview" button is around and could display additional info before confirming a delete.
I appreciate any hint and/or help!
Thank you,
I believe you would have to create your own confirm dialog.
You could start with a JFace TitleAreaDialog.
You would display the tree view or a part of the tree view in the body of the dialog.

Categories

Resources