Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » feedback example
feedback example [message #201325] Mon, 31 October 2005 16:55 Go to next message
Eclipse UserFriend
Originally posted by: pbeagan.yahoo_dontspamme_.com

Where should I look to find and example of the following functionality:

(From the 3.1.1 docs)

'For this reason, there is an additional feedback request sent with the type
REQ_SELECTION_HOVER whenever the user pauses the mouse over an editpart.
Often an editpart will display a popup shell similar to a tooltip
displaying additional information about the part.'

I want to be able display tooltips just as described. Thanks!
Re: feedback example [message #201341 is a reply to message #201325] Mon, 31 October 2005 17:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: pbeagan.yahoo_dontspamme_.com

Specifically , I want to give the user a tooltip-like feedback when trying
to create a new child item on a parent. I added the following code to
LayoutEditPolicy, but nothing is displayed visually. Am I missing
something?

public void showTargetFeedback(Request request) {

IFigure figure;

if (!(request instanceof CreateRequest))
return;

if (request.getType()!=RequestConstants.REQ_CREATE)
return;

Object newObject = ((CreateRequest)request).getNewObject();

System.out.println("PropertyContainerEditPolicy.showTargetFeedback ");
figure = new RuleFeedbackFigure();
figure.setVisible(true);
getFeedbackLayer().add(figure);

}







Patrick wrote:

> Where should I look to find and example of the following functionality:
>
> (From the 3.1.1 docs)
>
> 'For this reason, there is an additional feedback request sent with the
> type REQ_SELECTION_HOVER whenever the user pauses the mouse over an
> editpart. Often an editpart will display a popup shell similar to a
> tooltip displaying additional information about the part.'
>
> I want to be able display tooltips just as described. Thanks!
Re: feedback example [message #201385 is a reply to message #201341] Mon, 31 October 2005 20:57 Go to previous message
venkataramana m is currently offline venkataramana mFriend
Messages: 86
Registered: July 2009
Member
Try installing a new policy for EditPolicy.SELECTION_FEEDBACK_ROLE,
let us say SelectionFeedbackEditPolicy on your desired EditParts.


installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new SelectionFeedbackEditPolicy());


public class SelectionFeedbackEditPolicy extends GraphicalEditPolicy 
{
	public void showTargetFeedback(Request request) 
	{
		/* TODO May be try creating a tooltip figure over here 
		on request-type REQ_SELECTION_HOVER */	
	}

	public void eraseTargetFeedback(Request request)
	{	
		/* TODO May be try destroying the tooltip figure created before on request-type REQ_SELECTION_HOVER */		
	}
} 



Thanks
Venkat
Previous Topic:Extending the Shapes Editor
Next Topic:Advice on a tab implementation in GEF/draw2d
Goto Forum:
  


Current Time: Thu Dec 05 13:02:22 GMT 2024

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

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

Back to the top