Eclipse JFace TreeViewer with expansion markers "+" and "-" - eclipse

I am trying to run an example on eclipse JFace to populate directory structure which involves treeview. By executing the code, I get something like this :
Which is fine, directory structure is populated properly. However, as you can notice there is no way to differentiate if the current selection is a "File" or a "Directory" until I move my cursor, the TreeView then displays a ">" sort of sign to tell me if this is directory. Where as I want something more intuitive like a "+" sign to specify all the item (without focusing on the TreeView), which is like this :
Can someone please guide me how to achieve the same? I am using eclipse Kelper, Windows 7 x64.

In short: you cannot change the appearance of the expansion markers.
The JFace TreeViewer uses the SWT Tree widget to display its data. SWT in turn accesses the native UI libraries of the operating system and hence the appearance of widgets is controlled by the respective native UI library.

Related

Access "VSplit" Windows system cursor from SWT

I am developing an Eclipse RCP application (windows-only target platform) which uses both JFace TableViewers and NatTables.
When the user wants to resize a table column, they get two different mouse cursors for the two types of tables.
For NatTable this is SWT.CURSOR_SIZEWE.
For SWT/JFace Tables this is like the "VSplit" cursor in the cursor list at http://www.java2s.com/Code/VB/GUI/ShowAllCursors.htm
Obviously, the reason is that SWT uses native table widgets and the "VSplit"-like cursor used by the OS (Windows) here is platform-dependent (it does not even seem to exist on other platforms). So, I guess this is the reason why there is no SWT.CURSOR_VSPLIT or similar constant.
Does anyone know of any other way to access the builtin windows VSplit cursor (or however it is actually called) so that I can (re)use that cursor for the NatTable resize handle? (My current workaround is to include my own custom "VSplit"-like cursor, but I'd like it better if I could reuse the system resource).

Eclipse - Extend default visual editor with custom widgets

I'm using Eclipse as default IDE. In Eclipse there is a visual editor available to insert HTML tags in your *.html files. I'm using a lot of DOJO in my current project and want to add these widgets to the palette view. I assumed that there would be an option to add custom widgets/tags easily(palette's contextmenu or something), but this is not (yet) implemented. Does somebody knows if there is an option to add custom widgets in Eclipse?
I've already Googled a lot and didn't found where I am looking for.
ps. I don't want to use other editors(Maqetta, WDT-plugin, ...).

How to develop interface like Eclipse using GTK?

I want a write a desktop application using GTKMM. I want the interface to be made of different panels like in Eclipse you have the Project Explorer, Console, Properties, etc. You should be able to drag the panels to change their position, close them and popout them (not sure if you can popout the panels in Eclipse but you can do it in Visual Studio).
I am using the word panels here as I am not sure what the right term is. I guess some call it dockable windows.
Any pointers on how this can be achieved in GTKMM?
The term is "docking" widgets and the GDL Library is the easiest way to get started with that. You may have seen GDL in action in applications like Anjuta and Inkscape. The documentation isn't that great, but, the source code includes a sample app and once you get going with it it's not that hard.
Basically, you add your widgets to a DockItem and those to a Dock. You put a DockBar somewhere in your application to which the docked items can be minimized. You can save and load the dock "layout" to XML files so that the user doesn't have to re-arrange the dock items every time they start the application.

How can I change the view / editor for a file in Eclipse using the keyboard?

Eclipse has a common idiom where when you're editing say an XML file, it may have a "visual" editing view (key/value pairs, tree view, even the Android UI editor), with the option to switch to editing "raw" XML using a tab at the bottom of the window. I can switch between open documents with CTRL+PGUP/PGDN. Is there a way to switch editors?
I do this a ton when editing Android UIs, and always reaching for the mouse / trackpad is getting really old.
ETA: As another, perhaps more common example, consider editing a pom.xml file with the Maven plugin installed. You can get multiple "sub-tabs" for project settings, dependencies, reporting, etc., as well as editing the raw XML directly. I'd like to be able to switch between those tabs with a keyboard shortcut.
As seen on this post https://stackoverflow.com/a/9479062 use Alt + Pg Up and Alt + Pg Down to switch the bottom tabs on the XML editor.
I don't know if there is an existing (standard) key binding to do that. (Indeed, I'm not exactly sure I understand what you are trying to do).
However, if you go to Window > Preferences > General > Keys, you will see lots of commands that currently have no bound keys. Select the command that corresponds most closely to whatever you are trying to do and add a custom key binding.

how to access package explorer element in eclipse plugin

i am making an eclipse plugin which make a ui on right clicking a project in eclipse workspce . the ui contains text fields , package explorer for the current project and directory explorer for current project.
i have successfully made a ui which appears on clicking a menu item on right clicking the project but it seems i can't make any jface or swt ui since they are not visible when we are using eclipse command hadlers .so in order to overcome it i made dialog pages but they have limited dialog like directorty dialog and file dialog and that too for entire window directory..... but i want package explorer and directory explorer for the project i just chose like it happens when u try making a new class in a project the browse buttons just show packages and directory struture w.r.t to current selection
am i doin things wrong or is there a way out please suggest .....
It seems a bit unclear to me, what the 'UI' is about. If you plan to embed the package and directory views inside a dialog next to each other, then I think you have to build similar lists on your own, since they are views with their own event logic. But if you plan to use them via the browse buttons as describes, take a look at this page. It gives a good overview of the available selection dialogs in eclipse.
It is also always a good practice to search for code in eclipse that does nearly the same you want to do.
As an example, take a look at the new class wizard from the jdt.ui plug-in (This is the wizard you mentioned in your question): Press Cmd-Shift-T and begin typing 'newclass' and open NewClassWizardPage from org.eclipse.jdt.ui.wizards. This works as expected if you imported all jdt plug-ins as (binary) projects.
Take a look at the createControl method and dive into the createXXXControls methods via F3 and try to find out how JDT is doing the job.
As an alternative, open the desired selection dialog class (again with Cmd-Shift-T) and open the call hierarchy of that class...