GithubHelp home page GithubHelp logo

oheger / jguiraffe Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 41.74 MB

JGuiraffe is an acronym, which stands for Java GUI, Resource, and Application Framework with Form Extensions. This is exactly what this framework is all about.

License: Apache License 2.0

Java 86.22% HTML 0.77% CSS 0.01% Scala 13.00%

jguiraffe's Introduction

JGUIraffe

JGUIraffe is a framework supporting the implementation of Java desktop applications using concepts like declarative UI definition, action and command objects, and dependency injection.

The project has moved from SourceForge and is now available here under GitHub.

Full documentation in form of the Maven-generated site is available at https://oheger.github.io/jguiraffe/index.html.

jguiraffe's People

Contributors

dependabot[bot] avatar oheger avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

jguiraffe's Issues

Swing-specific MessageOutput may be misused to display HTML content

Most Swing components can display HTML text. This is also true for JOptionPane used by SwingMessageOutput. Although not documented, if the message text passed to the output object is wrapped into HTML tags, these tags are interpreted. This can have unexpected effects and may even cause security issues. Therefore, an encoding should be performed preventing that HTML tags in a message text are interpreted.

Reported by: oheger

JavaFX tables containing only one row are sometimes not correctly updated

In TableFormController which is used behind the scenes, there is a cache for the data of the current row. This cache prevents that changes on the table model become effective.

For tables with multiple rows this is not a problem because the cache is reset when other rows are rendered. But for tables with only a single row, no reset happens. This has to be enforced manually by the table component handler.

Reported by: oheger

JavaFX does not allow customizing stage creation

Currently, the class responsible for the creation of stages (StageFactory) is private. An instance of this class is created by JavaFxWindowManager and stored in a private member field. There is no way to adapt the creation of stages.

As JavaFX offers a bunch of funtionality and effects that can be applied to stages, it would really be useful to have an extension point for stage creation.

Reported by: oheger

NullPointerException in JavaFxTreeHandler.getSelectedPaths for multi-selection trees

When changing the selection in tree views with multi-selection from time to time an exception like the one below is thrown. The cause seem to be a problem with the underlying JavaFX control that obviously temporarily has invalid indices in its selection list. This may also be related to the dynamic extension of the tree view when nodes are expanded.

It would be good to have a work-around, even if there are inconsistencies in JavaFX.

Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
at net.sf.jguiraffe.gui.platform.javafx.builder.components.tree.JavaFxTreeHandler$$anonfun$2.apply(JavaFxTreeHandler.scala:172)
at net.sf.jguiraffe.gui.platform.javafx.builder.components.tree.JavaFxTreeHandler$$anonfun$2.apply(JavaFxTreeHandler.scala:171)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
at scala.collection.Iterator$class.foreach(Iterator.scala:742)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1194)
at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:245)
at scala.collection.AbstractTraversable.map(Traversable.scala:104)
at net.sf.jguiraffe.gui.platform.javafx.builder.components.tree.JavaFxTreeHandler.getSelectedPaths(JavaFxTreeHandler.scala:171)
at de.oliver_heger.linedj.browser.media.SelectionChangeHandler.elementChanged(SelectionChangeHandler.scala:43)
at net.sf.jguiraffe.gui.builder.event.FormListenerType$2.callListener(FormListenerType.java:67)
at net.sf.jguiraffe.gui.builder.event.FormListenerType.callListeners(FormListenerType.java:176)
at net.sf.jguiraffe.gui.builder.event.FormEventManager.fireEvent(FormEventManager.java:395)
at net.sf.jguiraffe.gui.platform.javafx.builder.event.EventManagerSender.fire(EventManagerSender.scala:41)
at net.sf.jguiraffe.gui.platform.javafx.builder.event.ChangeEventAdapter.changed(ChangeEventAdapter.scala:67)
at com.sun.javafx.binding.ExpressionHelper$SingleChange.fireValueChangedEvent(Unknown Source)
at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(Unknown Source)
at javafx.beans.property.ObjectPropertyBase.fireValueChangedEvent(Unknown Source)
at javafx.beans.property.ObjectPropertyBase.markInvalid(Unknown Source)
at javafx.beans.property.ObjectPropertyBase.set(Unknown Source)
at net.sf.jguiraffe.gui.platform.javafx.builder.components.tree.JavaFxTreeHandler$$anon$2.changed(JavaFxTreeHandler.scala:390)
at net.sf.jguiraffe.gui.platform.javafx.builder.components.tree.JavaFxTreeHandler$$anon$2.changed(JavaFxTreeHandler.scala:386)
at com.sun.javafx.binding.ExpressionHelper$SingleChange.fireValueChangedEvent(Unknown Source)
at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(Unknown Source)
at javafx.beans.property.ReadOnlyObjectWrapper$ReadOnlyPropertyImpl.fireValueChangedEvent(Unknown Source)
at javafx.beans.property.ReadOnlyObjectWrapper.fireValueChangedEvent(Unknown Source)
at javafx.beans.property.ObjectPropertyBase.markInvalid(Unknown Source)
at javafx.beans.property.ObjectPropertyBase.set(Unknown Source)
at javafx.scene.control.SelectionModel.setSelectedItem(Unknown Source)
at javafx.scene.control.MultipleSelectionModelBase.lambda$new$34(Unknown Source)
at com.sun.javafx.binding.ExpressionHelper$SingleInvalidation.fireValueChangedEvent(Unknown Source)
at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(Unknown Source)
at javafx.beans.property.ReadOnlyIntegerWrapper$ReadOnlyPropertyImpl.fireValueChangedEvent(Unknown Source)
at javafx.beans.property.ReadOnlyIntegerWrapper.fireValueChangedEvent(Unknown Source)
at javafx.beans.property.IntegerPropertyBase.markInvalid(Unknown Source)
at javafx.beans.property.IntegerPropertyBase.set(Unknown Source)
at javafx.scene.control.SelectionModel.setSelectedIndex(Unknown Source)
at javafx.scene.control.MultipleSelectionModelBase.shiftSelection(Unknown Source)
at javafx.scene.control.TreeView$TreeViewBitSetSelectionModel.lambda$new$260(Unknown Source)
at javafx.event.WeakEventHandler.handle(Unknown Source)
at com.sun.javafx.event.CompositeEventHandler$WeakEventHandlerRecord.handleBubblingEvent(Unknown Source)
at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
at com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
at javafx.event.Event.fireEvent(Unknown Source)
at javafx.scene.control.TreeItem.fireEvent(Unknown Source)
at javafx.scene.control.TreeItem.access$200(Unknown Source)
at javafx.scene.control.TreeItem$4.invalidated(Unknown Source)
at javafx.beans.property.BooleanPropertyBase.markInvalid(Unknown Source)
at javafx.beans.property.BooleanPropertyBase.set(Unknown Source)
at javafx.beans.property.BooleanProperty.setValue(Unknown Source)
at javafx.scene.control.TreeItem.setExpanded(Unknown Source)
at com.sun.javafx.scene.control.behavior.TreeCellBehavior.handleDisclosureNode(Unknown Source)
at com.sun.javafx.scene.control.behavior.CellBehaviorBase.doSelect(Unknown Source)
at com.sun.javafx.scene.control.behavior.CellBehaviorBase.mousePressed(Unknown Source)
at com.sun.javafx.scene.control.skin.BehaviorSkinBase$1.handle(Unknown Source)
at com.sun.javafx.scene.control.skin.BehaviorSkinBase$1.handle(Unknown Source)
at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(Unknown Source)
at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(Unknown Source)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
at com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
at javafx.event.Event.fireEvent(Unknown Source)
at javafx.scene.Scene$MouseHandler.process(Unknown Source)
at javafx.scene.Scene$MouseHandler.access$1500(Unknown Source)
at javafx.scene.Scene.impl_processMouseEvent(Unknown Source)
at javafx.scene.Scene$ScenePeerListener.mouseEvent(Unknown Source)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$354(Unknown Source)
at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(Unknown Source)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(Unknown Source)
at com.sun.glass.ui.View.handleMouseEvent(Unknown Source)
at com.sun.glass.ui.View.notifyMouse(Unknown Source)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$148(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Reported by: oheger

Application shutdown handling is not consistent

If an application is closed directly by invoking the shutdown() method, the main window is not closed properly. So registered listeners do not receive a close notification, and clean-up tasks will not be executed.

Reported by: oheger

Make newly selected row in table visible

SwingTableComponentHandler allows selecting a row in the associated table. However, it does not scroll to this row. So for larger tables it is possible that the newly selected row is outside of the visible rectangle. In most cases, if the table selection is changed programmatically, it is desired that the newly selected row becomes visible.

Reported by: oheger

JavaFX windows do not support the closeable property

The tags to create windows support the closeable attribute which can be used to define whether the new window can be closed or not. This attribute is not evaluated by the JavaFX implementation; here windows can always be closed.

Reported by: oheger

A form cannot be validated (with displaying messages) without closing it


```It is sometimes useful to perform a form validation and giving the user feedback without closing the form. For instance, the form might have an *Apply* button which causes data to be saved; this action can only be performed if all input fields are valid, and the user should be notified if this is not the case. It would be good to have a dedicated method in `FormController` for this purpose.

Reported by: oheger

Make canShrink=true default for percent layout

PercentLayout supports the canShrink property which allows layouts to shrink below their preferred size. The default value of this property is false. However, this option is needed for most use cases. Therefore, it makes sense to change the default value to true.

Reported by: oheger

Add a tag to create beans from Jelly context variables

The form component tag library has the useBeanBase tag which provides the functionality to create beans from various sources. Something similar - in a restricted form - is also useful for the basic di library, which is only available for bean definition files.

The tag could be used to bridge between ways to populate the Jelly context and the bean contextx of the dependency injection framework.

Reported by: oheger

No word-wrapping support in Swing-specific MessageOutput implementation

SwingMessageOutput currently displays message texts that do not contain newline characters in a single line. For long texts the message dialog becomes wider. If the user's screen width is reached, parts of the text are not displayed.

An automatic (maybe configurable) line wrapping should be performed to avoid that the dialog becomes too wide or that the message cannot be fully read.

Reported by: oheger

Upgrade Scala version

So far, the JavaFX module uses Scala 2.12.x. This ticket is about upgrading it to the newest Scala 2.13 version.

Ideally, cross compilation should be enabled. This seems to be rather complicated with maven as build tool though. Therefore, as a first step, the version upgrade is made.

Behavior of MessageOutput not fully specified

The concrete behavior of MessageOutput implementations is not specified regarding the handling of newlines and word wrapping. For instance, the Swing-specific implementation accepts newline characters ('\n') as line breaks. Automatic line wrapping is not supported so that very long message texts may not be fully displayed on the user's screen.

The documentation of the MessageOutput interface should describe the characters causing a line break.

Reported by: oheger

The bean context of the main window cannot be accessed

When starting up the application the main window is constructed by processing the corresponding builder script. However, the BeanContext created for this script is not stored; so it cannot be accessed later on.

This context typically contains some interesting objects like the top-level actions defined for the main window. Therefore, it may be useful to have access to this information. This is also beneficial for tests that check functionality related to the main window.

Reported by: oheger

Builders can throw LocatorExceptions

If the Locator passed to a builder's build() methods throws an exception, it is propagated to the calling code. LocatorException is a runtime exception. This exception is not documented and therefore probably unexpected. The builder should catch this exception and re-throw it as a BuilderException.

Reported by: oheger

JavaFX labels cannot be assigned an icon

When defining a label in a builder script that has an embedded icon tag, the JavaFX implementation fails with an exception:

java.lang.ClassCastException: net.sf.jguiraffe.gui.platform.javafx.common.ImageWrapper cannot be cast to javafx.scene.image.ImageView

Reported by: oheger

Add support for JavaFX

Up to version 1.2, JGUIraffe supports only Swing as UI platform. As JavaFX is considered the successor of Swing, it should be supported as well.

Reported by: oheger

Add a transformer for StaticTextData

If a form contains some static text objects just to display data, it is useful to populate them from the form's model object. However, the ComponentHandler for static texts only accepts StaticTextData objects. It would be more convenient to pass data as plain text. Therefore a special Transformer could be added which handles the conversion.

Reported by: oheger

Creation of the main JavaFX Stage fails on Java 1.8

At the time the primary stage is created, the UI platform has not been fully initialized. So JGUIraffe applications currently do not run under Java 1.8. Obviously, JavaFX in Java 1.8 is stricter than the previous version.

Reported by: oheger

Some base classes not available under OSGi

Per default settings of the maven bundle plugin, packages containing impl in their name are not part of the package exports generated for the bundle. In the case of JGUIraffe core this excludes some packages which should be available to 3rd parties. For instance, implementation classes for resource manager and resource bundles are affected; they are useful for applications that need to provide custom resource handling.

Reported by: oheger

Editable combo boxes do not work correctly

Currently, the Swing implementation of a combo box handler expects that all values to be displayed by the combo box are also contained in the component's list model. This is not the case for editable combo boxes - here the user can enter arbitrary values. This causes an exception to be thrown.

Reported by: oheger

[Swing] Some controls do not support units of type DLU

When using the unit DLU together with some controls (e.g. tables, trees, text areas) the creation of the control fails. The reason is that in order to resolve the unit, the parent container must be available. However, at the time of resolving, this is currently not the case.

A possible fix is to defer the resolving to a later point in time.

Add a method to Application which forces a shutdown

So far, there is no way to prevent that an application listener prevents an application to shutdown. There may be use cases where this is important, for instance when an application has to shutdown gracefully because the JVM is stopping.

The functionality can be provided by adding an overloaded shutdown() method to Application with a boolean force parameter.

Reported by: oheger

Extract test manager implementations

For its own tests, JGUIraffe has test implementations for the central builder interfaces, such as ComponentManager or WindowManager. These implementations can be useful for applications based on JGUIraffe as well, e.g. to help creating unit tests that can run without actually creating UI elements. Therefore, these implementations should be extracted into a separate artifact.

JavaFX split panes do not support the dlu unit

When components are used within a splitter component that define properties in the dlu unit an exception is thrown:
Exception in thread "main" java.lang.IllegalArgumentException: Not a ContainerWrapper: SplitPane@77bc2e16[styleClass=split-pane]

Reported by: oheger

Make project buildable with a current JDK

After lying around for a while, the project cannot be built any more on a modern JDK > 1.8. With JDK 11, there are some test failures in the core module, and the JavaFX module does not compile, as JavaFX is no longer shipped with the JDK.
The current minimum JDK is 1.5, which is probably not even more available; JDK 11 does not support this source code level any more. Therefore, the minimum JDK requirement is going to be upgraded to 1.8.

Handling of Escape key in dialogs should be improved

The Swing implementation currently simply closes the dialog window when the Escape key is pressed. JavaFX does not support the Escape key at all.

Ideally, the Escape key should be connected to a dialog button. When it is pressed the button should be triggered, so that the dialog controller can execute the actions associated with this button.

Actions cannot be created in disabled state.

Actions created via a Jelly script are enabled by default. There is no way to manipulate the enabled state in the builder script. However, it is a frequent use case that an action can be enabled not before certain conditions are met, e.g. the user has entered data or created a selection.

Reported by: oheger

JavaFX tables do not honor multi-selection mode

When creating a table in a builder script with the <f:table> tag the multiSelection attribute can be specified. However, the JavaFX implementation does not evaluate this attribute; all tables currently support only single selection mode.

Reported by: oheger

Add support for file chooser dialogs

JGUIraffe currently does not expose the platform-specific dialogs for choosing files to open and save. This feature is needed by many applications and thus should be available.

JGUIraffe JavaFX cannot be built with Java 8

Currently, the dependency to JavaFX is declared as a system dependency which is the correct way for JDK 1.7. In 1.8 however, JavaFX is part of the JDK, and the dependency cannot be resolved.

Reported by: oheger

Support resolving of class path resources

When declaring beans using the dependency injection framework it can be necessary to initialize bean properties with the values of resolved class path resources, e.g. URLs of properties files etc. It makes sense to let the framework handle this kind of resolve operations because class loader handling can be tricky (especially in OSGi environments).

This support can be achieved by introducing a tag that resolves a resource name and stores the result in a Jelly variable. The variable can then be referenced when initializing a bean property or calling a constructor.

Reported by: oheger

Add OSGi support

Currently, the library is not compatible with OSGi. This ticket is about adding support for running JGUIraffe applications in an OSGi container. This includes
- addings OSGi meta information to the manifest
- dealing with class loader specifics which occur in an OSGi environment
- not calling System.exit() when the application terminates.

Reported by: oheger

The global bean context cannot be easily extended dynamically

It is sometimes necessary to create beans dynamically during application startup. It is currently not possible in an easy way to add such beans to the global context managed by the application. It would be good to offer a method which allows adding beans created manually by the application during startup.

Reported by: oheger

[JavaFX] Widget handler for group with radio buttons cannot be obtained

When trying to obtain the widget handler for a group of radio buttons an exception is thrown like the following one:

Exception in thread "JavaFX Application Thread" net.sf.jguiraffe.gui.builder.components.FormBuilderRuntimeException: Cannot create widget handler for javafx.scene.control.ToggleGroup@2555ccdc

A ToggleGroup is no control, and therefore a special widget handler implementation is needed. The failure occurs for instance when adding validation rules for a group of radio buttons. Here the group as a whole is manipulated when validation errors are detected.

NullPointerException when looking up a bean by class

In some constellations a lookup on the BeanContext created by a builder script for a bean class can cause a NullPointerException. This seems to be case if no form bean is available. In this case the ComponentBuilderData instance claims that it can contribute such a bean, but when asked for it returns null.

Reported by: oheger

Save user configuration only if necessary

When the corresponding flag in the application configuration is set the user configuration is always written on application shutdown. This should only be done if there are really changes.

Improve support for complex initializations with builders

The dependency injection framework already supports complex initializations of objects including constructor invocations, factory methods, and even whole initialization scripts. However, currently it is not possible to let a bean be created by a classic builder approach. This is a real drawback with fluent interfaces becoming more and more popular.

The goal is to provide DI builder constructs which correspond to Java code like the following example:

MyClass obj = new MyClass.Builder()
.withSomeProperty("someValue")
.withSomeOtherProperty("otherValue")
.create();

Reported by: oheger

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.