-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial PoC for pure GEF-based palette viewer
This implements the WindowBuilder palette using the native GEF implementation. While it implementation is functional, it is still missing functionality like theming and drag & drop, which is why the new palette has to be expiliclty enabled using the "wbp.gef.palette" system property.
- Loading branch information
Showing
6 changed files
with
151 additions
and
22 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
...ipse.wb.core.java/src/org/eclipse/wb/internal/core/editor/palette/DesignerEditDomain.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2025 Patrick Ziegler and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Patrick Ziegler - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.wb.internal.core.editor.palette; | ||
|
||
import org.eclipse.gef.EditDomain; | ||
import org.eclipse.gef.EditPartViewer; | ||
import org.eclipse.gef.Tool; | ||
import org.eclipse.gef.ui.palette.PaletteViewer; | ||
import org.eclipse.swt.SWT; | ||
import org.eclipse.swt.events.MouseEvent; | ||
|
||
/** | ||
* Custom edit domain used for the {@link PaletteViewer} that keeps track of | ||
* whether the CTRL key is pressed while creating a tool. If so, the tool | ||
* remains active after being used, allowing the user to add multiple elements | ||
* without having to re-select the entry every time. | ||
*/ | ||
public class DesignerEditDomain extends EditDomain { | ||
|
||
private boolean reload; | ||
|
||
@Override | ||
public void mouseUp(MouseEvent mouseEvent, EditPartViewer viewer) { | ||
Tool tool = getActiveTool(); | ||
if (tool != null) { | ||
try { | ||
reload = (mouseEvent.stateMask & SWT.CTRL) != 0; | ||
tool.mouseUp(mouseEvent, viewer); | ||
} finally { | ||
reload = false; | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* Returns {@code true}, when called from within the | ||
* {@link #mouseUp(MouseEvent, EditPartViewer)} method while the CTRL key is | ||
* pressed. | ||
*/ | ||
public boolean isReload() { | ||
return reload; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
= What's New - v1.18.0 | ||
= What's New - v1.19.0 | ||
|
||
* Fixed IndexOutOfBoundsException when removing widgets while using JDK8 | ||
* Dropped support for JSR296 (Swing Application Framework) | ||
* Removal of old amd64 binaries for Linux | ||
* Experimental GEF palette which can be enabled using the _wbp.gef.palette_ system property. | ||
For a full list of all changes, check the link:https://github.com/eclipse-windowbuilder/windowbuilder/milestone/10[1.18.0] milestone. | ||
For a full list of all changes, check the link:https://github.com/eclipse-windowbuilder/windowbuilder/milestone/11[1.19.0] milestone. | ||
|
||
What's new - link:v117.html[*v1.17.0*] | ||
What's new - link:v118.html[*v1.18.0*] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
= What's New - v1.18.0 | ||
|
||
* Fixed IndexOutOfBoundsException when removing widgets while using JDK8 | ||
* Dropped support for JSR296 (Swing Application Framework) | ||
* Removal of old amd64 binaries for Linux | ||
For a full list of all changes, check the link:https://github.com/eclipse-windowbuilder/windowbuilder/milestone/10[1.18.0] milestone. | ||
|
||
What's new - link:v117.html[*v1.17.0*] |