Author: dgeraskov
Date: 2012-08-15 09:47:16 -0400 (Wed, 15 Aug 2012)
New Revision: 43045
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/AddMappingListPane.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/Messages.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/messages.properties
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/.settings/org.eclipse.jdt.core.prefs
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/META-INF/MANIFEST.MF
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic/Hibernate.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/HibernateClassRef.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePersistenceUnitClassesComposite.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePersistenceUnitGeneralComposite.java
Log:
https://issues.jboss.org/browse/JBIDE-12429
Update ui in persistent.xml editor General tab for adding package-infos
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/.settings/org.eclipse.jdt.core.prefs
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/.settings/org.eclipse.jdt.core.prefs 2012-08-15
12:28:15 UTC (rev 43044)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/.settings/org.eclipse.jdt.core.prefs 2012-08-15
13:47:16 UTC (rev 43045)
@@ -1,5 +1,9 @@
-#Fri Apr 01 10:54:34 EEST 2011
eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
@@ -9,6 +13,7 @@
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
@@ -16,33 +21,48 @@
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
@@ -55,6 +75,7 @@
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/META-INF/MANIFEST.MF
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/META-INF/MANIFEST.MF 2012-08-15
12:28:15 UTC (rev 43044)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/META-INF/MANIFEST.MF 2012-08-15
13:47:16 UTC (rev 43045)
@@ -32,7 +32,8 @@
org.jboss.tools.hibernate.jpt.core.internal.context,
org.jboss.tools.hibernate.jpt.core.internal.context.basic,
org.jboss.tools.hibernate.jpt.core.internal.context.java,
- org.jboss.tools.hibernate.jpt.core.internal.context.orm
+ org.jboss.tools.hibernate.jpt.core.internal.context.orm,
+ org.jboss.tools.hibernate.jpt.core.internal.context.persistence
Bundle-Localization: plugin
Bundle-Activator: org.jboss.tools.hibernate.jpt.core.internal.HibernateJptPlugin
Bundle-ActivationPolicy: lazy
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic/Hibernate.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic/Hibernate.java 2012-08-15
12:28:15 UTC (rev 43044)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/basic/Hibernate.java 2012-08-15
13:47:16 UTC (rev 43045)
@@ -19,6 +19,7 @@
// Hibernate package
String PACKAGE = "org.hibernate.annotations"; //$NON-NLS-1$
String PACKAGE_ = PACKAGE + "."; //$NON-NLS-1$
+ String PACKAGE_INFO_JAVA = "pacakge-info.java"; //$NON-NLS-1$
// ********** API **********
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/HibernateClassRef.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/HibernateClassRef.java 2012-08-15
12:28:15 UTC (rev 43044)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/persistence/HibernateClassRef.java 2012-08-15
13:47:16 UTC (rev 43045)
@@ -27,7 +27,6 @@
import org.jboss.tools.hibernate.jpt.core.internal.HibernateAbstractJpaFactory;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJptPlugin;
import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernatePackageInfo;
-import
org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernatePackageInfoImpl;
import org.jboss.tools.hibernate.jpt.core.internal.context.java.JavaPackageInfo;
@@ -51,6 +50,10 @@
*/
public HibernateClassRef(PersistenceUnit parent, XmlJavaClassRef xmlJavaClassRef) {
super(parent, xmlJavaClassRef, xmlJavaClassRef.getJavaClass());
+ JavaResourcePackage resourcePackage = this.resolveJavaResourcePackage();
+ if (resourcePackage != null){
+ this.javaPackageInfo = this.buildJavaPackageInfo(resourcePackage);
+ }
}
/**
@@ -59,6 +62,10 @@
*/
public HibernateClassRef(PersistenceUnit parent, String className) {
super(parent, null, className);
+ JavaResourcePackage resourcePackage = this.resolveJavaResourcePackage();
+ if (resourcePackage != null){
+ this.javaPackageInfo = this.buildJavaPackageInfo(resourcePackage);
+ }
}
@Override
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/AddMappingListPane.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/AddMappingListPane.java
(rev 0)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/AddMappingListPane.java 2012-08-15
13:47:16 UTC (rev 43045)
@@ -0,0 +1,101 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.hibernate.jpt.ui.internal.persistence.details;
+
+import org.eclipse.jface.viewers.IBaseLabelProvider;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jpt.common.ui.internal.widgets.AddRemoveListPane;
+import org.eclipse.jpt.common.ui.internal.widgets.Pane;
+import
org.eclipse.jpt.common.utility.internal.model.value.swing.ObjectListSelectionModel;
+import org.eclipse.jpt.common.utility.model.value.ListValueModel;
+import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
+import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
+import org.eclipse.jpt.jpa.ui.internal.persistence.JptUiPersistenceMessages;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ *
+ *
+ * @author Dmitry Geraskov (geraskov(a)gmail.com)
+ *
+ */
+public class AddMappingListPane extends AddRemoveListPane<PersistenceUnit> {
+
+ private Button addButton;
+
+ private ExtendedAdapter adapter;
+
+ public AddMappingListPane(Pane<? extends PersistenceUnit> parentPane,
+ Composite parent,
+ ExtendedAdapter adapter,
+ ListValueModel<?> listHolder,
+ ModifiablePropertyValueModel<?> selectedItemHolder,
+ ILabelProvider labelProvider,
+ String helpId) {
+ super(parentPane, parent, adapter, listHolder, selectedItemHolder, labelProvider,
helpId);
+ }
+
+ @Override
+ protected void initialize(
+ org.eclipse.jpt.common.ui.internal.widgets.AddRemovePane.Adapter adapter,
+ ListValueModel<?> listHolder,
+ ModifiablePropertyValueModel<?> selectedItemHolder,
+ IBaseLabelProvider labelProvider) {
+ super.initialize(adapter, listHolder, selectedItemHolder, labelProvider);
+ this.adapter = (ExtendedAdapter) adapter;
+ }
+
+ @Override
+ protected void addCustomButtonAfterAddButton(Composite container,
+ String helpId) {
+ // Add package button
+ this.addButton = addUnmanagedButton(container,
+ adapter.addPackageButtonText(),
+ buildAddPackageItemAction()
+ );
+ addAlignRight(this.addButton);
+ }
+
+ private Runnable buildAddPackageItemAction() {
+ return new Runnable() {
+ public void run() {
+ adapter.addPackage(getSelectionModel());
+ }
+ };
+ }
+
+}
+
+abstract class ExtendedAdapter extends AddRemoveListPane.AbstractAdapter {
+
+ @Override
+ public String addButtonText() {
+ return Messages.AddMappingListPane_Add_Class;
+ }
+
+ public String addPackageButtonText() {
+ return Messages.AddMappingListPane_Add_Package;
+ }
+
+ @Override
+ public boolean hasOptionalButton() {
+ return true;
+ }
+
+ @Override
+ public String optionalButtonText() {
+ return JptUiPersistenceMessages.PersistenceUnitClassesComposite_open;
+ }
+
+ public abstract void addPackage(ObjectListSelectionModel listSelectionModel);
+
+}
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePersistenceUnitClassesComposite.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePersistenceUnitClassesComposite.java 2012-08-15
12:28:15 UTC (rev 43044)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePersistenceUnitClassesComposite.java 2012-08-15
13:47:16 UTC (rev 43045)
@@ -14,18 +14,22 @@
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.search.IJavaSearchScope;
import org.eclipse.jdt.core.search.SearchEngine;
+import org.eclipse.jdt.internal.core.PackageFragment;
+import org.eclipse.jdt.internal.ui.JavaPlugin;
+import org.eclipse.jdt.internal.ui.JavaPluginImages;
+import org.eclipse.jdt.internal.ui.dialogs.PackageSelectionDialog;
+import org.eclipse.jdt.internal.ui.util.BusyIndicatorRunnableContext;
import org.eclipse.jdt.ui.IJavaElementSearchConstants;
import org.eclipse.jdt.ui.JavaUI;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.window.Window;
import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemoveListPane;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemovePane.Adapter;
import org.eclipse.jpt.common.ui.internal.widgets.Pane;
import
org.eclipse.jpt.common.utility.internal.model.value.ItemPropertyListValueModelAdapter;
import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
@@ -48,8 +52,11 @@
import org.eclipse.swt.widgets.Table;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.FilteredList;
import org.eclipse.ui.dialogs.SelectionDialog;
import org.eclipse.ui.progress.IProgressService;
+import org.jboss.tools.hibernate.jpt.core.internal.context.basic.Hibernate;
+import org.jboss.tools.hibernate.jpt.core.internal.context.persistence.PackageInfoRef;
/**
@@ -77,6 +84,18 @@
}
}
+ private void addMappedPackage(ObjectListSelectionModel listSelectionModel) {
+ IPackageFragment pack = choosePackage();
+
+ if (pack != null) {
+ if(classRefExists(pack.getElementName())) {
+ return;
+ }
+ ClassRef classRef = getSubject().addSpecifiedClassRef(pack.getElementName());
+ listSelectionModel.setSelectedValue(classRef);
+ }
+ }
+
private boolean classRefExists(String className) {
for ( ListIterator<ClassRef> i = getSubject().getSpecifiedClassRefs().iterator();
i.hasNext(); ) {
ClassRef classRef = i.next();
@@ -87,8 +106,8 @@
return false;
}
- private Adapter buildAdapter() {
- return new AddRemoveListPane.AbstractAdapter() {
+ private ExtendedAdapter buildAdapter() {
+ return new ExtendedAdapter() {
public void addNewItem(ObjectListSelectionModel listSelectionModel) {
addMappedClass(listSelectionModel);
}
@@ -103,16 +122,6 @@
}
@Override
- public boolean hasOptionalButton() {
- return true;
- }
-
- @Override
- public String optionalButtonText() {
- return JptUiPersistenceMessages.PersistenceUnitClassesComposite_open;
- }
-
- @Override
public void optionOnSelection(ObjectListSelectionModel listSelectionModel) {
openMappedClass((ClassRef) listSelectionModel.selectedValue());
}
@@ -122,6 +131,11 @@
getSubject().removeSpecifiedClassRef((ClassRef) item);
}
}
+
+ @Override
+ public void addPackage(ObjectListSelectionModel listSelectionModel) {
+ addMappedPackage(listSelectionModel);
+ }
};
}
@@ -157,6 +171,11 @@
if (persistentType != null) {
image = JpaMappingImageHelper.imageForTypeMapping(persistentType.getMappingKey());
+ } else if (classRef instanceof PackageInfoRef){
+ PackageInfoRef packageInfoRef = (PackageInfoRef)classRef;
+ if (packageInfoRef.getJavaPackageInfo() != null){
+ image =
JavaPlugin.getImageDescriptorRegistry().get(JavaPluginImages.DESC_OBJS_PACKAGE);
+ }
}
if (image != null) {
@@ -226,7 +245,7 @@
scope,
IJavaElementSearchConstants.CONSIDER_CLASSES,
false,
- ""
+ "" //$NON-NLS-1$
);
}
catch (JavaModelException e) {
@@ -258,7 +277,55 @@
return null;
}
+
+ private IPackageFragment choosePackage() {
+ IJavaElement[] elements = new IJavaElement[] { getJavaProject() };
+ BusyIndicatorRunnableContext context = new BusyIndicatorRunnableContext();
+ IJavaSearchScope scope = SearchEngine
+ .createJavaSearchScope(elements, IJavaSearchScope.SOURCES
+ | IJavaSearchScope.REFERENCED_PROJECTS);
+ PackageSelectionDialog packageSelectionDialog = new PackageSelectionDialog(
+ getShell(), context,
+ PackageSelectionDialog.F_HIDE_DEFAULT_PACKAGE
+ | PackageSelectionDialog.F_HIDE_EMPTY_INNER, scope) {
+
+ @Override
+ protected FilteredList createFilteredList(Composite parent) {
+ FilteredList list = super.createFilteredList(parent);
+ //filter out packages without package-ifo.java
+ list.setFilterMatcher(new FilteredList.FilterMatcher() {
+
+ @Override
+ public void setFilter(String pattern, boolean ignoreCase,
+ boolean ignoreWildCards) {
+ }
+
+ @Override
+ public boolean match(Object element) {
+ if (element instanceof PackageFragment) {
+ PackageFragment pf = (PackageFragment) element;
+ return pf.getCompilationUnit(Hibernate.PACKAGE_INFO_JAVA).exists();
+
+ }
+ return false;
+ }
+ });
+ return list;
+ }
+ };
+
+ packageSelectionDialog.setTitle(Messages.HibernatePersistenceUnitClassesComposite_PackageSelectionDialog_title);
+ packageSelectionDialog
+ .setMessage(JptCommonUiMessages.ClassChooserPane_dialogMessage);
+
+ if (packageSelectionDialog.open() == Window.OK) {
+ return (IPackageFragment) packageSelectionDialog.getResult()[0];
+ }
+
+ return null;
+ }
+
/*
* (non-Javadoc)
*/
@@ -268,11 +335,11 @@
// Description
addMultiLineLabel(
container,
- JptUiPersistenceMessages.PersistenceUnitClassesComposite_description
+ Messages.HibernatePersistenceUnitClassesComposite_ClassesComposite_message
);
// List pane
- new AddRemoveListPane<PersistenceUnit>(
+ new AddMappingListPane(
this,
container,
this.buildAdapter(),
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePersistenceUnitGeneralComposite.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePersistenceUnitGeneralComposite.java 2012-08-15
12:28:15 UTC (rev 43044)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/HibernatePersistenceUnitGeneralComposite.java 2012-08-15
13:47:16 UTC (rev 43045)
@@ -13,9 +13,7 @@
import org.eclipse.jpt.common.ui.WidgetFactory;
import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.ui.internal.persistence.JptUiPersistenceMessages;
import
org.eclipse.jpt.jpa.ui.internal.persistence.details.GenericPersistenceUnitGeneralComposite;
-import
org.eclipse.jpt.jpa.ui.internal.persistence.details.PersistenceUnitClassesComposite;
import org.eclipse.swt.widgets.Composite;
/**
@@ -36,7 +34,7 @@
container = addCollapsibleSection(
container,
- JptUiPersistenceMessages.PersistenceUnitGeneralComposite_mappedClasses
+ Messages.HibernatePersistenceUnitGeneralComposite_Section_title
);
updateGridData(container);
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/Messages.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/Messages.java
(rev 0)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/Messages.java 2012-08-15
13:47:16 UTC (rev 43045)
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.hibernate.jpt.ui.internal.persistence.details;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ *
+ * @author Dmitry Geraskov (geraskov(a)gmail.com)
+ *
+ */
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME =
"org.jboss.tools.hibernate.jpt.ui.internal.persistence.details.messages";
//$NON-NLS-1$
+ public static String AddMappingListPane_Add_Class;
+ public static String AddMappingListPane_Add_Package;
+ public static String HibernatePersistenceUnitClassesComposite_ClassesComposite_message;
+ public static String
HibernatePersistenceUnitClassesComposite_PackageSelectionDialog_title;
+ public static String HibernatePersistenceUnitGeneralComposite_Section_title;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/messages.properties
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/messages.properties
(rev 0)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/persistence/details/messages.properties 2012-08-15
13:47:16 UTC (rev 43045)
@@ -0,0 +1,5 @@
+AddMappingListPane_Add_Class=Add Class
+AddMappingListPane_Add_Package=Add Package
+HibernatePersistenceUnitClassesComposite_ClassesComposite_message=Specify the list of
classes/packages to be managed in this persistence unit.
+HibernatePersistenceUnitClassesComposite_PackageSelectionDialog_title=Package selection
+HibernatePersistenceUnitGeneralComposite_Section_title=Managed Classes and Packages