diff --git a/plugins/javaFX/resources/intellij.javaFX.xml b/plugins/javaFX/resources/intellij.javaFX.xml index 093f0f005481..4a955b511a3c 100644 --- a/plugins/javaFX/resources/intellij.javaFX.xml +++ b/plugins/javaFX/resources/intellij.javaFX.xml @@ -70,7 +70,7 @@ - + @@ -114,8 +114,10 @@ - - + + diff --git a/plugins/javaFX/resources/messages/JavaFXBundle.properties b/plugins/javaFX/resources/messages/JavaFXBundle.properties index ababa2dfadcd..bb96bb0a2430 100644 --- a/plugins/javaFX/resources/messages/JavaFXBundle.properties +++ b/plugins/javaFX/resources/messages/JavaFXBundle.properties @@ -68,10 +68,10 @@ javafx.certificates.dialog.select.file.with.generated.keys=Select file containin javafx.collapse.subtag.to.attribute.intention=Collapse tag ''{0}'' to attribute javafx.collapse.subtag.to.attribute.intention.family.name=Collapse tag to attribute -javafx.create.new.fxml.file.description=Create new FXML file -javafx.create.new.fxml.file.title=FXML File -javafx.create.new.application.title=JavaFX Application -javafx.create.new.application.description=Create JavaFX application class +action.NewFxmlFile.description=Create new FXML file +action.NewFxmlFile.text=FXML File +action.NewJavaFXApplication.text=JavaFX Application +action.NewJavaFXApplication.description=Create JavaFX application class javafx.edit.certificates.dialog.alias=&Alias: javafx.edit.certificates.dialog.keypass=K&eypass: javafx.edit.certificates.dialog.keystore=Ke&ystore: diff --git a/plugins/javaFX/src/org/jetbrains/plugins/javaFX/actions/CreateFxmlFileAction.java b/plugins/javaFX/src/org/jetbrains/plugins/javaFX/actions/CreateFxmlFileAction.java index 7ebeefbb84e5..c8acd10d829f 100644 --- a/plugins/javaFX/src/org/jetbrains/plugins/javaFX/actions/CreateFxmlFileAction.java +++ b/plugins/javaFX/src/org/jetbrains/plugins/javaFX/actions/CreateFxmlFileAction.java @@ -1,7 +1,6 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.jetbrains.plugins.javaFX.actions; -import com.intellij.icons.AllIcons; import com.intellij.ide.IdeView; import com.intellij.ide.fileTemplates.FileTemplate; import com.intellij.ide.fileTemplates.FileTemplateManager; @@ -19,7 +18,7 @@ import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.JavaPsiFacade; import com.intellij.psi.PsiDirectory; import com.intellij.psi.PsiFile; -import com.intellij.psi.util.CachedValueProvider; +import com.intellij.psi.util.CachedValueProvider.Result; import com.intellij.psi.util.CachedValuesManager; import com.intellij.util.PathUtil; import org.jetbrains.annotations.NonNls; @@ -27,7 +26,6 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.jps.model.java.JavaModuleSourceRootTypes; import org.jetbrains.jps.model.module.JpsModuleSourceRootType; -import org.jetbrains.plugins.javaFX.JavaFXBundle; import org.jetbrains.plugins.javaFX.fxml.JavaFxFileTypeFactory; import java.util.Arrays; @@ -38,17 +36,9 @@ import java.util.Set; import static com.intellij.psi.search.GlobalSearchScope.moduleWithDependenciesAndLibrariesScope; import static org.jetbrains.plugins.javaFX.fxml.JavaFxCommonNames.JAVAFX_APPLICATION_APPLICATION; -/** - * @author pdolgov - */ public final class CreateFxmlFileAction extends CreateFromTemplateActionBase { private static final String INTERNAL_TEMPLATE_NAME = "FxmlFile.fxml"; - public CreateFxmlFileAction() { - super(JavaFXBundle.message("javafx.create.new.fxml.file.title"), JavaFXBundle.message("javafx.create.new.fxml.file.description"), - AllIcons.FileTypes.Xml); - } - @Override public @NotNull ActionUpdateThread getActionUpdateThread() { return ActionUpdateThread.BGT; @@ -148,7 +138,7 @@ public final class CreateFxmlFileAction extends CreateFromTemplateActionBase { return CachedValuesManager.getManager(module.getProject()).getCachedValue(module, () -> { boolean hasClass = JavaPsiFacade.getInstance(module.getProject()) .findClass(JAVAFX_APPLICATION_APPLICATION, moduleWithDependenciesAndLibrariesScope(module)) != null; - return CachedValueProvider.Result.create(hasClass, ProjectRootManager.getInstance(module.getProject())); + return Result.create(hasClass, ProjectRootManager.getInstance(module.getProject())); }); } } diff --git a/plugins/javaFX/src/org/jetbrains/plugins/javaFX/actions/CreateJavaFxApplicationAction.java b/plugins/javaFX/src/org/jetbrains/plugins/javaFX/actions/CreateJavaFxApplicationAction.java index 4b122affdeee..a44f7de0e9ea 100644 --- a/plugins/javaFX/src/org/jetbrains/plugins/javaFX/actions/CreateJavaFxApplicationAction.java +++ b/plugins/javaFX/src/org/jetbrains/plugins/javaFX/actions/CreateJavaFxApplicationAction.java @@ -1,7 +1,6 @@ // Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package org.jetbrains.plugins.javaFX.actions; -import com.intellij.icons.AllIcons; import com.intellij.ide.fileTemplates.FileTemplate; import com.intellij.ide.fileTemplates.FileTemplateManager; import com.intellij.ide.fileTemplates.actions.CreateFromTemplateActionBase; @@ -11,21 +10,15 @@ import com.intellij.openapi.project.Project; import com.intellij.psi.PsiDirectory; import org.jetbrains.annotations.NotNull; import org.jetbrains.jps.model.java.JavaSourceRootType; -import org.jetbrains.plugins.javaFX.JavaFXBundle; import java.util.Set; import static org.jetbrains.plugins.javaFX.actions.CreateFxmlFileAction.isJavaFxTemplateAvailable; -public final class CreateJavaFxApplicationAction extends CreateFromTemplateActionBase { +final class CreateJavaFxApplicationAction extends CreateFromTemplateActionBase { private static final String FILE_TEMPLATE_NAME = "JavaFXApplication.java"; - public CreateJavaFxApplicationAction() { - super(JavaFXBundle.message("javafx.create.new.application.title"), JavaFXBundle.message("javafx.create.new.application.description"), - AllIcons.Nodes.Class); - } - @Override public @NotNull ActionUpdateThread getActionUpdateThread() { return ActionUpdateThread.BGT;