Git Product home page Git Product logo

nebula's Introduction

Nebula and Opal: Rich SWT Widgets

Welcome to the Eclipse Nebula project.

This repositority contains a large set of UI elements that can be used in fat or thin client applications based on Java and SWT.

Download

Downloads are available at the following location:

These sites provide both mature, stable widgets as well as incubating widgets; the latter are clearly marked as incubating and may break API from release to release.

Refer to the general document for details about the update site structure.

Contact

Contribute

We can accept your patches if you have properly set up an account.

For every patch we require a corresponding GitHub issue. See the recommended workflow for guidelines.

Setup a Development enviroment

Please use the following automated setup to configure a development environment pull requests:

Create Eclipse Development Environment for Eclipse Nebula

Building on our build server

After admin approval, pull requests get built by this job:

Building locally

git clone https://github.com/eclipse/nebula.git
mvn verify

More info can be found on Nebula's Build Server.

New Committers

Before you decide to contribute your code to Eclipse, keep in mind that your code must follow the EPL, Eclipse's Public License.
This means that committers and contributors need to follow some rules.

A good overview of what this entails and how this affects you can be read here

There are a number of ways you can contribute.

  • A new project inside Nebula.
  • New widgets in the Nebula project.
  • Maintain existing widgets.

If you choose any of these option contact the Nebula developers through the mailing list and state your intentions, or open an issue.

New Widgets

The 'New Widget' process is described here:

https://wiki.eclipse.org/Nebula/Contributions/New_Widgets

nebula's People

Contributors

angelozerr avatar belkassaby avatar cantupolo avatar caosmp avatar cbrun avatar dariusz-michura avatar dondunne avatar edward-k-francis avatar fipro78 avatar gion86 avatar greenrover avatar hallvard avatar hanneswell avatar jfaltermeier avatar jonahgraham avatar laeubi avatar lcaron avatar lhjohnjanus avatar merks avatar mickaelistria avatar mpscholz avatar peterc-dls avatar pontesegger avatar rheydenr avatar tomsontom avatar uyong avatar vogella avatar wimjongman avatar xihui avatar ziogianni avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nebula's Issues

SvgLoader does not handle relative points correctly for Bézier commands

According to the specification all points within a relative Bézier command (e.g. 'c','s','q','t'), are all relative to the current point.

When a relative c or s command is used, each of the relative coordinate pairs is computed as for those in an m command. For example, the final control point of the curve of both commands is (cpx + x cos cb + y sin cb, cpy + x sin cb + y cos cb). [Where cpx and cpy represent the coordinates of the current point,and cb represents the current bearing.]

Currently the code makes each point of the Bézier command relative to the last two values added including those from the current command.

CDateTime NullPointerException when setting foreground color

When I try to set the foreground color of a CDateTime widget, I get a NullPointerException. The Exception is thrown at following point in the CDateTime class:

public void setForeground(Color color) { super.setForeground(color); picker.updateColorsAndFont(); }
The CDateTime widget is instantiated as follows:

CDateTime dateTime = new CDateTime(composite, fieldIdentifier.styles()); dateTime.setLayoutData(fieldIdentifier.gridData()); dateTime.setNullText(""); //$NON-NLS-1$
and fieldIdentifier.styles() is CDT.BORDER | CDT.DROP_DOWN | CDT.DATE_MEDIUM | CDT.TIME_SHORT

The code tries to update the color of the picker widget. This widget is null. Maybe I am doing something wrong? What if so?

GeoMap - Thread Safety

The Map Cache is backed by a LinkedHashMap which is neither thread safe, or accessed in a synchronised way. I haven't seen this cause a specific problem, but it would seem likely that there is some effect of this.

PrintPreview display blank page

I have an issue with the PrintPreview. On one specific computer, the preview is always blank. I've tried to run the Snippet7 and Snippet3 and the preview is always blank. Trying the same snippet on another computer is working perfectly fine.

Was this problem ever reported and how to debug / fix this problem.

I'm using v2.1.0.202011020719, on windows.

Screenshot from 2021-03-31 10-49-15

Take note, Snippet2 that uses PrintViewer is working fine.

GeoMap - Concurrency Issues

If you set the map cache size to a low value (e.g. 0, 1, 5 etc), the map tiles do not load.

If you add a Thread.sleep to the paintTile method, they then work again.

This suggests that it's not the cache size that's the problem, but some kind of race condition where if something happens too quickly, it breaks. My suspicion is that it's drawing the picture before the image has actually loaded.

Disabled TableCombo does not looks "disabled" enought

If one disables a TableCombo the arrow is grayed out, but the border + text background remains the same and the text stays black.

It would be better for the user if the control is more visually "disabled", eg using SWT.COLOR_WIDGET_DISABLED_FOREGROUND, a different border color and so on.

Invalid NPE check in SWTGraphicUtil.getBoundsOfMonitorOnWhichShellIsDisplayed(Shell)

The shell is accessed in the first line, after that it is checked for null what will never be true as NPE will occur in the first line already.

        /**
	 * @param shell
	 * @return the bounds of the monitor on which the shell is running
	 */
	public static Rectangle getBoundsOfMonitorOnWhichShellIsDisplayed(final Shell shell) {
		Monitor monitor = shell.getDisplay().getPrimaryMonitor();
		if(shell != null && shell.getMonitor() != null) {
			monitor = shell.getMonitor();
		} 
		
		return monitor.getBounds();
	}

proposed change

	public static Rectangle getBoundsOfMonitorOnWhichShellIsDisplayed(final Shell shell) {
		Objects.requireNonNull(shell, "Shell can't be null");
		Monitor monitor = shell.getMonitor();
		if (monitor == null) {
			monitor = shell.getDisplay().getPrimaryMonitor();
		}
		return monitor.getBounds();
	}

Support multiple columns for TableCombo text

Currently one needs to select one column that is responsible for display the text.
It would be good to have an alternative so the user has more control, I can think about the following things:

  1. Support setting a Function<Object, String>, ToIntFunction to perform conversion Object>String and int>String
  2. Allow to set the column to -1 that results in simply concatenate all column text with a pipe ( C1 | C2 | C3) as a result.

Widget org.eclipse.nebula.widgets.passwordrevealer.PasswordRevealer is not supported for Eclipse databinding

Trying to bind the PasswordRevealer to a data model will result in a 'not supported' error.

Example code

import org.eclipse.core.databinding.Binding;
import org.eclipse.core.databinding.beans.typed.BeanProperties;
import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.jface.databinding.swt.typed.WidgetProperties;
import org.eclipse.nebula.widgets.passwordrevealer.PasswordRevealer;

final PasswordRevealer revealer = new PasswordRevealer(shell, SWT.NONE);

final IObservableValue<Object> passwordModel = BeanProperties.value(CredentialModel.class,CredentialModel.PROP_PASSWORD).observe(model.getUser());
final IObservableValue<String> targetPassword = WidgetProperties.text(SWT.Modify).observe(revealer);

new DataBindingContext().bindValue(targetPassword, passwordModel);

Will result in error

java.lang.NoSuchMethodException: org.eclipse.nebula.widgets.passwordrevealer.PasswordRevealer.addPropertyChangeListener(java.beans.PropertyChangeListener)
         at java.lang.Class.getMethod(Class.java:1786)
         ... 

 
Widget [org.eclipse.nebula.widgets.passwordrevealer.PasswordRevealer] is not supported.
         at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:170)
         at org.eclipse.core.commands.Command.executeWithChecks(Command.java:488)
         at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:487)
         at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:213)
         at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.executeItem(HandledContributionItem.java:438)
         at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.handleWidgetSelection(AbstractContributionItem.java:449)
         at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.lambda$2(AbstractContributionItem.java:475)
         at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
         at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4213)
         at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1037)
         at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4030)
         at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3630)
         at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1158)
         at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
         at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1047)
         at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
         at org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:166)
         at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
         at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
         at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
         at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
         at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
         at java.lang.reflect.Method.invoke(Method.java:498)
         at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:657)
         at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594)
         at org.eclipse.equinox.launcher.Main.run(Main.java:1447)
         at org.eclipse.equinox.launcher.Main.main(Main.java:1420)

Caused by: org.eclipse.e4.core.di.InjectionException: java.lang.IllegalArgumentException: Widget [org.eclipse.nebula.widgets.passwordrevealer.PasswordRevealer] is not supported.
         at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:68)
         at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:319)
         at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:253)
         at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:173)
         at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:156)
         ... 29 more

Caused by: java.lang.IllegalArgumentException: Widget [org.eclipse.nebula.widgets.passwordrevealer.PasswordRevealer] is not supported.

Solution

  1. Please make this widget compatible to bind like a normal Text widget OR
  2. Give directions/example code how to create a data binding between this widget and a data model

TextAssist widget is not useable

Hi

The popup window appears fleetingly and is quickly closed.
I tried the provided snippet. The same result is observed.

Environment: Linux, GTK3.

Make the text widget gray when the multichoice is not editable

Our users are trying to type in the text field but its not writable while the text color is white so its a bit confusing. It would be nice when the multichoice is read-only to make the text also gray just like when you use the setEditable method to false on a text or combo widget.

Supply a DualListViewer

The topic alread describe it....

Currently DualList is very basic and requires one to create very special objects (DLItem) to be used. It would be better to see a DualList as a StructuredViewer with

  1. a ContentProvider (like ListViewer)
  2. a label provider for colors/fonts/icons and so on
  3. a "selection" that represent the currently selected items "on the right"
  4. a "selection" that represents the currently selected items "on the left"

A user than might add selectionchangedlisteners for any of the both lists of items

There is a large zoom gap betwwen hours and minutes in GanttChart

In the GanttChart widget, there is a large gap between ZOOM_HOUR_MAX (value 0) and ZOOM_MINUTES_NORMAL (value -1). On my screen, it goes from a width of about 11 hours to 10 minutes. Making impossible to correctly focus on data spanning e.g. 1 hours.

Looking at the code in GanttComposite.updateZoomLevel(), we see that the "day" width is reduced, but what a "day" represent is also changed (hour -> minute), thus creating the gap.

Grid inside Scrollable Composite draws outside its bounds on Linux GTK

When a Grid is placed inside of a ScrollableComposite, then the grid contents are sometimes rendered outside of the area of the scrollable. This is most noticeable on the initial creation, and when resizing the entire window. Scrolling the grid stays within the bounds, but leaves a mess outside of the scrollable.

ScrollableGridTest-issue --- should be --> ScrollableGridTest-with-fix

Test code that demonstrates this: ScrollableGridTest.java.txt

Discovered on Linux with GTK (Ubuntu 20.04), and yet not a problem on Windows. This used to be fine on older SWT/GTK (Eclipse 3.8) and issue has surfaced since moving to a newer platform (i.e. Eclipse 4.1x). Perhaps something changed within GTK 3?

I think this may be due to the calls to gc.setClipping() in onPaint() before calling the paint() method of the cell renderer, as these are ignoring the clipping from the paint event.

I was able to fix it by saving the original clipping at the top of the function, and then replacing gc.setClipping(new Rectangle(...)) with gc.setClipping(originalClipping.intersection(new Rectangle(...))). This ensures that the clipping is never set to be outside that of the paint event. See Grid.diff.txt. Might need to do something with insertMarkPosFound block too.

PasswordRevealer Option to show pw after mouse click without holding the mouse

AFAICS the PasswordRevealer shows only the PW if the user continues to hold the mouse button. I think most websites react differently. If you select "Show password" it shows the PW until the user selects this option again.

Can this also be provided by PasswordRevealer? Maybe even as default as I think this is what the user expects (I might be wrong here).

Preference Window opens on wrong screen

I think it is better if the preference window opens on the same screen as the running application. Currently it seems to use the laptop (I guess the primary screen) and not the screen on which my application is running.

Looks like this is done in SWTGraphicUtil in PreferenceWindow#openShell

Error with openjdk 11.0.8

Added only this line after the main view creation:

Dialog.inform("Loading", "Test");

This is the error:

Exception in thread "main" java.lang.NoSuchMethodError: 'void org.eclipse.nebula.widgets.opal.commons.SWTGraphicUtil.addDisposer(org.eclipse.swt.widgets.Widget, org.eclipse.swt.graphics.Resource)'
	at org.eclipse.nebula.widgets.opal.dialog.DialogArea.getTitleColor(DialogArea.java:105)
	at org.eclipse.nebula.widgets.opal.dialog.MessageArea.createTitle(MessageArea.java:286)
	at org.eclipse.nebula.widgets.opal.dialog.MessageArea.render(MessageArea.java:219)
	at org.eclipse.nebula.widgets.opal.dialog.Dialog.show(Dialog.java:111)
	at org.eclipse.nebula.widgets.opal.dialog.Dialog.inform(Dialog.java:297)
	at org.eclipse.nebula.widgets.opal.dialog.Dialog.inform(Dialog.java:286)
	at net.VisualDivX.Controller.Controller.<init>(Controller.java:30)

I've only created the main Display and Shell. Afterwards, I get this error message. With java 8 was working fine, but I need java 11. 
My java version is  AdoptOpenJDK 11.0.8. Have you tested with java 8+ and above?

Requirement for Split Button with Toggle Behaviour

A Split Button is a Push Button that also contains a drop-down menu.

The drop-down menu typically contains modifiers for how the push button action is performed. In this example the UI allows the user to change what kind of search is performed:

image

Sadly in the JFace Action implementation, SWT.CHECK and SWT.DROP_DOWN are mutually exclusive:

	/**
	 * Creates a new action with the given text and style.
	 *
	 * @param text
	 *            the action's text, or <code>null</code> if there is no text
	 * @param style
	 *            one of <code>AS_PUSH_BUTTON</code>,
	 *            <code>AS_CHECK_BOX</code>, <code>AS_DROP_DOWN_MENU</code>,
	 *            <code>AS_RADIO_BUTTON</code>, and
	 *            <code>AS_UNSPECIFIED</code>.
	 */
	protected Action(String text, int style) {
		this(text);
		switch (style) {
		case AS_PUSH_BUTTON:
			value = VAL_PUSH_BTN;
			break;
		case AS_CHECK_BOX:
			value = VAL_TOGGLE_BTN_OFF;
			break;
		case AS_DROP_DOWN_MENU:
			value = VAL_DROP_DOWN_MENU;
			break;
		case AS_RADIO_BUTTON:
			value = VAL_RADIO_BTN_OFF;
			break;
		}
	}

On first impression it looks like a new version of JFAce Action is required, though maybe there's another strategy.

Bug 567735 - SvgLoader's parsePathData does not handle multi-valued commands

According to the SVG specification (https://svgwg.org/specs/paths/#PathData), the path data for all commands could have multiple values. For example, when drawing a line:

Draw a line from the current point to the given (x,y) coordinate which becomes the new current point. L (uppercase) indicates that absolute coordinates will follow; l (lowercase) indicates that relative coordinates will follow. A number of coordinates pairs may be specified to draw a polyline. At the end of the command, the new current point is set to the final set of coordinates provided.

The current method ignores any additional coordinate pairs. The multi-values are applicable to all commands except 'Z' ('z') and 'A' ('a'). 'M' ('m") is a special case and any additional coordinate pairs should be treated as 'L' ('l').

GeoMap - Zoom listener fired before MapPosition has been updated

In GeoMapUtil.zoomOut, geoMap.setZoom is called, which updates the zoom level and then calls fireZoomChanged(), which causes the listeners to respond to a change in the zoom.

The problem is that the map position is only updated in GeoMapUtil.zoomOut after the geoMap.setZoom call - which means any listeners responding to the zoom change will be using an outdated map position.

I think in zoomIn & zoomOut the statements should simply be switched in order.

Inverted selection behaviour of SwitchButton

The description on the example page says:

A switch button is a different graphic representation of a checkbox button.

but one need to call SwitchButton.setSelection(true) to have a button that is off... that's not very intuitive and the opposite what a checkbox behaves...

Create Floating Text Widget

Create a Floating Text widget which is common in mobile applications.

Instances of this class are selectable user interface objects that allow the
user to enter and modify text with a label floating above the input area.
FloatingText controls can be either single or multi-line. In contrast to a
Text widget, when a floating text control is created with a border, a custom
drawn inset will be painted INSTEAD OF the platform specific inset.

Styles are inherited from Text and subclasses:

CENTER, ICON_CANCEL, ICON_SEARCH, LEFT, MULTI, PASSWORD, SEARCH, SINGLE,
RIGHT, READ_ONLY, WRAP, BORDER, H_SCROLL, V_SCROLL, LEFT_TO_RIGT,
RIGHT_TO_LEFT, FLIP_TEXT_DIRECTION

RichTextPainter calculates wrong height

The problem has already been described here:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=541345

I will copy the discussion in here anyway:

Tommy Redel

Hello,

when I use a list followed by text in a RichTextCellPainter the resulting calculated preferred row height is wrong.

The cleaned HTML in the RichTextPainter looks as follows:
<root><ul><li>Line1</li></ul>Test</root>

In the paintHTML method of the RichTextPainter this will result in just a single line. So the LinePainter will just be asked once assuming there is just one single line.

When the content is painted, everything looks fine. So the list with the single item gets its own line and the Text "Test" gets a second line.

So this is just a problem when caluclating the preferred row height.

Greetings
Tommy


Dirk Fauth

I just noticed that the issue is not in NatTable, it is in the RichTextPainter of the Nebula project.

You need to create an issue with the Nebula project. As the Nebula project has moved to GitHub, you should create an issue there and provide a pull request to fix this.

https://github.com/eclipse/nebula

IMHO the issue is that on handling the end tag of the unordered list, the currentLine variable is not set to null. Therefore the the calculation takes the following characters as part of the last line of the list.

By adding the following lines at the end of the case block (line 392) the issue should be fixed.

// set currentLine to null as any further content will start on a new line
currentLine = null;

I will close the ticket here as WONTFIX, as it is not NatTable and Nebula now uses GitHub issues for bug tracking. You can copy my answer there and provide a pull request to fix this. Hopefully this does not brake anything else. But in theory this should be the correct handling. In HTML there will be always a new line if something comes after a list end tag.

Grid.onPaint is ineffient on large grids (> 30.000 columns)

I encounter a large performance penalty when using a large Grid but only a small portion is visible.

From a quick debugging it seems (I was not able to profile it or try different strategies) that the Grid is computing a lot of values unnecessarily, for example the following code:

for (final GridColumn column : displayOrderedColumns) {

	if (column.isVisible()) {
		emptyCellRenderer.setBounds(x, y, column.getWidth(), getItemHeight());
		emptyCellRenderer.setColumn(indexOf(column));
		emptyCellRenderer.paint(e.gc, this);

		x += column.getWidth();
	}
}

if (x < getClientArea().width) {
	emptyCellRenderer.setBounds(x, y, getClientArea().width - x + 1, getItemHeight());
	emptyCellRenderer.setColumn(getColumnCount());
	emptyCellRenderer.paint(e.gc, this);
}

x = 0;

As one can see if the (final) value is higher than the bounds it is discarded so it seems suitable to break the previous loop if the limit is reached. I also noticed that column.isVisible() always calls "checkWidget" it might be good to have package private methods to bypass those checks to prevent additional efforts.

I'd like to know: Is there any "performance" tests that show on how large datasets a Grid could/should be used? Are there already any actions to make it more performant?

Notifier widget leaks one image per instance

For every Notifier instance there's one Image created (in line 211) which isn't disposed.
image leak in notifier widget

To verify, import the org.eclipse.swt.tools.spies project and add the following lines to the NotifierSnippet:

public static void main(final String[] args) {
  DeviceData data = new DeviceData();
  data.tracking = true;
  final Display display = new Display(data);
  Sleak sleak = new Sleak();
  Shell sleakShell = new Shell();
...

TextAssist Arithmetic Exception

If you press the arrow key down without entering anything beforehand, Java throws an ArithmeticException. If you type something in and then delete it again, Java won't throw the exception.

Bildschirmfoto 2021-04-01 um 13 16 45

java.lang.ArithmeticException: / by zero
at org.eclipse.nebula.widgets.opal.textassist.TextAssist$1.handleEvent(TextAssist.java:163)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4441)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1512)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1535)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1520)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1549)
at org.eclipse.swt.widgets.Text.sendKeyEvent(Text.java:1765)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1545)
at org.eclipse.swt.widgets.Text.sendKeyEvent(Text.java:1730)
at org.eclipse.swt.widgets.Control.doCommandBySelector(Control.java:1085)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:6251)
at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:235)
at org.eclipse.swt.widgets.Widget.superKeyDown(Widget.java:1960)
at org.eclipse.swt.widgets.Widget.keyDown(Widget.java:1130)
at org.eclipse.swt.widgets.Control.keyDown(Control.java:2457)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:6083)
at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:235)
at org.eclipse.swt.widgets.Widget.windowSendEvent(Widget.java:2150)
at org.eclipse.swt.widgets.Shell.windowSendEvent(Shell.java:2487)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:6203)
at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
at org.eclipse.swt.widgets.Display.applicationSendEvent(Display.java:5442)
at org.eclipse.swt.widgets.Display.applicationProc(Display.java:5585)
at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
at org.eclipse.swt.internal.cocoa.NSApplication.sendEvent(NSApplication.java:117)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3834)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1157)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:168)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
at org.eclipse.equinox.launcher.Main.run(Main.java:1461)
at org.eclipse.equinox.launcher.Main.main(Main.java:1434)

Our TextAssistContentProvider looks like this:

        TextAssistContentProvider contentProvider = new TextAssistContentProvider() {

		@Override
		public List<String> getContent(String entry) {
			ArrayList<String> result = new ArrayList<>();
			Instant date = DateUtil.getDate(entry, locale);
			if (date == null && !entry.isEmpty()) {
				result.add("!Error converting");
			} else {
				LocalDate localDate = LocalDate.ofInstant(date, ZoneId.of("UTC"));
				result.add(localDate.format(DateTimeFormatter.ofLocalizedDate(FormatStyle.MEDIUM).withLocale(locale)));
				field.setValue(new Value(date), true);
			}
			return result;
		}

	};

PreferenceWindow flickers if opened

The SWTGraphicUtil.centerShell(shell); centeres the shell, after opening it hence a smaller flickering is seen.
Maybe center it before opening i?

In PreferenceWindow.java:

 * Open the shell
 */
private void openShell() {
	shell.pack();
	shell.open();
	SWTGraphicUtil.centerShell(shell);

	while (!shell.isDisposed()) {
		if (!shell.getDisplay().readAndDispatch()) {
			shell.getDisplay().sleep();
		}
	}

}

/**

PromptSupport might loose style

When the user adds a prompt support to a text widget, the prompt support retrieves the style (colors and font) from the widget but does not keep track of intermediate changes to the text widget regarding this style (color and font).

This might result in problems when the user changes the style after prompt support was added to the widget. e.g. the original styles might be disposed.

PasswordRevealer cannot be used as drop-in replacement for Text widgets

I tried using PasswordRevealer as drop-in replacement for a text field but it seems to have confuse the layout:

Original:
Text password = new Text(container, SWT.BORDER | SWT.PASSWORD);
Text password.setLayoutData(GridDataFactory.fillDefaults().hint(130, SWT.DEFAULT).span(2, 1).create());.

label

After changing the code:

PasswordRevealer password = new PasswordRevealer(parent, SWT.BORDER);
password.setLayoutData(GridDataFactory.fillDefaults().hint(130, SWT.DEFAULT).span(2, 1).create());

password

Maybe it modifies the layout on the parent?

org.eclipse.nebula.widgets.opal.dialog.Dialog.center() should fall back to provided shell

org.eclipse.nebula.widgets.opal.dialog.Dialog.center() has the following code

		if (centerPolicy == CenterOption.CENTER_ON_SCREEN || shell.getParent() == null) {
			Shell activeShell = shell.getDisplay().getActiveShell();
			final Rectangle monitorBounds = SWTGraphicUtil.getBoundsOfMonitorOnWhichShellIsDisplayed(activeShell);

This will fail if there is no active shell (e.g. application does not has focus). If there is no actie shell, it would be the best to use the dialog shell...

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.