org.netbeans.spi.project.ui.support.CommonProjectActions Java Examples

The following examples show how to use org.netbeans.spi.project.ui.support.CommonProjectActions. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ProjectAttributesPanelVisual.java    From netbeans with Apache License 2.0 6 votes vote down vote up
void read(WizardDescriptor settings) {
    File loc = (File) settings.getProperty(CommonProjectActions.PROJECT_PARENT_FOLDER);
    if (loc == null || loc.getParentFile() == null || !loc.getParentFile().isDirectory()) {
        loc = ProjectChooser.getProjectsFolder();
    }
    tfProjectLocation.setText(loc.getAbsolutePath());

    String name = (String) settings.getProperty(PROP_NAME);

    name = name != null ? name : firstAvailableName(loc, "gradleproject"); //NOI18N
    tfProjectName.setText(name);

    setText(tfGroup, settings, PROP_GROUP);
    setText(tfVersion, settings, PROP_VERSION);
    setText(tfDescription, settings, PROP_DESCRIPTION);
    setText(tfPackageBase, settings, PROP_PACKAGE_BASE);

    Boolean initWrapper = (Boolean) settings.getProperty(PROP_INIT_WRAPPER);
    cbInitWrapper.setSelected(initWrapper != null ? initWrapper: false);

    Boolean changedPkg = (Boolean) settings.getProperty(PROP_CHANGED_PKG);
    changedPackageBase = changedPkg == null ? false : changedPkg;

    tfProjectName.selectAll();

}
 
Example #2
Source File: NbAndroidProjectImpl.java    From NBANDROID-V2 with Apache License 2.0 6 votes vote down vote up
@Override
public Action[] getActions(boolean arg0) {
    List<Action> projectActions = new ArrayList<>(32);
    projectActions.add(ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_REBUILD, "Clean and Build", null));
    projectActions.add(ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_CLEAN, "Clean", null));
    projectActions.add(ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_BUILD, "Buld", null));
    projectActions.add(null);
    projectActions.add(ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_RUN, "Run", null));
    projectActions.add(ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_DEBUG, "Debug", null));
    projectActions.add(selectDeviceProjectAction);
    projectActions.add(configurationsProjectAction);
    projectActions.add(null);
    List<? extends Action> actionsForPath = Utilities.actionsForPath("Android/Projects/Project");
    projectActions.addAll(actionsForPath);
    projectActions.add(CommonProjectActions.closeProjectAction());
    projectActions.add(CommonProjectActions.setAsMainProjectAction());
    projectActions.add(null);
    projectActions.addAll(Utilities.actionsForPath("Projects/Actions"));
    projectActions.add(null);
    projectActions.add(CommonProjectActions.customizeProjectAction());
    return projectActions.toArray(new Action[projectActions.size()]);

}
 
Example #3
Source File: IDENativeMavenWizardIterator.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Override
@Messages({"PRG_Dir=Creating directory", "PRG_FINISH=Finishing..."})
public Set<FileObject> instantiate (ProgressHandle handle) throws IOException {
    handle.start();
    try {
        handle.progress(Bundle.PRG_Dir());
        ProjectInfo vi = new ProjectInfo((String) wiz.getProperty("groupId"), (String) wiz.getProperty("artifactId"), (String) wiz.getProperty("version"), (String) wiz.getProperty("package")); //NOI18N
        String[] splitlog = StringUtils.split(log, ":");
        ArchetypeWizardUtils.logUsage(splitlog[0], splitlog[1], splitlog[2]);
        File projFile = FileUtil.normalizeFile((File) wiz.getProperty(CommonProjectActions.PROJECT_PARENT_FOLDER)); // NOI18N
        final File parent = projFile.getParentFile();
        if (parent != null && parent.exists()) {
            ProjectChooser.setProjectsFolder(parent);
        }
        CreateProjectBuilder builder = createBuilder(projFile, vi, handle);
        builder.create();
        handle.progress(Bundle.PRG_FINISH());
        return ArchetypeWizardUtils.openProjects(projFile, null);   
    } finally {
        handle.finish();
    }
}
 
Example #4
Source File: MultiModuleNodeFactory.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@NonNull
@Override
public Action[] getActions(final boolean context) {
    if (context) {
        return super.getActions(context);
    } else {
        if (actions == null) {
            actions = new Action[] {
                CommonProjectActions.newFileAction(),
                null,
                SystemAction.get(FindAction.class),
                null,
                SystemAction.get(PasteAction.class ),
                null,
                SystemAction.get(FileSystemAction.class ),
                null,
                SystemAction.get(ToolsAction.class )
            };
        }
        return actions;
    }
}
 
Example #5
Source File: ModuleOperationsTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void testOperationActions() throws Exception { // #72397
    final NbModuleProject project = generateStandaloneModule("module");
    cgpi.setProject(project);
    DialogDisplayerImpl dd = (DialogDisplayerImpl) Lookup.getDefault().lookup(DialogDisplayer.class);
    FileObject lock = FileUtil.createData(project.getProjectDirectory(), "build/testuserdir/lock");
    RandomAccessFile raf = new RandomAccessFile(FileUtil.toFile(lock), "rw");
    FileLock lck = raf.getChannel().lock();
    EventQueue.invokeAndWait(new Runnable() {
        @Override public void run() {
            ((ContextAwareAction) CommonProjectActions.deleteProjectAction()).createContextAwareInstance(Lookups.singleton(project)).actionPerformed(null);
        }
    });
    assertNotNull("warning message emitted", dd.getLastNotifyDescriptor());
    assertEquals("warning message emitted", dd.getLastNotifyDescriptor().getMessage(),
            Bundle.ERR_ModuleIsBeingRun());
    dd.reset();
    lck.release();
    raf.close();
    lock.delete();
    EventQueue.invokeAndWait(new Runnable() {
        @Override public void run() {
            CommonProjectActions.deleteProjectAction().actionPerformed(null);
        }
    });
    assertNull("no warning message", dd.getLastNotifyDescriptor());
}
 
Example #6
Source File: SuiteOperations.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private static void close(final Project prj) {
    Mutex.EVENT.readAccess(new Mutex.Action<Object>() {
        public Object run() {
            LifecycleManager.getDefault().saveAll();
            
            Action closeAction = CommonProjectActions.closeProjectAction();
            closeAction = closeAction instanceof ContextAwareAction ? ((ContextAwareAction) closeAction).createContextAwareInstance(Lookups.fixed(new Object[] {prj})) : null;
            
            if (closeAction != null && closeAction.isEnabled()) {
                closeAction.actionPerformed(new ActionEvent(prj, -1, "")); // NOI18N
            } else {
                //fallback:
                OpenProjects.getDefault().close(new Project[] {prj});
            }
            
            return null;
        }
    });
}
 
Example #7
Source File: DocBaseNodeFactory.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Override
public Action[] getActions(boolean context) {
    if (actions == null) {
        actions = new Action[9];
        actions[0] = CommonProjectActions.newFileAction();
        actions[1] = null;
        actions[2] = SystemAction.get(FindAction.class);
        actions[3] = null;
        actions[4] = SystemAction.get(PasteAction.class);
        actions[5] = null;
        actions[6] = SystemAction.get(FileSystemAction.class);
        actions[7] = null;
        actions[8] = ProjectUISupport.createPreselectPropertiesAction(project, "Sources", null); //NOI18N
    }
    return actions;
}
 
Example #8
Source File: ClientSideProjectLogicalView.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Override
public Action[] getActions(boolean context) {
    List<Action> actions = new ArrayList<Action>();
    actions.add(CommonProjectActions.newFileAction());
    actions.add(null);
    actions.add(SystemAction.get(FindAction.class));
    actions.add(null);
    actions.add(SystemAction.get(FileSystemAction.class));
    actions.add(null);
    actions.add(SystemAction.get(PasteAction.class));
    actions.add(null);
    actions.add(SystemAction.get(ToolsAction.class));
    actions.add(null);
    actions.add(CommonProjectActions.customizeProjectAction());
    return actions.toArray(new Action[actions.size()]);
}
 
Example #9
Source File: ProjectServicesImpl.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public void createNewProject(File workingDir) {
    Action newProjectAction = CommonProjectActions.newProjectAction();
    if (newProjectAction != null) {
        ProjectChooser.setProjectsFolder(workingDir);
        newProjectAction.actionPerformed(new ActionEvent(this,
                ActionEvent.ACTION_PERFORMED, "command")); // NOI18N
    }
}
 
Example #10
Source File: JaxWsRootNode.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public Action[] getActions(boolean context) {
    return new Action[]{
        CommonProjectActions.newFileAction(),
        null,
        SystemAction.get(FindAction.class),
        null,
        SystemAction.get(PasteAction.class),
        null,
        SystemAction.get(PropertiesAction.class)
    };
}
 
Example #11
Source File: ProjectWebServiceNodeFactory.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public Action[] getActions(boolean context) {
    return new Action[]{
                CommonProjectActions.newFileAction(),
                null,
                SystemAction.get(FindAction.class),
                null,
                SystemAction.get(PasteAction.class),
                null,
                SystemAction.get(PropertiesAction.class)
            };
}
 
Example #12
Source File: RestServicesNode.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public Action[] getActions(boolean context) {
    return new Action[] {
                CommonProjectActions.newFileAction(),
                SystemAction.get(TestRestServicesAction.class),
                null,
                SystemAction.get(FindAction.class),
                null,
                SystemAction.get(PasteAction.class),
                null,
                SystemAction.get(PropertiesAction.class)
            };
}
 
Example #13
Source File: JaxWsClientRootNode.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public Action[] getActions(boolean context) {
    return new Action[]{
        CommonProjectActions.newFileAction(),
        null,
        SystemAction.get(FindAction.class),
        null,
        SystemAction.get(PasteAction.class),
        null,
        SystemAction.get(PropertiesAction.class)
    };
}
 
Example #14
Source File: JaxWsRootNode.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public Action[] getActions(boolean context) {
    return new Action[]{
        CommonProjectActions.newFileAction(),
        null,
        SystemAction.get(FindAction.class),
        null,
        SystemAction.get(PasteAction.class),
        null,
        SystemAction.get(PropertiesAction.class)
    };
}
 
Example #15
Source File: ServerResourceNode.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public Action[] getActions( boolean context ) {
    return new Action[] {
        CommonProjectActions.newFileAction(),
        null,
        SystemAction.get(FileSystemAction.class),
        null,
        SystemAction.get(FindAction.class),
        null,
        SystemAction.get(PasteAction.class),
    };
}
 
Example #16
Source File: PhpLogicalViewProvider.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public Action[] getActions(boolean context) {
    List<Action> actions = new LinkedList<>(Arrays.asList(CommonProjectActions.forType("org-netbeans-modules-php-project"))); // NOI18N
    addBuildActions(actions);
    // XXX code coverage cannot be added since it already is ContextAwareAction (but the Factory needs to be ContextAwareAction as well)
    addCodeCoverageAction(actions);
    // XXX similarly for frameworks - they are directly in the context menu, not in any submenu
    addFrameworks(actions);
    return actions.toArray(new Action[actions.size()]);
}
 
Example #17
Source File: SrcNode.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public Action[] getActions(boolean context) {
    List<Action> actions = new ArrayList<>();
    actions.add(CommonProjectActions.newFileAction());
    actions.add(null);
    if (!isTest) {
        actions.add(FileSensitiveActions.fileCommandAction(DownloadCommand.ID, DownloadCommand.DISPLAY_NAME, null));
        actions.add(FileSensitiveActions.fileCommandAction(UploadCommand.ID, UploadCommand.DISPLAY_NAME, null));
        actions.add(FileSensitiveActions.fileCommandAction(SyncCommand.ID, SyncCommand.DISPLAY_NAME, null));
        actions.add(null);
    } else {
        // #252010
        if (project.getTestRoots().getRoots().length > 1) {
            actions.add(ProjectSensitiveActions.projectCommandAction(RunTestsCommand.ID, RunTestsCommand.DISPLAY_NAME, null));
            actions.add(null);
        }
    }
    actions.add(SystemAction.get(FileSystemAction.class));
    actions.add(null);
    actions.add(SystemAction.get(FindAction.class));
    actions.add(null);
    actions.add(SystemAction.get(PasteAction.class));
    actions.add(null);
    actions.add(SystemAction.get(ToolsAction.class));
    actions.add(null);
    // customizer - open sources for source node, testing for test node
    Action customizeAction = null;
    if (isTest) {
        customizeAction = new PhpLogicalViewProvider.CustomizeProjectAction(project, CompositePanelProviderImpl.TESTING);
    } else {
        customizeAction = CommonProjectActions.customizeProjectAction();
    }
    if (customizeAction != null) {
        actions.add(customizeAction);
    }
    return actions.toArray(new Action[actions.size()]);
}
 
Example #18
Source File: GrailsLogicalViewProvider.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private Action[] getAdditionalActions() {
    List<Action> actions = new ArrayList<Action>();
    actions.add(CommonProjectActions.newFileAction());
    actions.add(null);
    actions.add(getCommandAction(GrailsActionProvider.COMMAND_BUILD, "LBL_BuildAction_Name"));
    actions.add(getCommandAction(GrailsActionProvider.COMMAND_COMPILE, "LBL_Compile_Name"));
    actions.add(getCommandAction(GrailsActionProvider.COMMAND_CLEAN, "LBL_CleanAction_Name"));
    actions.add(getCommandAction(GrailsActionProvider.COMMAND_UPGRADE, "LBL_Upgrade_Name"));
    actions.add(null);
    actions.add(SystemAction.get(GrailsCommandAction.class));
    actions.add(getCommandAction(GrailsActionProvider.COMMAND_GRAILS_SHELL, "LBL_ShellAction_Name"));
    actions.add(new ManagePluginsAction(project));
    actions.add(null);
    actions.add(new ResolvePluginsAction(project));
    actions.add(null);
    actions.add(getCommandAction(GrailsActionProvider.COMMAND_RUN, "LBL_RunAction_Name"));
    actions.add(getCommandAction(GrailsActionProvider.COMMAND_DEBUG, "LBL_DebugAction_Name"));
    actions.add(getCommandAction(GrailsActionProvider.COMMAND_TEST, "LBL_TestAction_Name"));
    actions.add(null);
    actions.add(CommonProjectActions.setAsMainProjectAction());
    actions.add(CommonProjectActions.closeProjectAction());
    actions.add(null);
    actions.add(SystemAction.get(FindAction.class));
    actions.add(null);
    actions.add(CommonProjectActions.deleteProjectAction());
    actions.add(null);

    // honor 57874 contact
    actions.addAll(Utilities.actionsForPath("Projects/Actions")); //NOI18N

    actions.add(null);
    actions.add(CommonProjectActions.customizeProjectAction());

    return actions.toArray(new Action[actions.size()]);
}
 
Example #19
Source File: ProjectAttributesPanelVisual.java    From netbeans with Apache License 2.0 5 votes vote down vote up
void write(WizardDescriptor settings) {
    File projectFolder = new File(tfProjectLocation.getText());
    ProjectChooser.setProjectsFolder(projectFolder);
    settings.putProperty(CommonProjectActions.PROJECT_PARENT_FOLDER,
            projectFolder);
    settings.putProperty(PROP_NAME, tfProjectName.getText());
    settings.putProperty(PROP_GROUP, tfGroup.getText());
    settings.putProperty(PROP_VERSION, tfVersion.getText());
    settings.putProperty(PROP_DESCRIPTION, tfDescription.getText());
    settings.putProperty(PROP_PACKAGE_BASE, tfPackageBase.getText());
    settings.putProperty(PROP_CHANGED_PKG, changedPackageBase);
    settings.putProperty(PROP_INIT_WRAPPER, cbInitWrapper.isSelected());
}
 
Example #20
Source File: ExtProjectConvertorServices.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@NonNull
private Action[] transientActions() {
    Action[] res = actions;
    if (res == null) {
        res = actions = new Action[] {
            CommonProjectActions.closeProjectAction()
        };
    }
    return res;
}
 
Example #21
Source File: LazyProject.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public Action[] getActions(boolean context) {
    OpenProjectList.preferredProject(LazyProject.this);
    return new Action[] { 
        SystemAction.get(LazyProjectInitializing.class),
        CommonProjectActions.closeProjectAction()
    };
}
 
Example #22
Source File: NewProject.java    From netbeans with Apache License 2.0 5 votes vote down vote up
NewProjectWizard prepareWizardDescriptor(FileObject fo) {
    NewProjectWizard wizard = new NewProjectWizard(fo);
        
    wizard.putProperty(ProjectTemplates.PRESELECT_CATEGORY, getValue(ProjectTemplates.PRESELECT_CATEGORY));
    wizard.putProperty(ProjectTemplates.PRESELECT_TEMPLATE, getValue(ProjectTemplates.PRESELECT_TEMPLATE));

    FileObject folder = (FileObject) getValue(CommonProjectActions.EXISTING_SOURCES_FOLDER);
    if (folder != null) {
        wizard.putProperty(CommonProjectActions.EXISTING_SOURCES_FOLDER, folder);
    }
    File f = (File) getValue(CommonProjectActions.PROJECT_PARENT_FOLDER);
    if (f != null) {
        wizard.putProperty(CommonProjectActions.PROJECT_PARENT_FOLDER, f);
    }
    // carry over properties like e.g. groupId and version from maven when creating new submodule.
    // see aso issue #217087 and #250190
    String[] moreProps = (String[]) getValue(CommonProjectActions.INITIAL_VALUE_PROPERTIES);
    if (moreProps != null) {
        for (String key : moreProps) {
            Object obj = getValue(key);
            if (obj != null) {
                wizard.putProperty(key, obj);
            }
        }
    }
    return wizard;
}
 
Example #23
Source File: PhysicalView.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public @Override Action[] getActions(boolean context) {

            if ( context ) {
                return super.getActions( true );
            }
            else { 
                Action[] folderActions = super.getActions( false );
                Action[] projectActions;
                
                if ( isProjectDir ) {
                    if( projectDelegateNode != null ) {
                        projectActions = projectDelegateNode.getActions( false );
                    }
                    else {
                        // If this is project dir then the properties action 
                        // has to be replaced to invoke project customizer
                        projectActions = new Action[ folderActions.length ]; 
                        for ( int i = 0; i < folderActions.length; i++ ) {
                            if ( folderActions[i] instanceof org.openide.actions.PropertiesAction ) {
                                projectActions[i] = CommonProjectActions.customizeProjectAction();
                            }
                            else {
                                projectActions[i] = folderActions[i];
                            }
                        }
                    }
                }
                else {
                    projectActions = folderActions;
                }
                
                return projectActions;
            }                                            
        }
 
Example #24
Source File: HgProjectUtils.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public static void renameProject(Project p, Object caller) {
    if( p == null) return;
    
    ContextAwareAction action = (ContextAwareAction) CommonProjectActions.renameProjectAction();
    Lookup ctx = Lookups.singleton(p);
    Action ctxAction = action.createContextAwareInstance(ctx);
    ctxAction.actionPerformed(new ActionEvent(caller, 0, "")); // NOI18N
}
 
Example #25
Source File: NbAndroidRootProjectImpl.java    From NBANDROID-V2 with Apache License 2.0 5 votes vote down vote up
@Override
public Action[] getActions(boolean arg0) {
    return new Action[]{
        ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_REBUILD, "Clean and Build", null),
        ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_CLEAN, "Clean", null),
        ProjectSensitiveActions.projectCommandAction(ActionProvider.COMMAND_BUILD, "Buld", null),
        configurationsProjectAction,
        CommonProjectActions.setAsMainProjectAction(),
        CommonProjectActions.customizeProjectAction(),
        CommonProjectActions.closeProjectAction()
    };
}
 
Example #26
Source File: MVCNode.java    From cakephp3-netbeans with Apache License 2.0 5 votes vote down vote up
@Override
@NbBundle.Messages({
    "LBL_DownloadCommand=Download...",
    "LBL_UploadCommand=Upload...",
    "LBL_SyncCommand=Synchronize..."
})
public Action[] getActions(boolean context) {
    List<Action> actions = new ArrayList<>();
    actions.add(CommonProjectActions.newFileAction());
    actions.add(null);
    actions.add(FileSensitiveActions.fileCommandAction("dowonload", Bundle.LBL_DownloadCommand(), null));
    actions.add(FileSensitiveActions.fileCommandAction("upload", Bundle.LBL_UploadCommand(), null));
    actions.add(FileSensitiveActions.fileCommandAction("synchronize", Bundle.LBL_SyncCommand(), null));
    actions.add(null);
    actions.add(SystemAction.get(FileSystemAction.class));
    actions.add(null);
    actions.add(SystemAction.get(FindAction.class));
    actions.add(null);
    actions.add(SystemAction.get(PasteAction.class));
    actions.add(null);
    actions.add(SystemAction.get(ToolsAction.class));
    actions.add(null);
    // customizer - open sources for source node, phpunit for test node
    Action customizeAction;
    customizeAction = CommonProjectActions.customizeProjectAction();
    actions.add(customizeAction);
    return actions.toArray(new Action[actions.size()]);
}
 
Example #27
Source File: AssetPackProjectLogicalView.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public Action[] getActions(boolean arg0) {
    Action[] nodeActions = new Action[9];
    nodeActions[0] = new PublishAssetPackAction(project);
    nodeActions[1] = new ConvertOgreBinaryMeshesAction(project);
    nodeActions[2] = new ImportWorldForgeAction(project);
    nodeActions[3] = new CleanupProjectAction(project);
    nodeActions[4] = CommonProjectActions.copyProjectAction();
    nodeActions[5] = CommonProjectActions.deleteProjectAction();
    nodeActions[6] = CommonProjectActions.setAsMainProjectAction();
    nodeActions[7] = CommonProjectActions.closeProjectAction();
    nodeActions[8] = CommonProjectActions.customizeProjectAction();
    return nodeActions;
}
 
Example #28
Source File: CodelessProjectLogicalView.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
        public Action[] getActions(boolean arg0) {
            Action[] nodeActions = new Action[7];
//            nodeActions[0] = CommonProjectActions.newFileAction();
            nodeActions[1] = CommonProjectActions.copyProjectAction();
            nodeActions[2] = CommonProjectActions.deleteProjectAction();
            nodeActions[5] = CommonProjectActions.setAsMainProjectAction();
            nodeActions[6] = CommonProjectActions.closeProjectAction();
            return nodeActions;
        }
 
Example #29
Source File: BrokenProject.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public Action[] getActions(boolean context) {
    return new Action[] {
        CommonProjectActions.closeProjectAction(),
        null,
        BrokenActionInfo.ACTION
    };
}
 
Example #30
Source File: ModulesNode.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override public void actionPerformed(ActionEvent e) {
    Action act = CommonProjectActions.newProjectAction();
    act.putValue("PRESELECT_CATEGORY" /*ProjectTemplates.PRESELECT_CATEGORY */, "Maven2");
    act.putValue(CommonProjectActions.PROJECT_PARENT_FOLDER, proj.getPOMFile().getParentFile());
    act.putValue("initialValueProperties", new String[] {"groupId", "version"});
    act.putValue("groupId", proj.getOriginalMavenProject().getGroupId());
    act.putValue("version", proj.getOriginalMavenProject().getVersion());
    act.actionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, "actionPerformed"));
}