I am creating a custom view in eclipse for a project and I need to be able to bring in data from an outside source and graph it in a custom view. What is the best way to go about doing this? Thanks!
You'l want to look at the Graphical Modeling Project (GMP). That's where you'll find the base classes to build a custom graphical editor from scratch. There are also GMP sub-projects that generate graphical editor implementations from EMF models.
Related
Is it possible to define a perspective stack and perspective in the fragment.e4xmi?
The Eclipse 4 model editor doesn't seem to allow it. Why?
I add a new Model Fragment and for Feature Name I click Find ....
When I want to add a Perspective or a Perspective Stack, the dialog greys out the OK-Button.
Also, I have a lack of understanding what this Dialog is showing in general. It lists certain UI Elements and a lot of items below them, like
children
handlers
menus
and so on.
But those are listed multiple times. For example children is listed under CompositePart and under Dialog. But it doesn't make any difference which one I chose.
I know I can define the Perspective in the plugin.xml using the extension point and implementing IPerspectiveFactory. Is there no way to do it with the fragment.e4xmi?
Not sure about that dialog as I don't usually use it.
What you want to add is a Model Fragment with the 'Extended Element-ID' set to the id of the TrimmedWindow you want to put the perspective in. The 'Feature Name' would be children.
The model editor should then let you add a "Perspective Stack" as a child.
You can add the Perspective to the stack.
Note: Using the plugin.xml and IPerspectiveFactory is for Eclipse 3.x compatability mode, not pure e4. If you are using compatability mode I'm not sure how defining a perspective in the model editor fits.
I am starting a new eclipse plug-in project and trying to evaluate what is the best approach.
What is the goal: I want to create a plug-in that adds a View/Editor stacked on the Editor of the C/C++ perspective from the CDT plug-in. Similar to XML editors that have highlighted text editor view and a view that contains a form to be filled and automatically creates xml code.
The best way would probably be to extend the existing C/C++ perspective from the CDT plug-in. How this is done wtih the 3.X API is explained here [1,2]. Basically you use the org.eclipse.ui.perspectiveExtensions extension point to add views realtive to the views in the perspective.
But how can this be done with the e4 API and the model fragment? Is this possible with compatibility layer?
I think another possibility would be to add views contained in the C/C++ perspective through the combability layer to my own perspective like the package explorer. This has the adavantage that already existing 3.X views (like the package explorer) can be used but also have the advantages of the e4 API.
Or would it even be the best to create a pure 3.X plug-in because my plug-in is mainly based on another perspective/plug-in?
Hope somebody can help me here :)
I don't think it is possible to extend a 3.x perspective using e4 model fragments. It is certainly easier to stick to the 3.x style.
You can use e4 style views by using the e4view style view on the org.eclipse.ui.views extension point.
I have created a custom editor and want to implement a compare functionality between two files opened using it .
Can anyone suggest how could I achieve that functionality?
I'm writing a JFace standalone application using eclipse/windowbuilder pro. Windowbuilder is a nice tool to work with, but I'm having trouble finding information on the organizational structure of such an application.
Currently I'm extending the standard ApplicationWindow class (as is standard in windowbuilder examples) for the main window of my application and subclassing SWT composites for my 'sub windows' in the application. The problem I'm having is that I lose the ability to use JFace actions / databindings when I'm graphically building SWT Composite subclasses in windowbuilder. The palette for adding JFace actions is inaccessible when using SWT designer while subclassing standard SWT components. I've searched at length for how to add this palette to no avail (the standard method fails since this isn't a 'normal' palette that appears in the palette manager). I've also tried adding the JFace action component to my existing palette, but can't find documentation on how to add an abstract class (Action) to the palette. I know that I can write all the code I want by hand, but it defeats the purpose of using windowbuilder.
I'd really like to stick to the standard JFace viewer/action model, but I can't figure out which components I should be subclassing for my 'sub windows' in my app. I've tried subclassing the Window class directly but this doesn't yield access to windowbuilder's JFace Actions palette. I'm not sure under what conditions that palette is accessible (I've been iteratively removing and adding components to ApplicationWindow, I'm getting desperate). I have a few custom widgets that I'd gladly write JFace Viewers for if I could figure this out.
Any windowbuilder fans out there? Is subclassing SWT Composite a reasonable/standard way to go about making components of this application? What is the standard for writing apps that are more complicated than a single ApplicationWindow? I've searched high and low, but can only seem to find tutorials and examples that are a single application window -- nothing composite. I feel like I'm missing some key pieces of information with regard to the structure of more complicated JFace applications. I suppose my holy grail would be the JFace version of SWT Composite that would allow me access to JFace actions code generation through windowbuilder.
Any tips and/or reading material explaining standard JFace design for larger applications would be appreciated!
I've been working with WBPro for about 6 to 7 years now... I think we can have a conversation about your problem. I might not be able to answer your question completely, but I will do my best. So, first off, for your sub-windows you should use JFace Dialogs. You can create a template one from New>Other>WbPro>JFace>Dialog or just subclass it yourself. You can also use TitleAreaDialog which is cooler and has a Title Bar at the top just like all Eclipse Dialogs. These two classes are both within JFace and are available in WBPro.
You have the JFace widgets and viewers available in the Design Tab, but not the actions. But the reason for that is that Dialogs and sub-Windows do not have Toolbars or Menu bars, I think that's why they are not there in the palette, but if you have a Context Menu for one of your inner widgets, I think you should implement that yourself. I can dig a little deeper for you if you want, se tell me if there is still something to address.
I need to customize the look & feel of my RCP application.
I took a look at Eclipse Presentation API and I suppose it allows to customize everything in workbench except controls.
So is there any solution to customize controls?
I made some research work and implemented some ad-hoc SWT cunstomization using control canvas drawning. May be there are better solutions?
In Swing you can use Synth theme. It would be great if some 'skin' framework exists for SWT.
One way of customizing an RCP app is by using a plugin_customization.ini file. Like this:
Create a new file called "plugin_customization.ini" in the root of your project.
If you have not already done so, create a product configuration and define a Product.
In your plugin's manifest editor, on the "Extensions" tab, locate the "org.eclipse.core.runtime.products" extension, expand the node, right click on your product node and select "New > property" from the context menu.
Enter "preferenceCustomization" in the "name" field and "plugin_customization.ini" in the "value" field.
Select "File > Save" from the main menu.
You can then customize a lot of things simply by editing plugin_customization.ini file. For example, adding the following line
org.eclipse.ui/SHOW_TRADITIONAL_STYLE_TABS=false
will give you rounded tabs on your views and editors (similar to those that Eclipse IDE has) instead of the default ones.
You can find other constants that you can use in IWorkbenchPreferenceConstants javadoc.
Also, check out the Eclipse skins project, if you haven't already.
There is also the possibility to use CSS to change the look & feel of your app, but that is still in development and can be buggy
As for customizing the SWT controls themselves, the only way to do that (apart from small customizations such as changing the background colour of a control etc.) is by creating your own custom controls by extending Canvas or Composite, but you already know that. Keep in mind that the point of SWT is to use native controls, so if you desire the ability to completely customize your controls, perhaps using Swing would be a better option. However, if you're going to use Swing, it may be better to use another RCP entirely - namely, NetBeans RCP. I haven't tried it out yet, but I know that whereas Eclipse RCP uses SWT as a widget toolkit, NetBeans RCP relies on Swing, so that may save you from some headaches regarding compatibility problems and so on.
The new Eclipse 4 work contains plugins that allow the L&F to be customized using CSS. These plugins can be run in a 3.7 Eclipse environment. See Kai's blog for a presentation on the subject: http://www.toedter.com/blog/?p=477
The Eclipse 4 Styling Tutorial has a slide (p.66) on where to get an 3.7 based RCP example.