customise eclipse scout application look and feel - eclipse

I am new to eclipse scout. My question is how do i customise the default application look and feel for an eclipse scout application. I want to be able to change the button colors and replace the default icons with my own. I was able to change some of the colors using the application.css file but i did not archieve much. Also, is there a way of getting the ids, or class names for the various components in the resulting web pages so that i can be more granular in styling them.
Thanks in advance.

How you can style an Eclipse Scout application depends on which front-end you use: RAP, Swing or SWT.
Swing
You can use the Scout Swing Spy to determine the class name of a component in your UI when you have it selected.
If you use the Rayo look and feel, you can use implement the interface ILookAndFeelConfigurator and register it for the extension point org.eclipse.scout.rt.ui.swing.lafconfigurator to change the theming by providing a custom XML. The Rayo concept wiki article explains this in more details.
If you do not use the Rayo LaF...
RAP
The default RAP theme is modelled after the Rayo theme mentioned above.
Changing it involves creating your own theme bundle and create the appropriate CSS file there. Given that it is a RAP theme, you'll have to refer to the RAP RWT Theming guide. See the Scout forum thread "Scout Web App + CSS".
For reference, this is the Rayo CSS file of the Eclipse Scout 5.0 in the eclipse scout git repository (org.eclipse.scout.rt.ui.rap.theme.rayo)
SWT
Given that the SWT UI is designed to be portable and uses the widgets provided by the operating system, the amount of customization is more limited.
You can use the extension point org.eclipse.scout.rt.ui.swt.lookAndFeel to adjust some values of the look and feel (see schema file). See also the Scout thread "Modifying SWT look and feel for disabled elements"

you can make your own button and you own icon by use photoshop first bro
then copy the file into res/drawable of your application project

Related

Eclipse e4 migrating 3.x plugin to 4.x?

I have been working with Eclipse RCP for over a week now, and I've now been given an Eclipse plugin written in 3.x, which I need to migrate to 4.x. I'm using a book called Eclipse 4 RCP by Lars Vogel which has a small section on this, but I can't for the life of me figure out what I'm to do.
I'm trying to do this throught the use of the compatiblity layer. It mentions to add a couple of features for this (org.eclipse.rcp, org.eclipse.emf.ecore, org.eclipse.emf.common) and your ready to go, but I don't exactly know what I'm to do here. Like do I add these to the existing product file of the 3.x plugin I've been given, or do I create a separate e4 project and point to that. Many of the tutorials I read are a bit vague with the details and its a shame there's no proper step by step guide for beginners with this. Any help would be great.
Probably, you should be creating a separate e4 plug-in project for this. And where you have to configure your extensions/extension points in e4 ways.
Basically, like creating a new project.
If you want to migrate your Eclipse 3.x RCP application to the Eclipse 4 programming model, you can't directly reuse existing plugin.xml based user interface components, e.g. Views or Editors based on the definition in plugin.xml .
Components based on the plugin.xml file must be adjusted to avoid inheritance of Eclipse classes and to use the programming model based on #Inject . They also must be contributed to the application model.
Components which are not directly based on the plugin.xml file must be adjusted if they use Eclipse 3.x singletons, as for example Platform or PlatformUI , to access Eclipse API
you may want to take a look at this page: https://www.eclipse.org/community/eclipse_newsletter/2013/february/article3.php

Reuse standard menus in Eclipse RCP4 application

I want to reuse standard menus from the Eclipse IDE in my RCP4 application (e.g. Windows->Preferences).
In Eclipse RCP3 applications you simply have to add a menuContribution to the plugin.xml to achieve this.
I tried the same for my RCP4 application but without success. Is there another way to add standard menus to a RCP4 application?
For a pure e4 application which is not using the 3.x compatibility layer you have to construct all the menus and dialogs yourself.
For preferences you can use the JFace org.eclipse.jface.preference.PreferenceDialog which is a simpler version of the normal preferences dialog, but you don't get the preference page extension point (or any existing pages) so you have to craft all that yourself.

How to create Eclipse RCP application that behaves like a wizard?

I want create a installer by using Eclipse RCP. I need to give the user a wizard-like installer. This means user can do some options then click next. Or they can go back to previous page by click previous. Or they can cancel the installation by clicking cancel.
Here is my problem:
I don't know how to switch between views when clicking "next","previous". I need to create something like WizardPages and i can change between these pages?
I can't use JFace wizard because I'm required not to pop up any dialog.
I'm totally new to Eclipse RCP so please help!
thanks.
Maybe "StackLayout" is what you need.
Consider whether you actually want/need Eclipse RCP in this context. Eclipse RCP shines in complex applications with an extensive business domain and complex user interface.
An installer wizard, however, is very straightforward and static. I cannot imagine you requiring more than two or three user inputs. Your question is a bit like "I want to hear beautiful music. How do I program a robot to play the piano?"
It is much easier to limit yourself to using SWT and JFace. Use the JFace WizardDialog to make a nice installation wizard. You will find you will have never needed the Eclipse RCP framework.
See http://www.vogella.com/tutorials/EclipseWizards/article.html for a nice tutorial.
If you do think you need the features of the Eclipse RCP runtime framework, I suggest you follow the path below instead:
Create an RCP application (e.g. the sample 'Mail' application). A class will be created that is the main entry point in your application. This class will launch the Eclipse Workbench. Delete this code, and instead launch the WizardDialog.
A lot of things will not be available, such as menu's, views with drag-and-drop functionality, keybindings, etc. I cannot imagine you will need those things. However, you will benefit from the following Eclipse RCP features:
Eclipse launch framework. Ability to create a self-contained product including the JRE.
OSGi framework. Ability to easily add new plugins. Ability to use services, blueprint, etc.
JFace framework.
EMF (if you have a very complicated installation wizard)
All other eclipse plugins, although a lot of them may not work outside of the context of the Eclipse Workbench.
If you are convinced you need the full Eclipse Workbench, you can always do the following:
Define a 'base' perspective that is 'locked down'.
Use a Command to move from one perspective to the other. This will allow you to keep the previous wizard views open in other (hidden) perspectives.
Use Eclipse Contexts to hide all the standard Eclipse Workbench functionality, menu's, etc.
Since you are new to Eclipse RCP, I do not recommend learning the framework in the particular usecase of an Installation Wizard. You already need good knowledge of Eclipse RCP to be able to hack it this way, and it will not be a clean or nice implementation :-)

Integrating community plugins into a ready Eclipse RCP app?

I already have a standalone Eclipse RCP application. The next task is to integrate the plugins which are widely used in the Eclipse community like CDT or say PyDev to provide the editing and debugging facilities in respective programming languages inside the already developed RCP app. Just wondering how do i go about accomplishing this task. Should i start with playing around the extension points of the plugins and adding it to the MANIFEST.MF ?
What are the various ways of achieving this ? Which one to pick over the other?
The most important thing you should consider (besides the technical) is a conceptional.
Plugins like CDT are making a lot of assumptations about their environment they are integrated into. That means your RCP should have a very similar user-interface and behavior like the normal Eclipse SDK so that the integration of other "IDE-ish" plugins is not a break of the interface principles of your RCP.
If your RCP is not based on a common navigator, projects, files (in general the Workspace) and several editors the integration of Plugins like CDT will be a nightmare for your users and will feel like another application within your RCP.
Make also sure that ui-contributions from third-party-plugins are visible (e.g. if the third-party-plugin is contributing a preference page, make sure that your RCP has the menu-item to open the preference-window)
First you have to load the new features/plugins in your existing RCP application. For this you have to adapt your product definition and load the new feature.xml files. or you enhance your own feature.xml and place the new plugins into.
Afterwards you have to decide, whether the new functions/view/perspectives are contributions to an already existing RCP extension point and whether you use this extension point in your RCP product.
If you want to use the new functions in another way (because the default is not enough) you have to point to specific views/actions in the new plugins and call them by your self. Fot his you have to adapt the MANIFEST.MF of your own plugin and point to the new plugins. If you do it, you can not switch off the added features, because you do have a jard link to these plugins.
Your RCP product already depends on the RCP feature (org.eclipse.rcp) or a subset of its plug-ins. This means, it already includes the plug-ins defining the basic extension points.
To include functionality (extensions) from additional features, just add these features to your product configuration dependencies. For example, you would have to add the feature org.eclipse.cdt for CDT and org.python.pydev.feature for PyDev.
The hard part begins when you need to include only some of the features' plug-ins.
You'll have to isolate the plug-in(s) providing the functionality you require.
For UI contributions, you can use the plug-in selection spy by selecting the required UI part and clicking alt+shift+F1.
For non-UI contributions, information for contributed extensions can be found in the plugin.xml files in the plug-in sources.
These plug-ins, along with their dependencies can be added to a custom feature, which can be included in your product.
Although dated, the article Building a CDT-based editor might also be of help.

Using IDE plug-in in an Eclipse RCP application?

I'm developing an Eclipse RCP based application, that uses the resource model of eclipse (workspace, projects, resources, etc.). For basic usage of the resource concept, there is no need to depend on the IDE plug-in. But many dialogs, wizards or views I want to use are inside this plug-in. I read about not to have any dependencies on IDE plug-ins in an RCP app.
For example, I want to implement a new project wizard and use the common look and functionality of the existing ones by overriding org.eclipse.ui.dialogs.WizardNewProjectCreationPage and using org.eclipse.ui.wizards.newresource.BasicNewProjectResourceWizard - both inside the IDE plug-in.
Are there any caveats using org.eclipse.ui.ide plug-in in an RCP app?
If so, what is your best practice to not reinvent the wheel?
As you can see with this thread (or that one), since eclipse3.3, most the the components of org.eclipse.ui.ide have been isolated in their own plugin.
So it can be a good practice to include what you need from that package, the only problem being to include to much contributions.
This thread gives a hint as how to remove some of them.
You can, for example, disable export and import wizards.
Both of those examples are based on Activity filtering
An activity is a logical grouping of function that is centered around a certain kind of task.
For example, developing Java software is an activity commonly performed by users of the platform, and the JDT defines many UI contributions (views, editors, perspectives, preferences, etc.) that are only useful when performing this activity.
Activities can be used to implement progressive disclosure of UI elements; when used for this purpose, they are called capabilities in the UI.
The second use for activities, added for Eclipse 3.4, is to filter available UI elements based on other criteria such as the current user's access permissions as defined by the application.
This article "Eclipse Activities – Hide / Display certain UI elements" by Lars Vogel in his "papercut series" gives a good illustration of hiding / displaying certain UI elements.