Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Three requests
Three requests [message #224592] Tue, 17 October 2006 09:47
Eclipse UserFriend
Originally posted by:

Three Requests (normal english, not GEF Vocab)

First Request,

A code snippet, which makes developers life easier.This is about a simple
tool which points out the underlying information.Can we have something
like this as part of GEF API?

About: A tool which highlights the details of figure and simplifies


copy these classes and import refered entities,

public class InspectionTool extends SelectionTool {

public void mouseDown(MouseEvent e, EditPartViewer viewer) {
super.mouseDown(e, viewer);

public void mouseHover(MouseEvent me, EditPartViewer viewer) {
super.mouseHover(me, viewer);

protected void updateHoverRequest() {

private void showInfoLog() {
EditPart epart = getTargetEditPart();
if (epart instanceof AbstractGraphicalEditPart) {
AbstractGraphicalEditPart gpart = (AbstractGraphicalEditPart) epart;
Object model = gpart.getModel();
IFigure figure = gpart.getFigure();
Rectangle rect = figure.getBounds();
String str =
model.toString()+"\n"+gpart.toString()+"\n"+figure.toString()+ "\n"+rect.toString();
gpart.getFigure().setToolTip(new Label(str));


public class InspectionToolEntry extends ToolEntry {

public InspectionToolEntry(String label, String shortDesc, ImageDescriptor
iconSmall, ImageDescriptor iconLarge) {
super(label, shortDesc, iconSmall, iconLarge,InspectionTool.class);

private InspectionToolEntry(String label, String description,
ImageDescriptor iconSmall, ImageDescriptor iconLarge, Class tool) {
super(label, description, iconSmall, iconLarge, tool);


While configuring palette of editor, add an entry in tool group

toolGroup.add(new CustomToolEntry( "Inspect Tool",
"Inspect Tool",

return toolGroup;

Second Request

GEF.debugXXX()is one of the more obscure entries in the whole of GEF API.
It is deprecated for unknown reasons. But as a developer it simplifies my
life than clutter my ErrorLog or Console with a whole lot of debug
statements. So if possible please retain that API.

Third Request

Is it possible to have a GEF best practices group?
Previous Topic:Change the look of the Cursor
Next Topic:thumbnail view not as Content outline view
Goto Forum:

Current Time: Sun Dec 05 17:17:19 GMT 2021

Powered by FUDForum. Page generated in 0.02097 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top