Skip to content

Commit 43dcecd

Browse files
committed
step-4 More Actions
* Add an Action to the GlobalViewContainer MenuBar & ToolBar * Add an icon for the Action
1 parent 0e8b163 commit 43dcecd

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/HelloWorldExtension.as

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ package
55
import core.app.CoreApp;
66
import core.app.resources.FactoryResource;
77
import core.appEx.resources.CommandHandlerFactory;
8-
import core.editor.CoreEditor;
8+
import core.editor.core.IGlobalViewContainer;
9+
import core.editor.icons.CoreEditorIcons;
910
import core.editor.resources.ActionFactory;
1011

1112
import helloWorld.commandHandlers.MyCommandHandler;
@@ -17,10 +18,8 @@ package
1718
public function HelloWorldExtension()
1819
{
1920
CoreApp.resourceManager.addResource( new FactoryResource( HelloWorldContext, "Hello World" ) );
20-
CoreApp.resourceManager.addResource( new ActionFactory( HelloWorldContext, Commands.MY_COMMAND, "My Action", "myActions" ) );
21+
CoreApp.resourceManager.addResource( new ActionFactory( IGlobalViewContainer, Commands.MY_COMMAND, "My Action", "myActions", "Actions/myActions", CoreEditorIcons.Resource ) );
2122
CoreApp.resourceManager.addResource( new CommandHandlerFactory( Commands.MY_COMMAND, MyCommandHandler ) );
22-
23-
//CoreEditor.commandManager.executeCommand(Commands.MY_COMMAND);
2423
}
2524
}
2625
}

0 commit comments

Comments
 (0)