After years of working with shallow .properties files to hold preferences and settings of our application, we plan to create an MVC component for preferences dialog, backed up by some kind of model in file system or data base.
We aim to have something like eclipse (and many other IDE's and applications) has: a tree of application components on the left hand side of the dialog, each node in the list can have a matching preferences page with titles, sections, tabs and button groups.
We plan to make the GUI modular, and build according to xml files that define the GUI, and the relations between Swing controls to the matching properties.
So, before we begin inventing the wheel, I thought we could reuse some library that does exactly this.
I started investigating the eclipse source, but it's all SWT based, which I'm not sure how easy it is to integrate into our Swing based application.
So, does enyone know of a good java library to do the work for us?
One candidate is JIDE Dialogs. A variety of styles are supported.
You can start a demo from a browser here. In the tree on the left, select Jide Dialogs>Options Dialog Demo. Click one of the buttons that appear, to select a style.
In addition to providing the generic presentation layer for preferences, Eclipse's preferences framework also supports an optional persistence model, and a way to contribute preferences pages.
Related
To improve my programming skills I would like to set up a little project for my work. I would like to create a kind of to do list, with several columns (Note, PO Order, Shipping, Done (as a Checkbox), ect.).
At the end of a day, I want to be able to click on the checkbox for every row which is done and save them in a data file. Also I would like to create this as a web application, running on the server in the company.
Since I would like to improve especially my java skills I would like to do this (if possible) mostly in java and to get in touch with frameworks, so I started to read about Vaadin.
My question is, if you guys could give maybe some experience about a project like this and if it's in general possible to realise this with Vaadin.
To improve my programming skills
If you want to build web apps using pure Java on the server-side, Vaadin fits the bill.
You describe the layout and widgets you want to appear in the user interface using Java code. Then, at runtime, Vaadin automatically generates the necessary HTML, CSS, JavaScript, DOM, AJAX, WebSocket, and Push code needed to render that UI on the client-side in the user’s web browser.
The beautiful part is that you get all the benefits of using those web standards technologies without having to learn them or code them.
create a kind of to do list, with several columns (Note, PO Order, Shipping, Done (as a Checkbox), ect.).
Vaadin provides a powerful and well-designed data-grid widget, Vaadin Grid, that can display such columns including the checkbox.
I want to be able to click on the checkbox for every row
The Vaadin Grid tool has an interactive mode that allows the user to directly edit the row, including clicking on the checkbox.
You could alternatively let the user select several rows and click a button (that you programmed) than would mark them as done, checking the checkboxes of the group at once.
Also, Grid has a built-in feature where it displays a column of checkboxes to be clicked en masse as an alternative to selecting rows. This helps the many users who are not adept at maneuvering through a multi-row selection with mouse-and-keyboard gestures.
I would like to create this as a web application, running on the server in the company.
Your Vaadin-based web app is built on standard Java Servlet technology. So you can deploy to your choice of any of a dozen or more web containers such as Apache Tomcat, Eclipse Jetty, Glassfish, Wildfly, and many more.
I would like to do this (if possible) mostly in java
You can build your web app entirely with Java code by using Vaadin. All Java on the server-side, no Java on the client-side.
You may eventually want to learn a bit of CSS to tweak the fonts and colors and such. But this is optional.
if it's in general possible to realise this with Vaadin.
Indeed, this project sounds like an ideal match to Vaadin.
In contrast, where Vaadin is contraindicated would be:
For web sites with crazy complicated layouts such as slick magazine sites. Vaadin is aimed at business-oriented data-entry apps.
For programmers who want to grapple directly with the HTML, CSS, JavaScript, etc. rather than avoid it.
The Eclipse RAP (Remote Application Platform) project provides a way to write web applications using SWT.
Due to single sourcing, the written code can also be used in desktop SWT/RCP applications.
Since it is a framework for web applications I was wondering if it supports responsive design?
If so, a simple example would be great. It does not need to be RCP compatible.
I didn't find a lot on the internet, has there been any efforts towards supporting responsive design?
Due to the fact that RAP shields you from web technology, native CSS and other web-techniques won't work.
To summarize the comments, you will likely have to implement one or more custom layouts that adapt to the available space and show/hide/resize the managed controls accordingly.
You may also want to use custom controls or manipulate existing controls to adapt to the available space. in some places. For example, hide texts on toolbar buttons when space becomes rare.
RAP theming can also be leveraged to a certain extent in order to change the appearance and space of certain controls.
Further reading:
EclipseCon 2014 talk: https://www.eclipsecon.org/na2014/sites/default/files/slides/Responsive%20Applications%20Tutorial%20-%20EclipseCon%202014.pdf
A blog post with code examples about responsive UIs with SWT: http://www.codeaffine.com/2014/02/24/responsive-uis-with-eclipse-and-swt/
RAP Theming: https://eclipse.org/rap/developers-guide/devguide.php?topic=theming.html
Understanding SWT Layouts: https://www.eclipse.org/articles/article.php?file=Article-Understanding-Layouts/index.html (ignore the deprecation warning, the core concepts haven't changed since)
You can make it responsive with the use of Passe-Partout created by Tabris. This works in RAP and should be compatible with RCP.
They have made a custom layout : FluidGridLayout.
It's best you use it through the factory class com.eclipsesource.tabris.passepartout.PassePartout.
Source can be found on github:
https://github.com/eclipsesource/tabris/tree/master/com.eclipsesource.tabris.passepartout
Add this plugin to your dependency or just copy the source in your project.
See the blogpost at eclipsesource for basic info:
https://eclipsesource.com/products/tabris/eclipse-rap-documentation/responsive-design/
The great thing about it, is that you program it all in java.
Only issue that I now experience is with scrolling.
In my case I have a workbench and my editorpart needs a scrolledcomposite, only set to V_SCROLL. I've added two resize listeners to set the new minsize of the scrolledcomposite.
One resize listener on the display when the entire browser resizes.
A second resize listener for the parent when only the editorpart resizes. (fe when a view is resized or the editorpart is maximized)
I'm developing an Eclipse plug-in, mostly as a learning exercise, in which I have a wizard page. In this wizard page I would like to have a small text area that behaves like a code editor with the appropriate content assist and information hovers etc, much like the breakpoint properties wizard has for adding conditions.
I'm new to plug-in development and I may not have quite picked up the vocabulary, so I'm not having much luck searching for examples. Can someone please point me in the right direction?
I assume that you are looking for an embeddable Java source editor - and with that you hit a difficult topic.
The source viewer mentioned by Chris Gerken is called JDISourceViewer. It is instantiated and configured in JavaBreakpointConditionEditor::createControl.
If you cannot find the mentioned classes, or if you want to experiment with them, then open the Plug-ins view, find the org.eclipse.jdt.debug.ui plug-in and select Import As > Source Project from the context menu.
Unfortunately - in the beginning - the (Java) editors weren't designed to be embedded outside of the editor area and many editor participants (e.g. actions, formatter, etc) still expect an IEditorPart. Hence it is a quirky and complicated endeavour to use an editor in a dialog or the like.
Moreover, the Java source editing infrastructure is not exposed as public API. It isn't meant to be used by clients and can change at any time without prior notice. You will see respective warnings in yoyur code. For a learning exercise, however, that shouldn't matter much.
I am using the Netbeans platform for a little project. Have a few questions... How do you create docked accessory views? Are all views TopComponents that have individual docking properties? How do you create a view to the left of the TopComponents that shows a hierarchy of data in a tree control? I have looked at the Window manager and TopComponents but nothing googles for Accessory view. I would like to create a master-detail application... I would like to create views that are automagically docked for the master relationship and use Topcomponents/Scenes for the detail views. Any words on how to do this?
Bruce
I think you are asking about modes. TopComponents are docked into modes.
NetBeans platform by default provides few modes like explorer, etc. NetBeans platform also allows you to define your own modes so you can dock your TopComponents at different places.
To create new modes see official documentation provided in the Windows System API.
See here.
I'm building a preferences editor for my Eclipse RCP application using the existing IWorkbenchPreferencePage framework (see http://www.eclipse.org/articles/Article-Field-Editors/field_editors.html for a good tutorial).
It has editors for a number of different types of data:
BooleanFieldEditor
IntegerFieldEditor
StringFieldEditor
RadioGroupFieldEditor
ColorFieldEditor
FontFieldEditor
DirectoryFieldEditor
FileFieldEditor
PathEditor
However, one thing which doesn't seem to exist is a nice DateFieldEditor (ideally with a button to bring up a calendar to allow choosing of a particular date).
So my question is, does such a org.eclipse.jface.preference.FieldEditor subclass exist, either in standard JFace or in a 3rd party plugin or project?
Alternatively, even a SWT calendar component would be useful, because I could build the rest on top of that pretty easily.
JFace doesn't have such a FieldEditor. But there is an official feature request for a DateFieldEditor that even has a basic implementation attached to it. At the very least you could use that as a template to create your own field editor, if it doesn't work for you as is.