2010-11-18 4 views
1

커밋 시트에 커스텀 커맨드를 추가하고 싶습니다. 플러그 - 인 매니페스트 에디터로 plugin.xml을 열 때를 ​​제외하고는 잘 동작합니다. 에러가 있습니다.이클립스에서 치트 시트에 커스텀 커맨드를 추가하는 법

1 : plugin.xml에 사용자 지정 명령을 정의

는 여기에 내가 기능을 구현하는 데 사용되는 단계입니다.

<extension point="org.eclipse.ui.commands"> <category id="com.ting.commands.category" name="Custom Category"> </category> <command categoryId="com.ting.commands.category" defaultHandler="com.ting.commands.ExampleCommandHandler" description="Example Command" id="com.ting.commands.exampleCommand" name="Custom commands"> </command> 

2

: 대조표 항목을 속이 명령을 추가합니다.

<item 
     title="Example cheat sheet item"> 
    <description> 
    Example item description 
    </description> 
    <command 
     required="false" 
     serialization="com.ting.commands.exampleCommand"/> 
</item> 

오류 메시지 :

Message : Failed to deserialize command: com.ting.commands.ExampleCommandHandler 

예외 스택 추적 :

org.eclipse.core.commands.common.NotDefinedException: Cannot get the parameters from an undefined command. com.ting.commands.ExampleCommandHandler 
    at org.eclipse.core.commands.Command.getParameters(Command.java:759) 
    at org.eclipse.core.commands.CommandManager.deserialize(CommandManager.java:464) 
    at org.eclipse.ui.internal.commands.CommandService.deserialize(CommandService.java:112) 
    at org.eclipse.pde.internal.ua.ui.editor.cheatsheet.simple.details.SimpleCSCommandDetails.getParameterizedCommand(SimpleCSCommandDetails.java:447) 
    at org.eclipse.pde.internal.ua.ui.editor.cheatsheet.simple.details.SimpleCSCommandDetails.getParameterizedCommand(SimpleCSCommandDetails.java:469) 
    at org.eclipse.pde.internal.ua.ui.editor.cheatsheet.simple.details.SimpleCSCommandDetails.updateFields(SimpleCSCommandDetails.java:286) 
    at org.eclipse.pde.internal.ua.ui.editor.cheatsheet.simple.details.SimpleCSItemDetails.updateFields(SimpleCSItemDetails.java:277) 
    at org.eclipse.pde.internal.ua.ui.editor.cheatsheet.simple.details.SimpleCSItemDetails.selectionChanged(SimpleCSItemDetails.java:368) 
    at org.eclipse.ui.forms.DetailsPart$1.run(DetailsPart.java:274) 
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) 
    at org.eclipse.ui.forms.DetailsPart.showPage(DetailsPart.java:261) 
    at org.eclipse.ui.forms.DetailsPart.update(DetailsPart.java:234) 
    at org.eclipse.ui.forms.DetailsPart.selectionChanged(DetailsPart.java:219) 
    at org.eclipse.ui.forms.ManagedForm.fireSelectionChanged(ManagedForm.java:148) 
    at org.eclipse.pde.internal.ui.editor.TreeSection$PartAdapter.selectionChanged(TreeSection.java:32) 
    at org.eclipse.pde.internal.ui.parts.TreePart$1.selectionChanged(TreePart.java:45) 
    at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:162) 
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) 
    at org.eclipse.core.runtime.Platform.run(Platform.java:888) 
    at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48) 
    at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175) 
    at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:160) 
    at org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:2132) 
    at org.eclipse.jface.viewers.StructuredViewer.setSelection(StructuredViewer.java:1669) 
    at org.eclipse.jface.viewers.TreeViewer.setSelection(TreeViewer.java:1124) 
    at org.eclipse.pde.internal.ua.ui.editor.cheatsheet.simple.SimpleCSMasterTreeSection.setFormInput(SimpleCSMasterTreeSection.java:1233) 
    at org.eclipse.pde.internal.ua.ui.editor.cheatsheet.simple.SimpleCSDefinitionPage.setActive(SimpleCSDefinitionPage.java:207) 
    at org.eclipse.ui.forms.editor.FormEditor.pageChange(FormEditor.java:480) 
    at org.eclipse.pde.internal.ui.editor.PDEFormEditor.pageChange(PDEFormEditor.java:262) 
    at org.eclipse.ui.part.MultiPageEditorPart$2.widgetSelected(MultiPageEditorPart.java:291) 
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228) 
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) 
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1176) 
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1200) 
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1185) 
    at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1025) 
    at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:3256) 
    at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:2045) 
    at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:323) 
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) 
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1176) 
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3493) 
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3112) 
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405) 
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369) 
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221) 
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500) 
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) 
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493) 
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) 
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113) 
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194) 
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) 
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) 
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368) 
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
    at java.lang.reflect.Method.invoke(Method.java:592) 
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559) 
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514) 
    at org.eclipse.equinox.launcher.Main.run(Main.java:1311) 
    at org.eclipse.equinox.launcher.Main.main(Main.java:1287) 
+0

예를 들어 올바른 명령 직렬화를 지정 했습니까? 오류 메시지에서 직렬화를 위해'com.ting.commands.exampleCommand'가 아닌'com.ting.commands.ExampleCommandHandler'를 지정한 것처럼 보입니다. –

답변

0

나는 (? 시트 치트) 편집기 명령을 찾을 수없는 가정 정의하는 플러그인 때문에 귀하의 타겟 플랫폼의 일부가 아닙니다. 플러그인을 내보내고 개발 플랫폼에 추가하면 정상적으로 작동합니다.

관련 문제