public ProjectSettingsStep(WizardContext context) { myWizardContext = context; myFormatPanel = new ProjectFormatPanel(); myNamePathComponent = NamePathComponent.initNamePathComponent(context); myNamePathComponent.setShouldBeAbsolute(true); JPanel modulePanel = getModulePanel(); if (context.isCreatingNewProject()) { mySettingsPanel.add(myNamePathComponent, BorderLayout.NORTH); addExpertPanel(modulePanel); } else { mySettingsPanel.add(modulePanel, BorderLayout.NORTH); } myModuleNameLocationComponent.bindModuleSettings(myNamePathComponent); myExpertDecorator = new HideableDecorator(myExpertPlaceholder, "Mor&e Settings", false); myExpertPanel.setBorder(IdeBorderFactory.createEmptyBorder(0, IdeBorderFactory.TITLED_BORDER_INDENT, 5, 0)); myExpertDecorator.setContentComponent(myExpertPanel); if (myWizardContext.isCreatingNewProject()) { addProjectFormat(modulePanel); } }
public ConfigurationSettingsEditorWrapper(final RunnerAndConfigurationSettings settings) { myEditor = new ConfigurationSettingsEditor(settings); Disposer.register(this, myEditor); myBeforeRunStepsPanel = new BeforeRunStepsPanel(this); myDecorator = new HideableDecorator(myBeforeLaunchContainer, "", false) { @Override protected void on() { super.on(); storeState(); } @Override protected void off() { super.off(); storeState(); } private void storeState() { PropertiesComponent.getInstance().setValue(EXPAND_PROPERTY_KEY, String.valueOf(isExpanded())); } }; myDecorator.setOn(PropertiesComponent.getInstance().getBoolean(EXPAND_PROPERTY_KEY, true)); myDecorator.setContentComponent(myBeforeRunStepsPanel); doReset(settings); }
@Override @Nullable protected JPanel createAdvancedSettings() { JComponent advancedSettings = null; if (myProjectGenerator instanceof PythonProjectGenerator) advancedSettings = ((PythonProjectGenerator)myProjectGenerator).getSettingsPanel(myProjectDirectory); else if (myProjectGenerator instanceof WebProjectTemplate) { advancedSettings = ((WebProjectTemplate)myProjectGenerator).getPeer().getComponent(); } if (advancedSettings != null) { final JPanel jPanel = new JPanel(new VerticalFlowLayout()); final HideableDecorator deco = new HideableDecorator(jPanel, "Mor&e Settings", false); boolean isValid = checkValid(); deco.setOn(!isValid); if (myProjectGenerator instanceof PythonProjectGenerator && !deco.isExpanded()) { final ValidationResult result = ((PythonProjectGenerator)myProjectGenerator).warningValidation(getSdk()); deco.setOn(!result.isOk()); } deco.setContentComponent(advancedSettings); return jPanel; } return null; }
public SelectTemplateStep(WizardContext context, StepSequence sequence, final MultiMap<TemplatesGroup, ProjectTemplate> map) { myWizardContext = context; mySequence = sequence; Messages.installHyperlinkSupport(myDescriptionPane); myFormatPanel = new ProjectFormatPanel(); myNamePathComponent = NamePathComponent.initNamePathComponent(context); if (context.isCreatingNewProject()) { mySettingsPanel.add(myNamePathComponent, BorderLayout.NORTH); addExpertPanel(getModulePanel()); } else { mySettingsPanel.add(getModulePanel(), BorderLayout.NORTH); } myModuleNameLocationComponent.bindModuleSettings(myNamePathComponent); myExpertDecorator = new HideableDecorator(myExpertPlaceholder, "Mor&e Settings", false); myExpertPanel.setBorder(IdeBorderFactory.createEmptyBorder(0, IdeBorderFactory.TITLED_BORDER_INDENT, 5, 0)); myExpertDecorator.setContentComponent(myExpertPanel); myList = new ProjectTypesList(myTemplatesList, map, context); myList.installKeyAction(getNameComponent()); myTemplatesList.getSelectionModel().addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent e) { ProjectTemplate template = getSelectedTemplate(); boolean loading = template instanceof LoadingProjectTemplate; myModuleBuilder = template == null || loading ? null : template.createModuleBuilder(); setupPanels(template); mySequence.setType(myModuleBuilder == null ? null : myModuleBuilder.getBuilderId()); myWizardContext.requestWizardButtonsUpdate(); } }); if (myWizardContext.isCreatingNewProject()) { addProjectFormat(getModulePanel()); } }
public PyPluginCommonOptionsForm(PyCommonOptionsFormData data) { // setting modules myProject = data.getProject(); final List<Module> validModules = data.getValidModules(); Collections.sort(validModules, new ModulesAlphaComparator()); Module selection = validModules.size() > 0 ? validModules.get(0) : null; myModuleComboBox.setModules(validModules); myModuleComboBox.setSelectedModule(selection); myInterpreterComboBox.setRenderer(new SdkListCellRenderer("<Project Default>")); myWorkingDirectoryTextField.addBrowseFolderListener("Select Working Directory", "", data.getProject(), FileChooserDescriptorFactory.createSingleFolderDescriptor()); ActionListener listener = new ActionListener() { public void actionPerformed(ActionEvent e) { updateControls(); } }; myUseSpecifiedSdkRadioButton.addActionListener(listener); myUseModuleSdkRadioButton.addActionListener(listener); myInterpreterComboBox.addActionListener(listener); myModuleComboBox.addActionListener(listener); setAnchor(myEnvsComponent.getLabel()); myDecorator = new HideableDecorator(myHideablePanel, "Environment", false) { @Override protected void on() { super.on(); storeState(); } @Override protected void off() { super.off(); storeState(); } private void storeState() { PropertiesComponent.getInstance().setValue(EXPAND_PROPERTY_KEY, String.valueOf(isExpanded()), "true"); } }; myDecorator.setOn(PropertiesComponent.getInstance().getBoolean(EXPAND_PROPERTY_KEY, true)); myDecorator.setContentComponent(myMainPanel); myPathMappingsComponent.setAnchor(myEnvsComponent.getLabel()); updateControls(); }
public PyIdeCommonOptionsForm(PyCommonOptionsFormData data) { myProject = data.getProject(); myWorkingDirectoryTextField.addBrowseFolderListener("Select Working Directory", "", data.getProject(), FileChooserDescriptorFactory.createSingleFolderDescriptor()); myPythonSdks = new ArrayList<Sdk>(PythonSdkType.getAllSdks()); myPythonSdks.add(0, null); myInterpreterComboBox.setModel(new CollectionComboBoxModel(myPythonSdks, null)); final Module[] modules = ModuleManager.getInstance(data.getProject()).getModules(); if (modules.length == 1) { setModule(modules[0]); myProjectLabel.setVisible(false); myModuleCombo.setVisible(false); } else { final List<Module> validModules = data.getValidModules(); Module selection = validModules.size() > 0 ? validModules.get(0) : null; myModuleCombo.setModules(validModules); myModuleCombo.setSelectedModule(selection); myModuleCombo.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { updateDefaultInterpreter(myModuleCombo.getSelectedModule()); } }); updateDefaultInterpreter(myModuleCombo.getSelectedModule()); } setAnchor(myEnvsComponent.getLabel()); myPathMappingsComponent.setAnchor(myEnvsComponent.getLabel()); if (data.showConfigureInterpretersLink()) { myConfigureInterpretersPanel.add(new PyConfigureInterpretersLinkPanel(myMainPanel)); } addInterpreterComboBoxActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent event) { updateRemoteInterpreterMode(); } } ); updateRemoteInterpreterMode(); myDecorator = new HideableDecorator(myHideablePanel, "Environment", false) { @Override protected void on() { super.on(); storeState(); } @Override protected void off() { super.off(); storeState(); } private void storeState() { PropertiesComponent.getInstance().setValue(EXPAND_PROPERTY_KEY, String.valueOf(isExpanded()), "true"); } }; myDecorator.setOn(PropertiesComponent.getInstance().getBoolean(EXPAND_PROPERTY_KEY, true)); myDecorator.setContentComponent(myMainPanel); }
public SelectTemplateStep(WizardContext context, StepSequence sequence, final MultiMap<TemplatesGroup, ProjectTemplate> map) { myWizardContext = context; mySequence = sequence; Messages.installHyperlinkSupport(myDescriptionPane); myFormatPanel = new ProjectFormatPanel(); myNamePathComponent = initNamePathComponent(context); if (context.isCreatingNewProject()) { mySettingsPanel.add(myNamePathComponent, BorderLayout.NORTH); addExpertPanel(myModulePanel); } else { mySettingsPanel.add(myModulePanel, BorderLayout.NORTH); } bindModuleSettings(); myExpertDecorator = new HideableDecorator(myExpertPlaceholder, "Mor&e Settings", false); myExpertPanel.setBorder(IdeBorderFactory.createEmptyBorder(0, IdeBorderFactory.TITLED_BORDER_INDENT, 5, 0)); myExpertDecorator.setContentComponent(myExpertPanel); myList = new ProjectTypesList(myTemplatesList, map, context); myList.installKeyAction(getNameComponent()); myTemplatesList.getSelectionModel().addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent e) { ProjectTemplate template = getSelectedTemplate(); boolean loading = template instanceof LoadingProjectTemplate; myModuleBuilder = template == null || loading ? null : template.createModuleBuilder(); setupPanels(template); mySequence.setType(myModuleBuilder == null ? null : myModuleBuilder.getBuilderId()); myWizardContext.requestWizardButtonsUpdate(); } }); if (myWizardContext.isCreatingNewProject()) { addProjectFormat(myModulePanel); } }