Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 95508 Details for
Bug 191720
Unable to create JPA Project without a database connection when at least one available
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Added <None> to the connection combo
uichanges (text/plain), 28.43 KB, created by
Pascal Filion
on 2008-04-10 08:24:14 EDT
(
hide
)
Description:
Added <None> to the connection combo
Filename:
MIME Type:
Creator:
Pascal Filion
Created:
2008-04-10 08:24:14 EDT
Size:
28.43 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jpt.core >Index: src/org/eclipse/jpt/core/internal/facet/JpaFacetDataModelProvider.java >=================================================================== >RCS file: /cvsroot/webtools/org.eclipse.jpa/components/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetDataModelProvider.java,v >retrieving revision 1.12 >diff -u -r1.12 JpaFacetDataModelProvider.java >--- src/org/eclipse/jpt/core/internal/facet/JpaFacetDataModelProvider.java 26 Mar 2008 20:02:10 -0000 1.12 >+++ src/org/eclipse/jpt/core/internal/facet/JpaFacetDataModelProvider.java 10 Apr 2008 12:23:03 -0000 >@@ -3,14 +3,13 @@ > * This program and the accompanying materials are made available under the > * terms of the Eclipse Public License v1.0, which accompanies this distribution > * and is available at http://www.eclipse.org/legal/epl-v10.html. >- * >+ * > * Contributors: > * Oracle - initial API and implementation > ******************************************************************************/ > package org.eclipse.jpt.core.internal.facet; > > import java.util.Set; >- > import org.eclipse.core.runtime.IStatus; > import org.eclipse.core.runtime.Status; > import org.eclipse.jdt.core.JavaCore; >@@ -50,8 +49,8 @@ > public JpaFacetDataModelProvider() { > super(); > } >- >- >+ >+ > @Override > public Set<String> getPropertyNames() { > @SuppressWarnings("unchecked") >@@ -65,7 +64,7 @@ > propertyNames.add(CREATE_ORM_XML); > return propertyNames; > } >- >+ > @Override > public Object getDefaultProperty(String propertyName) { > if (propertyName.equals(FACET_ID)) { >@@ -111,14 +110,14 @@ > String[] libraries = CollectionTools.sort(JavaCore.getUserLibraryNames()); > DataModelPropertyDescriptor[] descriptors = new DataModelPropertyDescriptor[libraries.length + 1]; > descriptors[0] = new DataModelPropertyDescriptor("", RUNTIME_NONE); >- >+ > int i = 1; > for (String library : libraries) { > descriptors[i++] = new DataModelPropertyDescriptor(library, library); >- } >+ } > return descriptors; > } >- >+ > return super.getValidPropertyDescriptors(propertyName); > } > >@@ -159,6 +158,9 @@ > } > > private IStatus validateConnectionName(String connectionName) { >+ if (StringTools.stringIsEmpty(connectionName)) { >+ return OK_STATUS; >+ } > return JptDbPlugin.instance().getConnectionProfileRepository().connectionProfileNamed(connectionName).isActive() ? > OK_STATUS > : >#P org.eclipse.jpt.ui >Index: property_files/jpt_ui.properties >=================================================================== >RCS file: /cvsroot/webtools/org.eclipse.jpa/components/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui.properties,v >retrieving revision 1.13 >diff -u -r1.13 jpt_ui.properties >--- property_files/jpt_ui.properties 31 Mar 2008 20:12:39 -0000 1.13 >+++ property_files/jpt_ui.properties 10 Apr 2008 12:23:05 -0000 >@@ -87,6 +87,7 @@ > JpaFacetWizardPage_discoverClassesButton=Discover annotated classes automatically > JpaFacetWizardPage_listClassesButton=Annotated classes must be listed in persistence.xml > JpaFacetWizardPage_createOrmXmlButton=Create orm.xml >+JpaFacetWizardPage_none=<None> > > MapAsComposite_basic=basic > MapAsComposite_basic_default=basic (default) >Index: src/org/eclipse/jpt/ui/internal/properties/JpaProjectPropertiesPage.java >=================================================================== >RCS file: /cvsroot/webtools/org.eclipse.jpa/components/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/properties/JpaProjectPropertiesPage.java,v >retrieving revision 1.13 >diff -u -r1.13 JpaProjectPropertiesPage.java >--- src/org/eclipse/jpt/ui/internal/properties/JpaProjectPropertiesPage.java 26 Mar 2008 23:08:43 -0000 1.13 >+++ src/org/eclipse/jpt/ui/internal/properties/JpaProjectPropertiesPage.java 10 Apr 2008 12:23:06 -0000 >@@ -3,7 +3,7 @@ > * This program and the accompanying materials are made available under the > * terms of the Eclipse Public License v1.0, which accompanies this distribution > * and is available at http://www.eclipse.org/legal/epl-v10.html. >- * >+ * > * Contributors: > * Oracle - initial API and implementation > ******************************************************************************/ >@@ -37,6 +37,7 @@ > import org.eclipse.jpt.ui.internal.JpaHelpContextIds; > import org.eclipse.jpt.ui.internal.JptUiMessages; > import org.eclipse.jpt.utility.internal.CollectionTools; >+import org.eclipse.jpt.utility.internal.StringTools; > import org.eclipse.swt.SWT; > import org.eclipse.swt.events.SelectionAdapter; > import org.eclipse.swt.events.SelectionEvent; >@@ -57,43 +58,43 @@ > import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager; > import org.eclipse.wst.common.project.facet.core.runtime.IRuntime; > >-public class JpaProjectPropertiesPage >+public class JpaProjectPropertiesPage > extends DataModelPropertyPage > implements JpaFacetDataModelProperties > { > private PlatformGroup platformGroup; >- >+ > private ConnectionGroup connectionGroup; >- >+ > private PersistentClassManagementGroup persistentClassManagementGroup; >- >- >+ >+ > /** > * Constructor for SamplePropertyPage. > */ > public JpaProjectPropertiesPage() { > super(DataModelFactory.createDataModel(new JpaFacetDataModelProvider())); > } >- >- >+ >+ > @Override > protected Composite createTopLevelComposite(Composite parent) { > Composite composite = new Composite(parent, SWT.NULL); > GridLayout layout = new GridLayout(); > composite.setLayout(layout); >- >+ > platformGroup = new PlatformGroup(composite); > connectionGroup = new ConnectionGroup(composite); > persistentClassManagementGroup = new PersistentClassManagementGroup(composite); >- >+ > setRuntime(); >- >+ > Dialog.applyDialogFont(parent); > PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, JpaHelpContextIds.PROPERTIES_JAVA_PERSISTENCE); >- >+ > return composite; > } >- >+ > private void setRuntime() { > IFacetedProject facetedProject = null; > try { >@@ -106,7 +107,7 @@ > IRuntime runtime = facetedProject.getPrimaryRuntime(); > model.setProperty(JpaFacetDataModelProperties.RUNTIME, runtime); > } >- >+ > @Override > protected String[] getValidationPropertyNames() { > return new String[] { >@@ -115,11 +116,11 @@ > JpaFacetDataModelProperties.DISCOVER_ANNOTATED_CLASSES > }; > } >- >+ > protected JpaProject getJpaProject() { > return (JpaProject) this.getElement().getAdapter(JpaProject.class); > } >- >+ > Combo createCombo(Composite container, boolean fillHorizontal) { > Combo combo = new Combo(container, SWT.BORDER | SWT.SINGLE | SWT.READ_ONLY); > if (fillHorizontal) { >@@ -130,7 +131,7 @@ > } > return combo; > } >- >+ > Button createButton(Composite container, int span, String text, int style) { > Button button = new Button(container, SWT.NONE | style); > button.setText(text); >@@ -139,14 +140,14 @@ > button.setLayoutData(gd); > return button; > } >- >+ > @Override > protected void performDefaults() { > platformGroup.performDefaults(); > connectionGroup.performDefaults(); > persistentClassManagementGroup.performDefaults(); > } >- >+ > @Override > public boolean performOk() { > JpaProject jpaProject = this.getJpaProject(); >@@ -188,13 +189,13 @@ > } > return true; > } >- >+ > private static void buildProject(final IProject project) { > IRunnableWithProgress r= new IRunnableWithProgress() { > public void run(IProgressMonitor pm) throws InvocationTargetException { > try { > project.build(IncrementalProjectBuilder.FULL_BUILD, pm); >- } >+ } > catch (CoreException ce) { > JptUiPlugin.log(ce); > } >@@ -206,13 +207,13 @@ > catch (InterruptedException ie) { /* nothing to do */ } > catch (InvocationTargetException ie) { /* nothing to do */ } > } >- >- >+ >+ > private final class PlatformGroup > { > final ComboViewer platformCombo; >- >- >+ >+ > public PlatformGroup(Composite composite) { > Group group = new Group(composite, SWT.NONE); > group.setText(JptUiMessages.JpaFacetWizardPage_platformLabel); >@@ -220,18 +221,18 @@ > group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); > // TODO > // PlatformUI.getWorkbench().getHelpSystem().setHelp(group, IDaliHelpContextIds.NEW_JPA_PROJECT_CONTENT_PAGE_DATABASE); >- >+ > platformCombo = new ComboViewer(createCombo(group, true)); > platformCombo.setContentProvider( > new IStructuredContentProvider() { > public Object[] getElements(Object inputElement) { > return CollectionTools.array(JpaPlatformRegistry.instance().jpaPlatformIds()); > } >- >+ > public void dispose() { > // do nothing > } >- >+ > public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { > // do nothing > } >@@ -242,23 +243,23 @@ > public Image getImage(Object element) { > return null; > } >- >+ > public String getText(Object element) { > return JpaPlatformRegistry.instance().getJpaPlatformLabel((String) element); > } >- >+ > public void addListener(ILabelProviderListener listener) { > // do nothing > } >- >+ > public void removeListener(ILabelProviderListener listener) { > // do nothing > } >- >+ > public void dispose() { > // do nothing > } >- >+ > public boolean isLabelProperty(Object element, String property) { > return true; > } >@@ -275,28 +276,28 @@ > platformCombo.setInput("null input"); > performDefaults(); > } >- >+ > void performDefaults() { > String platformId = getJpaProject().getJpaPlatform().getId(); > model.setProperty(PLATFORM_ID, platformId); > platformCombo.setSelection(new StructuredSelection(platformId)); > } > } >- >- >+ >+ > private final class ConnectionGroup > { > final Combo connectionCombo; >- >+ > private Link connectionLink; >- >- >+ >+ > public ConnectionGroup(Composite composite) { > Group group = new Group(composite, SWT.NONE); > group.setText(JptUiMessages.JpaFacetWizardPage_connectionLabel); > group.setLayout(new GridLayout()); > group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >- >+ > connectionCombo = createCombo(group, true); > PlatformUI.getWorkbench().getHelpSystem().setHelp(group, JpaHelpContextIds.PROPERTIES_JAVA_PERSISTENCE_CONNECTION); > connectionCombo.addSelectionListener( >@@ -304,14 +305,19 @@ > public void widgetDefaultSelected(SelectionEvent e) { > widgetSelected(e); > } >- >+ > public void widgetSelected(SelectionEvent e) { >- model.setProperty(CONNECTION, connectionCombo.getItem(connectionCombo.getSelectionIndex())); >+ int index = connectionCombo.getSelectionIndex(); >+ String connection = connectionCombo.getItem(index); >+ if (index == 0) { >+ connection = null; >+ } >+ model.setProperty(CONNECTION, connection); > } > } > ); > fillConnections(); >- >+ > connectionLink = new Link(group, SWT.NONE); > GridData data = new GridData(GridData.END, GridData.CENTER, false, false); > data.horizontalSpan = 2; >@@ -321,7 +327,7 @@ > new SelectionAdapter() { > @Override > public void widgetSelected(SelectionEvent e) { >- openNewConnectionWizard(); >+ openNewConnectionWizard(); > } > } > ); >@@ -331,23 +337,24 @@ > private void fillConnections() { > //clear out connection entries from previous login. > connectionCombo.removeAll(); >- >+ connectionCombo.add(JptUiMessages.JpaFacetWizardPage_none); >+ > for (Iterator<String> stream = JptDbPlugin.instance().getConnectionProfileRepository().connectionProfileNames(); stream.hasNext(); ) { > connectionCombo.add(stream.next()); > } > } >- >+ > void performDefaults() { > String connectionName = getJpaProject().getDataSource().getConnectionProfileName(); > model.setProperty(CONNECTION, connectionName); >- if (connectionName == null) { >- connectionCombo.clearSelection(); >+ if (StringTools.stringIsEmpty(connectionName)) { >+ connectionCombo.select(0); > } > else { > connectionCombo.setText(connectionName); > } > } >- >+ > void openNewConnectionWizard() { > String connectionName = DTPUiTools.createNewProfile(); > if (connectionName != null) { >@@ -357,48 +364,48 @@ > } > } > } >- >- >+ >+ > private final class PersistentClassManagementGroup > { > final Button discoverClassesButton; >- >+ > final Button listClassesButton; >- >- >+ >+ > public PersistentClassManagementGroup(Composite composite) { > Group group = new Group(composite, SWT.NONE); > group.setText(JptUiMessages.JpaFacetWizardPage_persistentClassManagementLabel); > group.setLayout(new GridLayout()); > group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); > PlatformUI.getWorkbench().getHelpSystem().setHelp(group, JpaHelpContextIds.NEW_JPA_PROJECT_CONTENT_PAGE_CLASSPATH); >- >+ > discoverClassesButton = createButton(group, 1, JptUiMessages.JpaFacetWizardPage_discoverClassesButton, SWT.RADIO); > discoverClassesButton.addSelectionListener( > new SelectionListener() { > public void widgetDefaultSelected(SelectionEvent e) { > widgetSelected(e); > } >- >+ > public void widgetSelected(SelectionEvent e) { > model.setBooleanProperty(DISCOVER_ANNOTATED_CLASSES, true); > } > } > ); >- >+ > listClassesButton = createButton(group, 1, JptUiMessages.JpaFacetWizardPage_listClassesButton, SWT.RADIO); > listClassesButton.addSelectionListener( > new SelectionListener() { > public void widgetDefaultSelected(SelectionEvent e) { > widgetSelected(e); > } >- >+ > public void widgetSelected(SelectionEvent e) { > model.setBooleanProperty(DISCOVER_ANNOTATED_CLASSES, false); > } > } > ); >- >+ > model.addListener( > new IDataModelListener() { > public void propertyChanged(DataModelEvent event) { >@@ -410,10 +417,10 @@ > } > } > ); >- >+ > performDefaults(); > } >- >+ > void performDefaults() { > boolean discoverClasses = getJpaProject().discoversAnnotatedClasses(); > model.setProperty(DISCOVER_ANNOTATED_CLASSES, Boolean.valueOf(discoverClasses)); >Index: src/org/eclipse/jpt/ui/internal/wizards/JpaFacetWizardPage.java >=================================================================== >RCS file: /cvsroot/webtools/org.eclipse.jpa/components/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/JpaFacetWizardPage.java,v >retrieving revision 1.19 >diff -u -r1.19 JpaFacetWizardPage.java >--- src/org/eclipse/jpt/ui/internal/wizards/JpaFacetWizardPage.java 26 Mar 2008 23:08:43 -0000 1.19 >+++ src/org/eclipse/jpt/ui/internal/wizards/JpaFacetWizardPage.java 10 Apr 2008 12:23:06 -0000 >@@ -3,7 +3,7 @@ > * This program and the accompanying materials are made available under the > * terms of the Eclipse Public License v1.0, which accompanies this distribution > * and is available at http://www.eclipse.org/legal/epl-v10.html. >- * >+ * > * Contributors: > * Oracle - initial API and implementation > ******************************************************************************/ >@@ -55,39 +55,39 @@ > import org.eclipse.wst.common.project.facet.ui.ModifyFacetedProjectWizard; > import org.eclipse.wst.web.ui.internal.wizards.DataModelFacetInstallPage; > >-public class JpaFacetWizardPage >+public class JpaFacetWizardPage > extends DataModelFacetInstallPage > implements JpaFacetDataModelProperties >-{ >- >+{ >+ > public JpaFacetWizardPage() { > super("jpt.jpa.facet.install.page"); //$NON-NLS-1$ > setTitle(JptUiMessages.JpaFacetWizardPage_title); > setDescription(JptUiMessages.JpaFacetWizardPage_description); > setImageDescriptor(JptUiPlugin.getImageDescriptor(JptUiIcons.JPA_WIZ_BANNER)); > } >- >- >+ >+ > @Override > protected Composite createTopLevelComposite(Composite parent) { > Composite composite = new Composite(parent, SWT.NULL); > GridLayout layout = new GridLayout(); > composite.setLayout(layout); >- >+ > new PlatformGroup(composite); > new ConnectionGroup(composite); > new ClasspathConfigGroup(composite); > new PersistentClassManagementGroup(composite); > new OrmXmlGroup(composite); >- >+ > setUpRuntimeListener(); >- >+ > Dialog.applyDialogFont(parent); > PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, JpaHelpContextIds.DIALOG_JPA_FACET); >- >+ > return composite; > } >- >+ > private void setUpRuntimeListener() { > final IFacetedProjectWorkingCopy wc = ( (ModifyFacetedProjectWizard) getWizard() ).getFacetedProjectWorkingCopy(); > // must do it manually the first time >@@ -101,7 +101,7 @@ > IFacetedProjectEvent.Type.PRIMARY_RUNTIME_CHANGED > ); > } >- >+ > private Button createButton(Composite container, int span, String text, int style) { > Button button = new Button(container, SWT.NONE | style); > button.setText(text); >@@ -110,7 +110,7 @@ > button.setLayoutData(gd); > return button; > } >- >+ > private Combo createCombo(Composite container, int span, boolean fillHorizontal) { > Combo combo = new Combo(container, SWT.BORDER | SWT.SINGLE | SWT.READ_ONLY); > GridData gd; >@@ -124,7 +124,7 @@ > combo.setLayoutData(gd); > return combo; > } >- >+ > @Override > protected String[] getValidationPropertyNames() { > return new String[] { >@@ -135,7 +135,7 @@ > DISCOVER_ANNOTATED_CLASSES > }; > } >- >+ > @Override > public boolean isPageComplete() { > if (! super.isPageComplete()) { >@@ -145,7 +145,7 @@ > return (model.validate().getSeverity() != IStatus.ERROR); > } > } >- >+ > @Override > public void setVisible(boolean visible) { > super.setVisible(visible); >@@ -153,29 +153,29 @@ > setErrorMessage(); > } > } >- >- >+ >+ > private final class PlatformGroup > { > private final ComboViewer platformCombo; >- >- >+ >+ > public PlatformGroup(Composite composite) { > Group group = new Group(composite, SWT.NONE); > group.setText(JptUiMessages.JpaFacetWizardPage_platformLabel); > group.setLayout(new GridLayout()); > group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); > PlatformUI.getWorkbench().getHelpSystem().setHelp(group, JpaHelpContextIds.DIALOG_JPA_PLATFORM); >- >+ > platformCombo = new ComboViewer(createCombo(group, 1, true)); > platformCombo.setContentProvider( > new IStructuredContentProvider() { > public Object[] getElements(Object inputElement) { > return CollectionTools.array(JpaPlatformRegistry.instance().jpaPlatformIds()); > } >- >+ > public void dispose() {} >- >+ > public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {} > } > ); >@@ -184,17 +184,17 @@ > public Image getImage(Object element) { > return null; > } >- >+ > public String getText(Object element) { > return JpaPlatformRegistry.instance().getJpaPlatformLabel((String) element); > } >- >+ > public void addListener(ILabelProviderListener listener) {} >- >+ > public void removeListener(ILabelProviderListener listener) {} >- >+ > public void dispose() {} >- >+ > public boolean isLabelProperty(Object element, String property) { > return true; > } >@@ -214,44 +214,43 @@ > } > } > } >- >- >+ >+ > private final class ConnectionGroup > { > private final Combo connectionCombo; >- >+ > private Link connectionLink; >- >- >+ >+ > public ConnectionGroup(Composite composite) { > Group group = new Group(composite, SWT.NONE); > group.setText(JptUiMessages.JpaFacetWizardPage_connectionLabel); > group.setLayout(new GridLayout()); > group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); > PlatformUI.getWorkbench().getHelpSystem().setHelp(group, JpaHelpContextIds.NEW_JPA_PROJECT_CONTENT_PAGE_DATABASE); >- >+ > connectionCombo = createCombo(group, 1, true); > connectionCombo.addSelectionListener( > new SelectionListener() { > public void widgetSelected(SelectionEvent e) { >- model.setProperty(CONNECTION, connectionCombo.getItem(connectionCombo.getSelectionIndex())); >+ int index = connectionCombo.getSelectionIndex(); >+ String connection = connectionCombo.getItem(index); >+ if (index == 0) { >+ connection = null; >+ } >+ model.setProperty(CONNECTION, connection); > } >- >+ > public void widgetDefaultSelected(SelectionEvent e) { > widgetSelected(e); > } > } > ); > fillConnections(); >- if (connectionCombo.getItemCount() > 0) { >- connectionCombo.select(0); >- model.setProperty(CONNECTION, connectionCombo.getItem(0)); >- } >- else { >- connectionCombo.clearSelection(); >- model.setProperty(CONNECTION, null); >- } >- >+ connectionCombo.select(0); >+ model.setProperty(CONNECTION, null); >+ > connectionLink = new Link(group, SWT.NONE); > GridData data = new GridData(GridData.END, GridData.CENTER, false, false); > data.horizontalSpan = 2; >@@ -261,7 +260,7 @@ > new SelectionAdapter() { > @Override > public void widgetSelected(SelectionEvent e) { >- openNewConnectionWizard(); >+ openNewConnectionWizard(); > } > } > ); >@@ -270,12 +269,13 @@ > private void fillConnections() { > //clear out connection entries from previous login. > connectionCombo.removeAll(); >- >- for (Iterator stream = JptDbPlugin.instance().getConnectionProfileRepository().connectionProfileNames(); stream.hasNext(); ) { >- connectionCombo.add((String) stream.next()); >+ connectionCombo.add(JptUiMessages.JpaFacetWizardPage_none); >+ >+ for (Iterator<String> stream = JptDbPlugin.instance().getConnectionProfileRepository().connectionProfileNames(); stream.hasNext(); ) { >+ connectionCombo.add(stream.next()); > } > } >- >+ > private void openNewConnectionWizard() { > String connectionName = DTPUiTools.createNewProfile(); > if (connectionName != null) { >@@ -285,31 +285,31 @@ > } > } > } >- >- >+ >+ > private final class ClasspathConfigGroup > { > private final Button useServerLibButton; >- >+ > private final Button specifyLibButton; >- >+ > private final Combo jpaLibCombo; >- >+ > private final Link jpaPrefsLink; >- >+ > private final Link userLibsLink; >- >- >- >+ >+ >+ > public ClasspathConfigGroup(Composite composite) { > Group group = new Group(composite, SWT.NONE); > group.setText(JptUiMessages.JpaFacetWizardPage_jpaImplementationLabel); > group.setLayout(new GridLayout(2, false)); > group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); > PlatformUI.getWorkbench().getHelpSystem().setHelp(group, JpaHelpContextIds.NEW_JPA_PROJECT_CONTENT_PAGE_CLASSPATH); >- >+ > boolean useServerLib = model.getBooleanProperty(USE_SERVER_JPA_IMPLEMENTATION); >- >+ > useServerLibButton = createButton(group, 2, JptUiMessages.JpaFacetWizardPage_userServerLibLabel, SWT.RADIO); > useServerLibButton.setSelection(useServerLib); > useServerLibButton.addSelectionListener( >@@ -317,13 +317,13 @@ > public void widgetDefaultSelected(SelectionEvent e) { > widgetSelected(e); > } >- >+ > public void widgetSelected(SelectionEvent e) { > model.setBooleanProperty(USE_SERVER_JPA_IMPLEMENTATION, true); > } > } > ); >- >+ > specifyLibButton = createButton(group, 1, JptUiMessages.JpaFacetWizardPage_specifyLibLabel, SWT.RADIO); > specifyLibButton.setSelection(! useServerLib); > specifyLibButton.addSelectionListener( >@@ -331,16 +331,16 @@ > public void widgetDefaultSelected(SelectionEvent e) { > widgetSelected(e); > } >- >+ > public void widgetSelected(SelectionEvent e) { > model.setBooleanProperty(USE_SERVER_JPA_IMPLEMENTATION, false); > } > } > ); >- >+ > jpaLibCombo = createCombo(group, 1, true); > synchHelper.synchCombo(jpaLibCombo, JPA_LIBRARY, null); >- >+ > model.addListener( > new IDataModelListener() { > public void propertyChanged(DataModelEvent event) { >@@ -353,7 +353,7 @@ > } > } > ); >- >+ > jpaPrefsLink = new Link(group, SWT.NONE); > GridData data = new GridData(GridData.END, GridData.CENTER, false, false); > data.horizontalSpan = 2; >@@ -363,11 +363,11 @@ > new SelectionAdapter() { > @Override > public void widgetSelected(SelectionEvent e) { >- promptToConfigJpaPrefs(); >+ promptToConfigJpaPrefs(); > } > } > ); >- >+ > userLibsLink = new Link(group, SWT.NONE); > data = new GridData(GridData.END, GridData.CENTER, false, false); > data.horizontalSpan = 2; >@@ -377,16 +377,16 @@ > new SelectionAdapter() { > @Override > public void widgetSelected(SelectionEvent e) { >- promptToConfigUserLibraries(); >+ promptToConfigUserLibraries(); > } > } > ); > } >- >+ > private void promptToConfigJpaPrefs() { >- PreferenceDialog dlg = >+ PreferenceDialog dlg = > PreferencesUtil.createPreferenceDialogOn( >- getShell(), >+ getShell(), > JpaPreferencePage.ID, > new String[] {JpaPreferencePage.ID}, > null); >@@ -394,11 +394,11 @@ > model.notifyPropertyChange(JPA_LIBRARY, IDataModel.VALID_VALUES_CHG); > model.notifyPropertyChange(JPA_LIBRARY, IDataModel.DEFAULT_CHG); > } >- >+ > private void promptToConfigUserLibraries() { >- PreferenceDialog dlg = >+ PreferenceDialog dlg = > PreferencesUtil.createPreferenceDialogOn( >- getShell(), >+ getShell(), > UserLibraryPreferencePage.ID, > new String[] {UserLibraryPreferencePage.ID}, > null); >@@ -406,24 +406,24 @@ > model.notifyPropertyChange(JPA_LIBRARY, IDataModel.VALID_VALUES_CHG); > } > } >- >- >+ >+ > private final class PersistentClassManagementGroup > { > private final Button discoverClassesButton; >- >+ > private final Button listClassesButton; >- >- >+ >+ > public PersistentClassManagementGroup(Composite composite) { > Group group = new Group(composite, SWT.NONE); > group.setText(JptUiMessages.JpaFacetWizardPage_persistentClassManagementLabel); > group.setLayout(new GridLayout()); > group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); > PlatformUI.getWorkbench().getHelpSystem().setHelp(group, JpaHelpContextIds.NEW_JPA_PROJECT_CONTENT_PAGE_CLASSPATH); >- >+ > boolean discoverClasses = model.getBooleanProperty(DISCOVER_ANNOTATED_CLASSES); >- >+ > discoverClassesButton = createButton(group, 1, JptUiMessages.JpaFacetWizardPage_discoverClassesButton, SWT.RADIO); > discoverClassesButton.setSelection(discoverClasses); > discoverClassesButton.addSelectionListener( >@@ -431,13 +431,13 @@ > public void widgetDefaultSelected(SelectionEvent e) { > widgetSelected(e); > } >- >+ > public void widgetSelected(SelectionEvent e) { > model.setBooleanProperty(DISCOVER_ANNOTATED_CLASSES, true); > } > } > ); >- >+ > listClassesButton = createButton(group, 1, JptUiMessages.JpaFacetWizardPage_listClassesButton, SWT.RADIO); > listClassesButton.setSelection(! discoverClasses); > listClassesButton.addSelectionListener( >@@ -445,13 +445,13 @@ > public void widgetDefaultSelected(SelectionEvent e) { > widgetSelected(e); > } >- >+ > public void widgetSelected(SelectionEvent e) { > model.setBooleanProperty(DISCOVER_ANNOTATED_CLASSES, false); > } > } > ); >- >+ > model.addListener( > new IDataModelListener() { > public void propertyChanged(DataModelEvent event) { >@@ -465,19 +465,19 @@ > ); > } > } >- >- >+ >+ > private final class OrmXmlGroup > { > private final Button createOrmXmlButton; >- >- >+ >+ > public OrmXmlGroup(Composite composite) { > Composite group = new Composite(composite, SWT.NONE); > group.setLayout(new GridLayout()); > group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); > PlatformUI.getWorkbench().getHelpSystem().setHelp(group, JpaHelpContextIds.DIALOG_CREATE_ORM); >- >+ > createOrmXmlButton = new Button(group, SWT.CHECK); > createOrmXmlButton.setText(JptUiMessages.JpaFacetWizardPage_createOrmXmlButton); > createOrmXmlButton.setSelection(model.getBooleanProperty(CREATE_ORM_XML)); >@@ -486,7 +486,7 @@ > public void widgetDefaultSelected(SelectionEvent e) { > widgetSelected(e); > } >- >+ > public void widgetSelected(SelectionEvent e) { > model.setBooleanProperty(CREATE_ORM_XML, createOrmXmlButton.getSelection()); > } >Index: src/org/eclipse/jpt/ui/internal/JptUiMessages.java >=================================================================== >RCS file: /cvsroot/webtools/org.eclipse.jpa/components/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiMessages.java,v >retrieving revision 1.16 >diff -u -r1.16 JptUiMessages.java >--- src/org/eclipse/jpt/ui/internal/JptUiMessages.java 31 Mar 2008 20:12:38 -0000 1.16 >+++ src/org/eclipse/jpt/ui/internal/JptUiMessages.java 10 Apr 2008 12:23:05 -0000 >@@ -71,6 +71,7 @@ > public static String JpaFacetWizardPage_jpaImplementationLabel; > public static String JpaFacetWizardPage_jpaPrefsLink; > public static String JpaFacetWizardPage_listClassesButton; >+ public static String JpaFacetWizardPage_none; > public static String JpaFacetWizardPage_persistentClassManagementLabel; > public static String JpaFacetWizardPage_platformLabel; > public static String JpaFacetWizardPage_specifyLibLabel;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
neil.hauge
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 191720
: 95508