-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make drawer and tool entry figures configurable via PaletteCustomizer
This adds the public interfaces IDrawerFigure and IToolEntryFigure, which are implemented by the figures created in the DrawerEditPart and ToolEntryEditPart, respectively. Those interfaces can be accessed with with configure methods in the PaletteCustomizers. Clients can use them to adjust the figures without having to re-implement the palette editpart-factory and without having to reference the internal classes.
- Loading branch information
Showing
8 changed files
with
229 additions
and
50 deletions.
There are no files selected for viewing
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
22 changes: 22 additions & 0 deletions
22
org.eclipse.gef/src/org/eclipse/gef/ui/palette/IColorPalette.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,22 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 Patrick Ziegler and others. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Patrick Ziegler - initial API and implementation | ||
*******************************************************************************/ | ||
|
||
package org.eclipse.gef.ui.palette; | ||
|
||
import org.eclipse.swt.graphics.Color; | ||
|
||
public interface IColorPalette { | ||
Color getSelectedColor(); | ||
|
||
Color getHoverColor(); | ||
} |
40 changes: 40 additions & 0 deletions
40
org.eclipse.gef/src/org/eclipse/gef/ui/palette/IDrawerFigure.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,40 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 Patrick Ziegler and others. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Patrick Ziegler - initial API and implementation | ||
*******************************************************************************/ | ||
|
||
package org.eclipse.gef.ui.palette; | ||
|
||
import org.eclipse.draw2d.Clickable; | ||
import org.eclipse.draw2d.IFigure; | ||
|
||
import org.eclipse.gef.internal.ui.palette.editparts.DrawerFigure; | ||
|
||
/** | ||
* Public interface of the {@link DrawerFigure}. | ||
* | ||
* @noimplement This interface is not intended to be implemented by clients. | ||
* @noextend This interface is not intended to be extended by clients. | ||
*/ | ||
public interface IDrawerFigure extends IFigure { | ||
void setGradientPainter(IGradientPainter painter); | ||
|
||
/** | ||
* @return The {@link Clickable} that is used to expand/collapse the drawer. | ||
*/ | ||
Clickable getCollapseToggle(); | ||
|
||
/** | ||
* @return The content pane for this figure, i.e. the Figure to which children | ||
* can be added. | ||
*/ | ||
IFigure getContentPane(); | ||
} |
36 changes: 36 additions & 0 deletions
36
org.eclipse.gef/src/org/eclipse/gef/ui/palette/IGradientPainter.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,36 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 Patrick Ziegler and others. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Patrick Ziegler - initial API and implementation | ||
*******************************************************************************/ | ||
|
||
package org.eclipse.gef.ui.palette; | ||
|
||
import org.eclipse.draw2d.Graphics; | ||
import org.eclipse.draw2d.geometry.Rectangle; | ||
|
||
import org.eclipse.gef.internal.ui.palette.editparts.DrawerFigure; | ||
|
||
/** | ||
* This interface can be used together with the {@link IDrawerFigure} and | ||
* {@link PaletteCustomizer}, to adapt the the background painted in a | ||
* {@link DrawerFigure}. | ||
* | ||
* @since 3.20 | ||
*/ | ||
public interface IGradientPainter { | ||
/** | ||
* Paints the background gradient on the drawer toggle figure. | ||
* | ||
* @param g the graphics object | ||
* @param rect the rectangle which the background gradient should cover | ||
*/ | ||
void paint(Graphics g, Rectangle rect); | ||
} |
Oops, something went wrong.