protected void createFieldPanel(Composite parent) { IFieldEditor header = JQueryFieldEditorFactory.createCollapsibleHeaderEditor(); header.setValue("Header"); addEditor(header, parent); Composite[] columns = NewRangeSliderWizardPage.createTwoColumns(parent); Composite left = columns[0]; Composite right = columns[1]; IFieldEditor fieldSet = JQueryFieldEditorFactory.createFieldSetEditor(); addEditor(fieldSet, left); IFieldEditor collapsed = JQueryFieldEditorFactory.createCollapsedEditor(); addEditor(collapsed, right); IFieldEditor mini = JQueryFieldEditorFactory.createMiniEditor(); addEditor(mini, left); IFieldEditor inset = JQueryFieldEditorFactory.createInsetEditor(); addEditor(inset, right); createSeparator(parent); IFieldEditor collapsedIcon = JQueryFieldEditorFactory.createCollapsedIconEditor(); addEditor(collapsedIcon, parent, true); IFieldEditor expandedIcon = JQueryFieldEditorFactory.createExpandedIconEditor(); addEditor(expandedIcon, parent, true); IFieldEditor iconpos = JQueryFieldEditorFactory.createIconPositionEditor(); addEditor(iconpos, parent, true); createSeparator(parent); IFieldEditor theme = JQueryFieldEditorFactory.createDataThemeEditor(); addEditor(theme, parent, true); IFieldEditor contentTheme = JQueryFieldEditorFactory.createDataContentThemeEditor(); addEditor(contentTheme, parent, true); inset.setValue(TRUE); }
/* * Fills Code Generation group with the default package names. */ private void setCodeGenerationProperties() { String seamProjectName = model.getStringProperty(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME); if (seamProjectName == null) return; if ("".equals(sessionBeanPkgNameditor.getValueAsString())) sessionBeanPkgNameditor.setValue(getSessionPkgName(seamProjectName)); if ("".equals(entityBeanPkgNameditor.getValueAsString())) entityBeanPkgNameditor.setValue(getEntityPkgName(seamProjectName)); if ("".equals(testsPkgNameditor.getValueAsString())) testsPkgNameditor.setValue(getTestPkgName(seamProjectName)); if (!isWebProjectWizard()) { if ("".equals(ejbProjectNameditor.getValueAsString())) ejbProjectNameditor.setValue(getEJBProjectName(seamProjectName)); if ("".equals(earProjectNameditor.getValueAsString())) earProjectNameditor.setValue(getEARProjectName(seamProjectName)); } if ("".equals(testProjectNameditor.getValueAsString())) testProjectNameditor.setValue(getTestProjectName(seamProjectName)); }
public void propertyChanged(DataModelEvent event) { if (event.getPropertyName().equals(IJ2EEModuleFacetInstallDataModelProperties.CONFIG_FOLDER)) { model.setStringProperty( ISeamFacetDataModelProperties.WEB_CONTENTS_FOLDER, event.getProperty().toString()); } else if (event.getPropertyName().equals(IFacetDataModelProperties.FACET_PROJECT_NAME)) { String seamProjectName = event.getProperty().toString(); model.setStringProperty(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME, seamProjectName); sessionBeanPkgNameditor.setValue(getSessionPkgName(seamProjectName)); entityBeanPkgNameditor.setValue(getEntityPkgName(seamProjectName)); testsPkgNameditor.setValue(getTestPkgName(seamProjectName)); if (!isWebProjectWizard()) { ejbProjectNameditor.setValue(getEJBProjectName(seamProjectName)); earProjectNameditor.setValue(getEARProjectName(seamProjectName)); } testProjectNameditor.setValue(getTestProjectName(seamProjectName)); model.setStringProperty( ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME, getSessionPkgName(seamProjectName)); model.setStringProperty( ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_NAME, getEntityPkgName(seamProjectName)); model.setProperty( ISeamFacetDataModelProperties.TEST_PROJECT_CREATING, createTestProjectCheckboxeditor.getValue()); model.setStringProperty( ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME, getTestPkgName(seamProjectName)); model.setStringProperty( ISeamFacetDataModelProperties.SEAM_EAR_PROJECT, earProjectNameditor.getValueAsString()); model.setStringProperty( ISeamFacetDataModelProperties.SEAM_EJB_PROJECT, ejbProjectNameditor.getValueAsString()); model.setStringProperty( ISeamFacetDataModelProperties.SEAM_TEST_PROJECT, testProjectNameditor.getValueAsString()); } }
/** Creates Seam Facet Wizard Page contents */ public void createControl(Composite parent) { sync = new DataModelSynchronizer(model); jBossSeamHomeEditor = SeamWizardFactory.createSeamRuntimeSelectionFieldEditor( new SeamVersion[0], SeamFacetInstallDataModelProvider.getSeamRuntimeDefaultValue(model), new NewSeamRuntimeAction()); initializeDialogUnits(parent); Composite root = new Composite(parent, SWT.NONE); GridData gd = new GridData(); gd.horizontalSpan = 1; gd.horizontalAlignment = GridData.FILL; gd.grabExcessHorizontalSpace = true; gd.grabExcessVerticalSpace = false; GridLayout gridLayout = new GridLayout(1, false); root.setLayout(gridLayout); Group generalGroup = new Group(root, SWT.NONE); generalGroup.setLayoutData(gd); generalGroup.setText(SeamCoreMessages.SEAM_INSTALL_WIZARD_PAGE_GENERAL); gridLayout = new GridLayout(3, false); generalGroup.setLayout(gridLayout); registerEditor(jBossSeamHomeEditor, generalGroup, 3); jBossSeamHomeEditor.addPropertyChangeListener( new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent arg0) { Boolean testProject = canTestProjectBeCreated(); createTestProjectCheckboxeditor.setValue(testProject); createTestProjectCheckboxeditor.setEnabled(testProject); } }); Object deployAs = getDeployAsDefaultValue(); jBossAsDeployAsEditor.setValue(deployAs); registerEditor(jBossAsDeployAsEditor, generalGroup, 3); registerEditor(ejbProjectNameditor, generalGroup, 3); ejbProjectNameditor.setEnabled(deployAs.equals(ISeamFacetDataModelProperties.DEPLOY_AS_EAR)); registerEditor(earProjectNameditor, generalGroup, 3); earProjectNameditor.setEnabled(deployAs.equals(ISeamFacetDataModelProperties.DEPLOY_AS_EAR)); List<String> providers = new ArrayList<String>(); providers.add(SeamCoreMessages.SEAM_INSTALL_WIZARD_PAGE_COPY_LIBRARIES); providers.add(SeamCoreMessages.SEAM_INSTALL_WIZARD_PAGE_CONFIGURE_LATER); libraryListEditor = IFieldEditorFactory.INSTANCE.createComboEditor( ISeamFacetDataModelProperties.SEAM_LIBRARY_PROVIDER, SeamCoreMessages.SEAM_INSTALL_WIZARD_PAGE_LIBRARIES, providers, providers.get(0)); registerEditor(libraryListEditor, generalGroup, 3); jBossAsDeployAsEditor.addPropertyChangeListener( new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent arg0) { Boolean value = jBossAsDeployAsEditor.getValue() == ISeamFacetDataModelProperties.DEPLOY_AS_EAR; if (!isWebProjectWizard()) { ejbProjectNameditor.setEnabled(value.booleanValue()); earProjectNameditor.setEnabled(value.booleanValue()); } } }); gd = new GridData(); gd.horizontalSpan = 1; gd.horizontalAlignment = GridData.FILL; gd.grabExcessHorizontalSpace = true; gd.grabExcessVerticalSpace = false; databaseGroup = new Group(root, SWT.NONE); databaseGroup.setLayoutData(gd); databaseGroup.setText(SeamCoreMessages.SEAM_INSTALL_WIZARD_PAGE_DATABASE); gridLayout = new GridLayout(4, false); databaseGroup.setLayout(gridLayout); jBossHibernateDbTypeEditor = IFieldEditorFactory.INSTANCE.createComboEditor( ISeamFacetDataModelProperties.DB_TYPE, SeamCoreMessages.SEAM_INSTALL_WIZARD_PAGE_DATABASE_TYPE, Arrays.asList(HIBERNATE_HELPER.getDialectNames()), getDefaultDbType(), false); registerEditor(jBossHibernateDbTypeEditor, databaseGroup, 4); createDatabaseGoupControl(); Group generationGroup = new Group(root, SWT.NONE); gd = new GridData(); gd.horizontalSpan = 1; gd.horizontalAlignment = GridData.FILL; gd.grabExcessHorizontalSpace = true; gd.grabExcessVerticalSpace = false; generationGroup.setLayoutData(gd); generationGroup.setText(SeamCoreMessages.SEAM_INSTALL_WIZARD_PAGE_CODE_GENERATION); gridLayout = new GridLayout(3, false); generationGroup.setLayout(gridLayout); registerEditor(sessionBeanPkgNameditor, generationGroup, 3); registerEditor(entityBeanPkgNameditor, generationGroup, 3); registerEditor(createTestProjectCheckboxeditor, generationGroup, 3); createTestProjectCheckboxeditor.addPropertyChangeListener( new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent arg0) { Boolean value = (Boolean) createTestProjectCheckboxeditor.getValue(); testsPkgNameditor.setEnabled(value.booleanValue()); testProjectNameditor.setEnabled(value.booleanValue()); } }); registerEditor(testProjectNameditor, generationGroup, 3); registerEditor(testsPkgNameditor, generationGroup, 3); if (!isSeamProjectWizard()) { createTestProjectCheckboxeditor.setValue(false); createTestProjectCheckboxeditor.setEnabled(false); testProjectNameditor.setEnabled(false); testsPkgNameditor.setEnabled(false); if (!isWebProjectWizard()) { libraryListEditor.setValue(providers.get(1)); libraryListEditor.setEnabled(false); } } if (isWebProjectWizard()) { ejbProjectNameditor.setValue(""); ejbProjectNameditor.setEnabled(false); earProjectNameditor.setValue(""); earProjectNameditor.setEnabled(false); } setControl(root); if (validatorDelegate == null) { validatorDelegate = new DataModelValidatorDelegate(this.model, this); validatorDelegate.addValidatorForProperty( jBossSeamHomeEditor.getName(), SeamValidatorFactory.SEAM_RUNTIME_NAME_VALIDATOR); validatorDelegate.addValidatorForProperty( connProfileSelEditor.getName(), SeamValidatorFactory.CONNECTION_PROFILE_VALIDATOR); validatorDelegate.addValidatorForProperty( testsPkgNameditor.getName(), new PackageNameValidator(testsPkgNameditor.getName(), "tests")); // $NON-NLS-1$ validatorDelegate.addValidatorForProperty( entityBeanPkgNameditor.getName(), new PackageNameValidator( entityBeanPkgNameditor.getName(), "entity beans")); // $NON-NLS-1$ validatorDelegate.addValidatorForProperty( sessionBeanPkgNameditor.getName(), new PackageNameValidator( sessionBeanPkgNameditor.getName(), "session beans")); // $NON-NLS-1$ if (isSeamProjectWizard()) { validatorDelegate.addValidatorForProperty( IFacetDataModelProperties.FACET_PROJECT_NAME, new ProjectNamesDuplicationValidator(IFacetDataModelProperties.FACET_PROJECT_NAME)); } validatorDelegate.addValidatorForProperty( ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS, getDeploymentTypeValidator(getWizard())); validatorDelegate.addValidatorForProperty( ISeamFacetDataModelProperties.SEAM_EAR_PROJECT, new ProjectNamesDuplicationValidator(ISeamFacetDataModelProperties.SEAM_EAR_PROJECT)); validatorDelegate.addValidatorForProperty( ISeamFacetDataModelProperties.SEAM_EJB_PROJECT, new ProjectNamesDuplicationValidator(ISeamFacetDataModelProperties.SEAM_EJB_PROJECT)); validatorDelegate.addValidatorForProperty( ISeamFacetDataModelProperties.SEAM_TEST_PROJECT, new ProjectNamesDuplicationValidator(ISeamFacetDataModelProperties.SEAM_TEST_PROJECT)); } Dialog.applyDialogFont(parent); initDefaultWizardProperties(); Object parentDm = model.getProperty(FacetInstallDataModelProvider.MASTER_PROJECT_DM); if (parentDm != null) { ((IDataModel) parentDm).addListener(this); } }