mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
some fixes for new wizard
This commit is contained in:
@@ -81,6 +81,13 @@ public class AddModuleWizardPro extends AddModuleWizard {
|
||||
doPreviousAction();
|
||||
}
|
||||
}.registerCustomShortcutSet(CustomShortcutSet.fromString("control shift TAB"), getContentPanel(), getDisposable());
|
||||
new AnAction(){
|
||||
@Override
|
||||
public void actionPerformed(AnActionEvent e) {
|
||||
myCurrentStep = mySteps.size() - 1;
|
||||
doOKAction();
|
||||
}
|
||||
}.registerCustomShortcutSet(CustomShortcutSet.fromString("control shift ENTER"), getContentPanel(), getDisposable());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -145,6 +152,7 @@ public class AddModuleWizardPro extends AddModuleWizard {
|
||||
final int ind = index;
|
||||
final ModuleWizardStep step = mySteps.get(index);
|
||||
final JRadioButton rb = new JRadioButton(step.getName(), index == myCurrentStep);
|
||||
rb.setFocusable(false);
|
||||
rb.setUI(new WizardArrowUI(rb, index < myCurrentStep));
|
||||
myStepsPanel.add(rb);
|
||||
group.add(rb);
|
||||
|
||||
@@ -30,6 +30,7 @@ import com.intellij.ide.util.projectWizard.WizardContext;
|
||||
import com.intellij.openapi.extensions.Extensions;
|
||||
import com.intellij.openapi.options.ConfigurationException;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.ui.ClickListener;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
@@ -46,6 +47,7 @@ import java.util.List;
|
||||
public class ProjectCreateModeStep extends ModuleWizardStep {
|
||||
private static final String LAST_PROJECT_CREATION_MODE = "LAST_PROJECT_CREATION_MODE";
|
||||
private final JPanel myWholePanel;
|
||||
private JPanel myPanelWithDescription;
|
||||
|
||||
private WizardMode myMode;
|
||||
private final List<WizardMode> myModes = new ArrayList<WizardMode>();
|
||||
@@ -77,7 +79,7 @@ public class ProjectCreateModeStep extends ModuleWizardStep {
|
||||
|
||||
myWizardContext = wizardContext;
|
||||
myWholePanel = new JPanel(new GridBagLayout());
|
||||
myWholePanel.setBorder(BorderFactory.createEtchedBorder());
|
||||
//myWholePanel.setBorder(BorderFactory.createEtchedBorder());
|
||||
|
||||
final Insets insets = new Insets(0, 0, 0, 5);
|
||||
GridBagConstraints gc = new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1, 0, GridBagConstraints.NORTHWEST,
|
||||
@@ -129,10 +131,24 @@ public class ProjectCreateModeStep extends ModuleWizardStep {
|
||||
gc.fill = GridBagConstraints.HORIZONTAL;
|
||||
gc.insets.bottom = 5;
|
||||
myWholePanel.add(note, gc);
|
||||
if (Registry.is("new.project.wizard")) {
|
||||
myPanelWithDescription = new JPanel(new BorderLayout());
|
||||
myPanelWithDescription.add(createDescription(), BorderLayout.NORTH);
|
||||
myPanelWithDescription.add(myWholePanel, BorderLayout.CENTER);
|
||||
}
|
||||
}
|
||||
|
||||
private JComponent createDescription() {
|
||||
return new JLabel("<html><body><center><h3>Welcome to Create New Project Wizard</h3></center>" +
|
||||
"Some text explaining what are we going to do on possible steps should be placed here<br><br>" +
|
||||
"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.<br><br>" +
|
||||
"To navigate through steps use keyboard shortcuts Control+Tab to go next step or Control+Shift+Tab to go back. Or click on a Wizard Arrow" +
|
||||
"</body></html>");
|
||||
|
||||
}
|
||||
|
||||
public JComponent getComponent() {
|
||||
return myWholePanel;
|
||||
return Registry.is("new.project.wizard") ? myPanelWithDescription : myWholePanel;
|
||||
}
|
||||
|
||||
public void updateDataModel() {
|
||||
|
||||
+5
-1
@@ -16,6 +16,7 @@
|
||||
package com.intellij.openapi.roots.ui.configuration.actions;
|
||||
|
||||
import com.intellij.ide.util.newProjectWizard.AddModuleWizard;
|
||||
import com.intellij.ide.util.newProjectWizard.AddModuleWizardPro;
|
||||
import com.intellij.ide.util.projectWizard.ModuleBuilder;
|
||||
import com.intellij.ide.util.projectWizard.ProjectBuilder;
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
@@ -27,6 +28,7 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.project.ProjectBundle;
|
||||
import com.intellij.openapi.roots.ui.configuration.DefaultModulesProvider;
|
||||
import com.intellij.openapi.roots.ui.configuration.ModulesConfigurator;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -52,7 +54,9 @@ public class NewModuleAction extends AnAction implements DumbAware {
|
||||
if (virtualFile != null && virtualFile.isDirectory()) {
|
||||
defaultPath = virtualFile.getPath();
|
||||
}
|
||||
final AddModuleWizard wizard = new AddModuleWizard(project, new DefaultModulesProvider(project), defaultPath);
|
||||
final AddModuleWizard wizard = Registry.is("new.project.wizard")
|
||||
? new AddModuleWizardPro(project, new DefaultModulesProvider(project), defaultPath)
|
||||
: new AddModuleWizard(project, new DefaultModulesProvider(project), defaultPath);
|
||||
|
||||
wizard.show();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user