snapToGrip not working [message #209495] |
Wed, 15 February 2006 11:28  |
Eclipse User |
|
|
|
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 #210398 is a reply to message #210257] |
Mon, 27 February 2006 09:44  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.06320 seconds