Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » snapToGrip not working
snapToGrip not working [message #209495] Wed, 15 February 2006 16:28 Go to next message
Eclipse UserFriend
Originally posted by: harsh.ti.com

All,

I am trying to enable the following actions...

//enable the ruler, snapTo, and grid properties
// Snap to Geometry property
viewer.setProperty(SnapToGeometry.PROPERTY_SNAP_ENABLED, false);

// Grid properties
viewer.setProperty(SnapToGrid.PROPERTY_GRID_ENABLED, false);

viewer.setProperty(RulerProvider.PROPERTY_RULER_VISIBILITY, false);

IAction showRulers = new ToggleRulerVisibilityAction(viewer);
getActionRegistry().registerAction(showRulers);

IAction snapAction = new ToggleSnapToGeometryAction(viewer);
getActionRegistry().registerAction(snapAction);

IAction showGrid = new ToggleGridAction(viewer);
getActionRegistry().registerAction(showGrid);

The problem is, it is registering them, however, when I try to use them
from my context-menu, they don't work and I get the following error...

Error 2006-02-15 11:27:01.236 The command
("org.eclipse.gef.toggle_snapto_geometry") is undefined
java.lang.Exception
at
org.eclipse.jface.action.ExternalActionManager$CommandCallba ck.isActive(ExternalActionManager.java:300)
at
org.eclipse.jface.action.ActionContributionItem.isCommandAct ive(ActionContributionItem.java:579)
at
org.eclipse.jface.action.ActionContributionItem.isVisible(Ac tionContributionItem.java:631)
at org.eclipse.jface.action.MenuManager.update(MenuManager.java :571)
at
org.eclipse.jface.action.MenuManager.handleAboutToShow(MenuM anager.java:373)
at org.eclipse.jface.action.MenuManager.access$0(MenuManager.ja va:369)
at org.eclipse.jface.action.MenuManager$2.menuShown(MenuManager .java:386)
at
org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:117)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:867)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:848)
at org.eclipse.swt.widgets.Control.WM_INITMENUPOPUP(Control.jav a:3337)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:3064 )
at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.j ava:1582)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:3706 )
at org.eclipse.swt.internal.win32.OS.TrackPopupMenu(Native Method)
at org.eclipse.swt.widgets.Menu._setVisible(Menu.java:225)
at org.eclipse.swt.widgets.Display.runPopups(Display.java:3106)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2707)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1699)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:367)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:143)
at com.ti.socrates.rcp.internal.Application.run(Application.jav a:45)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:226)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:376)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:163)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334 )
at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
at org.eclipse.core.launcher.Main.run(Main.java:973)
at org.eclipse.core.launcher.Main.main(Main.java:948)

With the grid, it shows it but it doesn't seem to work. The ruler is not
visible at all.

Any clues?

Thank you,
Harsh
Re: snapToGrip not working [message #209533 is a reply to message #209495] Wed, 15 February 2006 21:09 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: harsh.ti.com

All,

I really need help with this issue. My editor properties are basically
the same as the logic editor, yet snap to grip/ruler/grid work in that
editor but not mine. What could be the difference? I am using a
scrollinggraphicalviewer and a ScalableFreeformRootEditpart.

Thank you,
Harsh
Re: snapToGrip not working [message #209579 is a reply to message #209533] Thu, 16 February 2006 14:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: harsh.ti.com

All,
Sorry for bothering everyone but I an just scrathing my head here and
can't figure out why things are working. Now I have some more
information. Could it be a versioning issue?

What does the following warning mean?

Severity Description Resource In Folder Location Creation Time Id
1 Discouraged access: The type GEFMessages is not accessible due to
restriction on required library
D:\eclipse31\eclipse\plugins\org.eclipse.gef_3.1.1.jar EditorActionBarContributor.java com.ti.ccstudio.gadget/src/com/ti/ccstudio/gadget/editor line
73 February 15, 2006 8:56:21 PM 16476

Thank you,
Harsh
Re: snapToGrip not working [message #209943 is a reply to message #209495] Tue, 21 February 2006 13:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: a.hoess.bachmann.info

Hi,

I have exactly the same problem! Have you found a solution?

Greets,
Alexander
Re: snapToGrip not working [message #210005 is a reply to message #209943] Tue, 21 February 2006 19:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: harsh.ti.com

Nope. I am not sure if it's an issue with the newer versions of Eclipse.
It works in the logic example.
Re: snapToGrip not working [message #210021 is a reply to message #210005] Wed, 22 February 2006 01:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: harsh.ti.com

Another observation I noticed. Even with the logic example using the
latest Eclipse (or any eclipse greater than 3.1), when you contribute snap
to geometry, grid, and ruler actions to the workbench menu, they are
grayed out. Also, there is a warning discouraging the use of the
GEFMessages class. The actual warning is...

Discouraged access: The type GEFMessages is not accessible due to
restriction on required library
C:\eclipse\plugins\org.eclipse.gef_3.1.1.jar

Harsh
Re: snapToGrip not working [message #210075 is a reply to message #210021] Wed, 22 February 2006 11:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: a.hoess.bachmann.info

LogicExample 3.1.1 doesn't have the grid and ruler in the contextmenu. In
the workbench menu the actions are working for me. I think the problem
with grayed out actions is that they don't recognize that the editor is
activated. Adding RetargetActions in the method buildActions() in the
ActionbarContributor is also working for me.

I hope that someone from the gef developing team can help us with this.

Greets,
Alexander
Re: snapToGrip not working [message #210257 is a reply to message #209495] Thu, 23 February 2006 15:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: a.hoess.bachmann.info

Hi Harsh,

the only solution I found for this problem was defining the GEF action in
your plugin.xml! It works for me but I'm not really happy with this
solution as you can guess.

Thanks to the really good support from the GEF team! :-<

Alex
Re: snapToGrip not working [message #210398 is a reply to message #210257] Mon, 27 February 2006 14:44 Go to previous message
Eclipse UserFriend
Originally posted by: harsh.ti.com

Alex,

unfortunately, that didn't work for me either. I am getting instantiation
exceptions. Did you extend the actions or used the existing ones in GEF?
If you could share the action set snippet from you xml file, that would be
great so I can compare it with my xml file.

Thank you,
Harsh
Previous Topic:How do i add Alignment Actions etc. ?
Next Topic:Search connection under mouse
Goto Forum:
  


Current Time: Thu Apr 25 04:52:23 GMT 2024

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

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

Back to the top