Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,13 @@
import java.util.Map;
import java.util.Set;
import org.netbeans.api.annotations.common.NullAllowed;
import org.netbeans.api.project.Project;
import org.netbeans.api.templates.TemplateRegistration;
import org.netbeans.modules.maven.model.ModelOperation;
import org.netbeans.modules.maven.model.pom.POMModel;
import org.netbeans.modules.maven.newproject.ArchetypeWizardUtils;
import org.netbeans.modules.maven.newproject.BasicWizardPanel;
import org.netbeans.modules.maven.newproject.MavenWizardIterator;
import org.netbeans.validation.api.ui.ValidationGroup;
import org.netbeans.validation.api.ui.ValidationGroupProvider;
import org.openide.WizardDescriptor;
import org.openide.filesystems.FileObject;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.LinkedHashSet;
import java.util.List;
Expand Down Expand Up @@ -64,8 +63,6 @@ public class ArchetypeWizardUtils {
/** {@code Map<String,String>} of custom archetype properties to define. */
public static final String ADDITIONAL_PROPS = "additionalProps"; // NOI18N

private static final Logger LOG = Logger.getLogger(ArchetypeWizardUtils.class.getName());

private ArchetypeWizardUtils() {
}

Expand All @@ -87,12 +84,12 @@ private static void runArchetype(File directory, ProjectInfo vi, Archetype arch,
config.setProperty("artifactId", vi.artifactId); //NOI18N
config.setProperty("version", vi.version); //NOI18N
final String pack = vi.packageName;
if (pack != null && pack.trim().length() > 0) {
if (pack != null && !pack.isBlank()) {
config.setProperty("package", pack); //NOI18N
}
config.setProperty("basedir", directory.getAbsolutePath());//NOI18N

Map<String, String> baseprops = new HashMap<String, String>(config.getProperties());
Map<String, String> baseprops = new HashMap<>(config.getProperties());

if (additional != null) {
for (Map.Entry<String,String> entry : additional.entrySet()) {
Expand Down Expand Up @@ -163,7 +160,7 @@ public static void createFromArchetype(File projDir, ProjectInfo vi, Archetype a
if (parent == null) {
throw new IOException("no parent of " + projDir);
}
if (updateLastUsedProjectDir && parent != null && parent.exists()) {
if (updateLastUsedProjectDir && parent.exists()) {
ProjectChooser.setProjectsFolder(parent);
}
if (!parent.isDirectory() && !parent.mkdirs()) {
Expand Down Expand Up @@ -217,9 +214,7 @@ private static void processProjectFolder(final FileObject fo) {
if (watch != null) {
watch.downloadDependencyAndJavadocSource(false);
}
} catch (IOException ex) {
Exceptions.printStackTrace(ex);
} catch (IllegalArgumentException ex) {
} catch (IOException | IllegalArgumentException ex) {
Exceptions.printStackTrace(ex);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ public void initialize(WizardDescriptor wiz) {
}
index = 0;
ValidationGroup vg = ValidationGroup.create(new WizardDescriptorAdapter(wiz));
panels = new ArrayList<WizardDescriptor.Panel<WizardDescriptor>>();
List<String> steps = new ArrayList<String>();
panels = new ArrayList<>();
List<String> steps = new ArrayList<>();
if (archetype == null) {
panels.add(new ChooseWizardPanel());
steps.add(LBL_CreateProjectStep());
Expand All @@ -104,7 +104,7 @@ public void initialize(WizardDescriptor wiz) {
for (int i = 0; i < panels.size(); i++) {
JComponent c = (JComponent) panels.get(i).getComponent();
c.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, i);
c.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, steps.toArray(new String[0]));
c.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, steps.toArray(String[]::new));
}
if (archetype != null) {
wiz.putProperty(PROP_ARCHETYPE, archetype);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ public static WizardDescriptor.InstantiatingIterator<?> openJFXSimple() {
private static WizardDescriptor.InstantiatingIterator<?> definedFXArchetype(String g, String a, String v, String name) {
Map<String, String> props = new HashMap<>();
props.put("add-debug-configuration", "Y");
props.put("javafx-version", "21.0.9");
props.put("javafx-maven-plugin-version", "0.0.8");
return ArchetypeWizards.definedArchetype(g, a, v, null, name, props);
}

Expand Down