Skip to content

Commit

Permalink
Merge pull request #6351 from pkriens/issue/6301-create-new-workspace
Browse files Browse the repository at this point in the history
Rearranged the bnd new workspace menu entries
  • Loading branch information
pkriens authored Nov 4, 2024
2 parents 817383e + c39eda8 commit 2d45d0e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
18 changes: 10 additions & 8 deletions bndtools.core/_plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -132,26 +132,28 @@
preferredPerspectives="bndtools.perspective" icon="icons/bricks.png"
name="Bnd OSGi Project" project="true">
</wizard>
<wizard id="bndtools.workspaceWizard"
<wizard id="bndtools.workspaceFragmentWizard"
category="bndtools.wizardCategory"
class="bndtools.wizards.newworkspace.NewWorkspaceWizard"
finalPerspective="bndtools.perspective"
preferredPerspectives="bndtools.perspective"
icon="icons/bndtools-logo-16x16.png" name="New bnd workspace">
icon="icons/bndtools-logo-16x16.png"
name="Bnd Workspace (Fragments)"
project="true">
<description>
Creates a new bnd workspace. You will be able to select template fragments
that will define the new workspace. At finish, you can switch to the new
workspace.
Create a new bnd/eclipse workspace using template fragments
</description>
</wizard>
<wizard id="bndtools.workspaceWizardDeprecated"
<wizard id="bndtools.workspaceWizard"
category="bndtools.wizardCategory"
class="bndtools.wizards.workspace.WorkspaceSetupWizard"
finalPerspective="bndtools.perspective"
preferredPerspectives="bndtools.perspective"
icon="icons/bndtools-logo-16x16.png" name="Bnd OSGi Workspace (Deprecated)">
icon="icons/bndtools-logo-16x16.png"
name="Bnd OSGi Workspace"
project="true">
<description>
Old style workspace creation, will be deprecated in a coming release.
Create a new bnd workspace
</description>
</wizard>

Expand Down
1 change: 1 addition & 0 deletions bndtools.core/src/bndtools/PartConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public final class PartConstants {

public static final String WIZARD_ID_NEWBND = PREFIX + "newBndFile";
public static final String WIZARD_ID_NEWBNDRUN = PREFIX + "bndrunWizard";
public static final String WIZARD_ID_NEWWORKSPACE_FRAGMENTS = PREFIX + "workspaceFragmentWizard";
public static final String WIZARD_ID_NEWWORKSPACE = PREFIX + "workspaceWizard";
public static final String WIZARD_ID_NEWPROJECT = PREFIX + "newProjWiz";
public static final String WIZARD_ID_NEWWRAPPROJECT = PREFIX + "newWrapProjWiz";
Expand Down
2 changes: 1 addition & 1 deletion bndtools.core/src/bndtools/perspective/BndPerspective.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ public void createInitialLayout(IPageLayout layout) {

// new actions - Java project creation wizard
layout.addNewWizardShortcut(PartConstants.WIZARD_ID_NEWPROJECT);
layout.addNewWizardShortcut(PartConstants.WIZARD_ID_NEWWORKSPACE_FRAGMENTS);
layout.addNewWizardShortcut(PartConstants.WIZARD_ID_NEWWORKSPACE);
layout.addNewWizardShortcut(PartConstants.WIZARD_ID_NEWWORKSPACE + "Deprecated");
layout.addNewWizardShortcut(PartConstants.WIZARD_ID_NEWBNDRUN);
layout.addNewWizardShortcut(PartConstants.WIZARD_ID_NEWBND);
layout.addNewWizardShortcut(PartConstants.WIZARD_ID_NEWBLUEPRINT_XML);
Expand Down
4 changes: 2 additions & 2 deletions bndtools.core/src/bndtools/wizards/newworkspace/Model.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ boolean execute(TemplateUpdater updater) {
if (clean) {
getDataFiles().forEach(IO::delete);
}
if (!updateWorkspace) {
File b = IO.getFile(location, "cnf/build.bnd");
if (!updateWorkspace || !b.isFile()) {
location.mkdirs();
File b = IO.getFile(location, "cnf/build.bnd");
b.getParentFile()
.mkdirs();

Expand Down

0 comments on commit 2d45d0e

Please sign in to comment.