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).
Related
I'm currently working with VS Code. It has an option, located on the top-right of the screen, that allows you to split the editor. I'm wondering what is the utility of splitting an editor with the same file?
Thanks
Editor Groups
This feature allows you to create multiple "editor groups".
The default functionality of the UI option you're referring to, is to open the active editor in a new editor group.
One potential use case for this would be to simultaneously view and edit multiple places in one large file.
Multiple Files
However, you can also drag different files into this new editor group — allowing you to view and edit different files at the same time — which is very useful when you have very modularized code (which usually means there's a lot of related code in different files).
You can create virtually unlimited editor groups, and have virtually an unlimited number of files in each group.
Variety of Layouts
Additionally, with the latest version of VS Code, you can create two by two grid editor layouts, or create your own custom layout and attach it to a keybinding for easy switching.
Keybindings
Editor groups and their files can be controlled with the mouse (click, drag and drop), but you'll end up being a lot more productive if you make an effort to learn the keyboard shortcuts for the commands that you use most often.
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.
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.
I'm using Viewer Framework in my Eclipse RCP Application,wherein my table has all the capabilities like sorting and filtering,the problem is with,when i select a row in the table it gets highlighted in blue color by default, when a user try to filter using search box provided,which is located above the table,then the previously selected row gets faded away.To overcome this i thought it would be better to have a custom color or predefined color like red and which doesn't get faded away even Table-viewer loses focus(i don't know).
My guess is you're running under Windows 7, where this is the defined behavior of table selection and the focus. Just try to select a file in the explorer and then focus on another window....
Almost the same behavior is seen under various versions of OSX, and possibly for other operating systems as well.
Can you work around it? Yes, but it will require some work with a SWT.ItemPaint listener...
Question about Eclipse RCP and whole perspective/view/editor design - what is the best way to create application which will display multiple windows on multiple monitors? Tutorials and book I've seen always pack RCP/SWT design into views inside perspective within single application window.
Should one window rule all others or they all should be equal (closing last one exits application)? How deal with the perspectives and views? Are there any other things we should know?
Environment: Eclipse Ganymede, Windows XP.
A single Eclipse workbench can create multiple windows. Each window is laid out using a perspective, so different windows could be set to different perspectives, or the same perspective, and you can switch perspectives in each window independently of the other windows.
You can also set input for each window. This is useful if each window is working on different data (for example, each window could be connected to a different server or could be showing data from different databases that all have the same schema but different data).
It may be that you are using windows only so that you can see different perspectives of the same data on different monitors. In that case you do not need to programatically create the windows but need only add the action supplied by the workbench. This can be done by modifying your ActionBarAdvisor class:
add to the field declarations:
private IWorkbenchAction newWindowAction;
add to the code where you make the actions (typically a method called makeActions):
newWindowAction = ActionFactory.OPEN_NEW_WINDOW.create(window);
register(newWindowAction);
add to the code where you create the menus:
menu.add(newWindowAction);
where menu is typically the Window menu. If you don't have a Window menu already in your application and would like to create one, the following line will work:
MenuManager menu = new MenuManager(
"&Window",
IWorkbenchActionConstants.M_WINDOW);
This will give you a menu item that will create a new window in the same way as the Window->New Window menu item in the Eclipse IDE.
If, on the other hand, you want each window to show different data then you will need to open the new windows programatically. This allows you to set different input for each window. You will need a line of code something like:
IWorkbenchPage newPage = window.openPage(inputObject);
where inputObject contains information that identifies the data shown in the window. If you want to set the initial perspective this can be done by calling setPerspective on the page.
You will want to set the title in each window:
newPage.getWorkbenchWindow().getShell().setText(windowTitle);
where windowTitle is a string describing the input to the window.
You can fetch the input for a window as follows:
window.getActivePage().getInput()
You can then cast this to whatever class you are using as your window input.