Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Vosburgh2012-12-07 11:29:32 -0500
committerBrian Vosburgh2012-12-07 11:54:08 -0500
commit1e389f86244bbe4e970b7df05f27a1bcee415f13 (patch)
tree62f5d3bdae0deba8268f6feacdb75d48383e54e0
parent931700a7d41a409b97fe68d1209b8022e8504525 (diff)
downloadwebtools.dali-1e389f86244bbe4e970b7df05f27a1bcee415f13.tar.gz
webtools.dali-1e389f86244bbe4e970b7df05f27a1bcee415f13.tar.xz
webtools.dali-1e389f86244bbe4e970b7df05f27a1bcee415f13.zip
rework images
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/schema/libraryValidators.exsd2
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/command/CommandJobCommandAdapter.java19
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/build.properties1
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/images/buttons/add-connection.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/add-connection.gif)bin920 -> 920 bytes
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/images/buttons/add.png (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/add.png)bin1000 -> 1000 bytes
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/images/buttons/browse-mini.png (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/browse-mini.png)bin448 -> 448 bytes
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/images/buttons/browse.png (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/browse.png)bin1072 -> 1072 bytes
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/images/buttons/collapse-all.png (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/collapse-all.png)bin989 -> 989 bytes
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/images/buttons/delete.png (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/delete.png)bin1059 -> 1059 bytes
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/images/buttons/deselect-all.png (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/deselect-all.png)bin1050 -> 1050 bytes
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/images/buttons/dot.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/dot.gif)bin121 -> 121 bytes
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/images/buttons/edit.png (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/edit.png)bin380 -> 380 bytes
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/images/buttons/expand-all.png (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/expand-all.png)bin1004 -> 1004 bytes
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/images/buttons/move-down.png (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/move-down.png)bin305 -> 305 bytes
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/images/buttons/move-up.png (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/move-up.png)bin284 -> 284 bytes
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/images/buttons/reconnect.png (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/reconnect.png)bin1022 -> 1022 bytes
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/images/buttons/refresh.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/refresh.gif)bin327 -> 327 bytes
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/images/buttons/restore-defaults.png (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/restore-defaults.png)bin1057 -> 1057 bytes
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/images/buttons/select-all.png (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/select-all.png)bin1096 -> 1096 bytes
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/images/objects/file.png (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/file.png)bin456 -> 456 bytes
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/images/objects/folder.png (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/folder.png)bin310 -> 310 bytes
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/images/objects/package.png (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/package.png)bin319 -> 319 bytes
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/images/objects/warning.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/warning.gif)bin338 -> 338 bytes
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/images/overlays/error.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/images/overlays/error.gif)bin82 -> 82 bytes
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/images/overlays/warning.png (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/images/overlays/warning.png)bin322 -> 322 bytes
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/JptCommonUiImages.java126
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/WidgetFactory.java159
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/JptUIPlugin.java186
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/AbstractItemExtendedLabelProvider.java176
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/AbstractItemStructuredStateProviderManager.java31
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/AbstractStaticItemLabelProvider.java75
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/ImageImageDescriptor.java47
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/ItemStructuredStateProviderManager.java9
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/ItemTreeStateProviderManager.java12
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/NavigatorContentProvider.java15
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/OverlayImageDescriptor.java198
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/PluggableLabelProvider.java81
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/PluggableTableLabelProvider.java121
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/PluggableTextLabelProvider.java86
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/PluggableTextTableLabelProvider.java129
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/ResourceManagerLabelProvider.java113
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/ResourceManagerTableLabelProvider.java155
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/StaticItemExtendedLabelProvider.java14
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/StaticItemLabelProvider.java36
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/StructuredContentProviderAdapter.java265
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/TableItemModelAdapter.java89
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/AddRemoveListPane.java4
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/AddRemovePane.java6
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/DefaultWidgetFactory.java138
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/Dialog.java111
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/DialogPane.java73
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/EnumComboViewer.java16
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/FormWidgetFactory.java222
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/NewNameDialog.java131
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/NewNameDialogBuilder.java56
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/NewNameStateObject.java5
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/Pane.java734
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/ValidatingDialog.java39
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/jface/ItemLabelProvider.java10
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/ComparatorAdapter.java30
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/CompositeCollectionValueModel.java2
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/CompositeListValueModel.java2
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/prefs/PreferencePropertyValueModel.java4
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/NonNullBooleanTransformer.java12
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/NonNullStaticTransformer.java43
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/NonNullStringObjectTransformer.java51
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/NotBooleanTransformer.java2
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/NotNullObjectTransformer.java56
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/NullObjectTransformer.java56
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/StaticTransformer.java38
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/transformer/Transformer.java39
-rw-r--r--common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/ImageDescriptorTest.java81
-rw-r--r--common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/JptCommonUiTests.java2
-rw-r--r--common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/jface/DelegatingLabelProviderUiTest.java474
-rw-r--r--common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/jface/DelegatingTreeContentProviderUiTest.java258
-rw-r--r--common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/PaneVisibilityEnablerTest.java24
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/prefs/PreferencePropertyValueModelTests.java2
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/META-INF/MANIFEST.MF1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/build.properties4
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/obj16/text.gifbin349 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/ovr16/error_ovr.gifbin82 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/images/buttons/new-web-services-client.gif (renamed from jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/etool16/newclient_webserv_wiz.gif)bin587 -> 587 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/images/objects/dtd-file.gif (renamed from jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/obj16/dtdfile.gif)bin351 -> 351 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/images/objects/xsd-file.gif (renamed from jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/obj16/XSDFile.gif)bin574 -> 574 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/images/wizards/new-web-services-client.gif (renamed from jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/wizban/webservicesclient_wiz.gif)bin1834 -> 1834 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/plugin.xml4
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/JptDbwsEclipseLinkUiImages.java64
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/JptDbwsUiIcons.java18
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/BuilderXmlWizardPage.java9
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/DbwsGeneratorWizard.java51
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/JdbcDriverWizardPage.java6
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectFileOrXMLCatalogIdPanel.java6
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectXMLCatalogIdPanel.java10
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/XMLCatalogTableViewer.java159
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/META-INF/MANIFEST.MF5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/META-INF/MANIFEST.MF4
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/build.properties4
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/images/objects/oxm-file.gif (renamed from jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/icons/full/obj16/oxm-file.gif)bin967 -> 967 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/images/objects/oxm-file.ico (renamed from jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/icons/full/obj16/oxm-file.ico)bin1150 -> 1150 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/images/objects/xml-inverse-reference.gif (renamed from jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/icons/full/obj16/xml-inverse-reference.gif)bin908 -> 908 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/images/objects/xml-join-nodes.gif (renamed from jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/icons/full/obj16/xml-join-nodes.gif)bin283 -> 283 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/images/objects/xml-transformation.gif (renamed from jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/icons/full/obj16/xml-transformation.gif)bin908 -> 908 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/JptJaxbEclipseLinkUiImages.java59
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbMappingImageHelper.java27
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/JptJaxbEclipseLinkUiIcons.java19
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/navigator/ELJaxbNavigatorItemLabelProviderFactory.java9
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/navigator/ELJaxbPersistentAttributeItemLabelProvider.java10
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/navigator/OxmJavaTypeItemLabelProvider.java19
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/build.properties4
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/text.gifbin349 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/ovr16/error_ovr.gifbin82 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/buttons/new-class.gif (renamed from jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/newclass_wiz.gif)bin598 -> 598 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/buttons/new-jaxb-project.gif (renamed from jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/new_jaxb_project_wiz.gif)bin612 -> 612 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/buttons/new-xsd.gif (renamed from jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/NewXSD.gif)bin364 -> 364 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/jaxb-facet.gif (renamed from jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/jaxb_facet.gif)bin220 -> 220 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/dtd-file.gif (renamed from jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/dtdfile.gif)bin351 -> 351 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/enum-constant.gif (renamed from jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/enum_constant.gif)bin124 -> 124 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/jaxb-class.gif (renamed from jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_class.gif)bin1005 -> 1005 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/jaxb-content.gif (renamed from jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_content.gif)bin220 -> 220 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/jaxb-enum.gif (renamed from jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_enum.gif)bin981 -> 981 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/jaxb-package.gif (renamed from jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/package.gif)bin950 -> 950 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/jaxb-registry.gif (renamed from jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_registry.gif)bin1010 -> 1010 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/jaxb-transient-class.gif (renamed from jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_class.gif)bin1007 -> 1007 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/jaxb-transient-class.ico (renamed from jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_class.ico)bin1150 -> 1150 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/jaxb-transient-enum.gif (renamed from jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_enum.gif)bin983 -> 983 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/jaxb-transient-enum.ico (renamed from jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_enum.ico)bin1150 -> 1150 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/null-attribute-mapping.gif (renamed from jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/null-attribute-mapping.gif)bin911 -> 911 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/persistent-field.gif (renamed from jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/persistent_field.gif)bin124 -> 124 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/persistent-property.gif (renamed from jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/persistent_property.gif)bin193 -> 193 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/xml-any-attribute.gif (renamed from jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-any-attribute.gif)bin951 -> 951 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/xml-any-element.gif (renamed from jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-any-element.gif)bin973 -> 973 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/xml-attribute.gif (renamed from jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-attribute.gif)bin937 -> 937 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/xml-element-ref.gif (renamed from jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-element-ref.gif)bin995 -> 995 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/xml-element-refs.gif (renamed from jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-element-refs.gif)bin978 -> 978 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/xml-element.gif (renamed from jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-element.gif)bin960 -> 960 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/xml-elements.gif (renamed from jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-elements.gif)bin940 -> 940 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/xml-transient.gif (renamed from jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-transient.gif)bin886 -> 886 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/xml-value.gif (renamed from jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-value.gif)bin880 -> 880 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/xsd-file.gif (renamed from jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/XSDFile.gif)bin574 -> 574 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/wizards/classes-gen-banner.gif (renamed from jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/newclass_wiz.gif)bin3213 -> 3213 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/wizards/jaxb-project-banner.gif (renamed from jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/new_jaxb_prj_wiz.gif)bin2787 -> 2787 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/wizards/jaxb-project-banner.png (renamed from jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/new_jaxb_prj_wiz.png)bin2505 -> 2505 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/wizards/schema-gen-banner.gif (renamed from jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/NewXSD.gif)bin3162 -> 3162 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/plugin.xml13
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/JptJaxbUiImages.java99
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbMappingImageHelper.java73
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JptJaxbUiIcons.java50
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorItemLabelProviderFactory.java24
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbClassItemLabelProvider.java35
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbEnumItemLabelProvider.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentAttributeItemLabelProvider.java18
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbTypeItemLabelProvider.java4
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorContentProvider.java12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbSchemasPropertiesPage.java35
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizard.java23
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizardPage.java13
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SchemaWizardPage.java9
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SelectFileOrXMLCatalogIdPanel.java6
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SelectXMLCatalogIdPanel.java10
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/XMLCatalogTableViewer.java159
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetPage.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/proj/JaxbProjectWizard.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/SchemaGeneratorWizard.java4
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/SchemaGeneratorWizardPage.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/create_entity.xml2
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/map_entity.xml2
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/plugin.xml58
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConvert.java17
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/plugin.xml15
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLink2_4ProjectFlagModel.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkArrayMapping2_3Composite.java23
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkBasicCollectionMappingComposite.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkBasicMapMappingComposite.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkBasicMappingComposite.java112
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConversionValueDialog.java93
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConversionValueStateObject.java5
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConvertCombo.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConvertersComposite.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCustomConverterComposite.java17
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkElementCollectionMapping2_0Composite.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkIdMappingComposite.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkManyToManyMappingComposite.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkManyToOneMappingComposite.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkMultitenancyComposite.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkObjectTypeConverterComposite.java22
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkOneToManyMappingComposite.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkOneToOneMappingComposite.java22
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkStructConverterComposite.java18
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkStructureMapping2_3Composite.java23
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkTransformationMappingComposite.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkTypeConverterComposite.java18
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkVariableOneToOneMappingComposite.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkVersionMappingComposite.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/TenantDiscriminatorColumnComposite.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/TenantDiscriminatorColumnsComposite.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/AbstractJavaEclipseLinkEmbeddableComposite.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/AbstractJavaEclipseLinkEntity2_xComposite.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/AbstractJavaEclipseLinkEntityComposite.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/AbstractJavaEclipseLinkMappedSuperclassComposite.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/DefaultJavaEclipseLinkOneToManyMappingUiDefinition.java7
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/DefaultJavaEclipseLinkOneToOneMappingUiDefinition.java7
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/DefaultJavaEclipseLinkVariableOneToOneMappingUiDefinition.java7
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/EclipseLink1_2JavaUiFactory.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/EclipseLink2_0JavaUiFactory.java109
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/EclipseLink2_3JavaUiFactory.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/EclipseLinkJavaUiFactory.java141
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkArrayMapping2_3UiDefinition.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkBasicCollectionMappingUiDefinition.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkBasicMapMappingUiDefinition.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkBasicMappingComposite.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkElementCollectionMapping2_0Composite.java92
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkEmbeddable1_2Composite.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkEmbeddableComposite.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkEntity1_2Composite.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkEntity2_0Composite.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkEntity2_3Composite.java17
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkEntityComposite.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkIdMapping2_0Composite.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkIdMappingComposite.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkManyToManyMapping2_0Composite.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkManyToOneMapping2_0Composite.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkMappedSuperclass1_2Composite.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkMappedSuperclass2_0Composite.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkMappedSuperclass2_1Composite.java23
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkMappedSuperclass2_3Composite.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkMappedSuperclassComposite.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkOneToManyMapping2_0Composite.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkOneToOneMapping2_0Composite.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkStructureMapping2_3UiDefinition.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkTransformationMappingUiDefinition.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkVariableOneToOneMappingUiDefinition.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkVersionMappingComposite.java21
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/AbstractEclipseLinkEntityMappingsDetailsPageManager.java (renamed from jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/AbstractEclipseLinkEntityMappingsDetailsPage.java)25
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/AbstractEclipseLinkOrmXmlUiFactory.java145
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/AbstractOrmEclipseLinkEntity2_xComposite.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/AbstractOrmEclipseLinkEntityComposite.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/AbstractOrmEclipseLinkMappedSuperclassComposite.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/BaseEclipseLinkOrmXmlUiFactory.java132
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLink2_3PersistenceUnitMetadataComposite.java16
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkConverterDialog.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappings2_0DetailsProvider.java8
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappings2_3DetailsProvider.java8
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappingsDetailsPageManager.java (renamed from jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappingsDetailsPage.java)24
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappingsDetailsPageManager2_0.java (renamed from jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappings2_0DetailsPage.java)27
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappingsDetailsPageManager2_3.java (renamed from jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappings2_3DetailsPage.java)23
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappingsDetailsProvider.java8
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappingsTenantDiscriminatorColumnsComposite.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml1_1UiFactory.java105
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_0UiFactory.java146
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_1UiFactory.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_3UiFactory.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXmlUiFactory.java7
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkArrayMapping2_3UiDefinition.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicCollectionMapping1_1Composite.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicCollectionMappingUiDefinition.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicMapMapping1_1Composite.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicMapMappingUiDefinition.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicMapping1_1Composite.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicMappingComposite.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkElementCollectionMapping2_0Composite.java92
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkElementCollectionMapping2_1Composite.java92
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddableComposite.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddedIdMapping1_1Composite.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddedIdMapping2_0Composite.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddedMapping1_1Composite.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddedMapping2_0Composite.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEntity2_0Composite.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEntity2_3Composite.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEntityComposite.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkIdMapping1_1Composite.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkIdMapping2_0Composite.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkIdMappingComposite.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToManyMapping1_1Composite.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToManyMapping2_0Composite.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToManyMappingComposite.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToOneMapping1_1Composite.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToOneMapping2_0Composite.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToOneMappingComposite.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkMappedSuperclass2_0Composite.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkMappedSuperclass2_1Composite.java14
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkMappedSuperclass2_3Composite.java14
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkMappedSuperclassComposite.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToManyMapping1_1Composite.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToManyMapping2_0Composite.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToManyMappingComposite.java10
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToOneMapping1_1Composite.java83
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToOneMapping2_0Composite.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToOneMappingComposite.java83
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkStructureMapping2_3UiDefinition.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkTransformationMappingUiDefinition.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkVariableOneToOneMappingUiDefinition.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkVersionMapping1_1Composite.java21
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkVersionMappingComposite.java21
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/EclipseLinkPersistenceUnitCachingEditorPage.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/EclipseLinkPersistenceUnitCachingEditorPageDefinition.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/EclipseLinkPersistenceUnitConnectionEditorPage.java23
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/EclipseLinkPersistenceUnitConnectionEditorPageDefinition.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/EclipseLinkPersistenceUnitCustomizationEditorPage.java9
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/EclipseLinkPersistenceUnitCustomizationEditorPageDefinition.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/general/EclipseLinkPersistenceUnitGeneralEditorPage.java18
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/general/EclipseLinkPersistenceUnitGeneralEditorPageDefinition.java21
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/general/EclipseLinkPersistenceUnitJarFilesComposite.java9
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/general/EclipseLinkPersistenceUnitMappingFilesComposite.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/options/EclipseLinkLoggingComposite.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/options/EclipseLinkPersistenceUnitOptionsEditorPage.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/options/EclipseLinkPersistenceUnitOptionsEditorPageDefinition.java15
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/options/PersistenceXmlSchemaGenerationComposite.java15
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/EclipseLinkLogging2_0Composite.java17
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/EclipseLinkLogging2_4Composite.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/EclipseLinkPersistenceUnitCaching2_0EditorPage.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/EclipseLinkPersistenceUnitCaching2_0EditorPageDefinition.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/EclipseLinkPersistenceUnitCustomization2_0EditorPage.java13
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/EclipseLinkPersistenceUnitCustomization2_0EditorPageDefinition.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/EclipseLinkPersistenceUnitOptions2_0EditorPage.java14
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/EclipseLinkPersistenceUnitOptions2_0EditorPageDefinition.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/EclipseLinkPersistenceUnitOptions2_4EditorPage.java17
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/EclipseLinkPersistenceUnitOptions2_4EditorPageDefinition.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/EclipseLinkDynamicEntityWizard.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/gen/GenerateDynamicEntitiesFromSchemaWizard.java8
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/property_files/jpt_gen.properties2
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/PackageGenerator.java8
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/build.properties3
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/column.gifbin215 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/table.gifbin365 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/list-of-values.pngbin1072 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/new-entity-disabled.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/dtool16/new_entity_wiz.gif)bin594 -> 594 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/new-entity.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/etool16/new_entity_wiz.gif)bin624 -> 624 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/new-jpa-file-disabled.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/dtool16/new_jpa_file_wiz.gif)bin359 -> 359 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/new-jpa-file.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/etool16/new_jpa_file_wiz.gif)bin586 -> 586 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/new-jpa-project-disabled.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/dtool16/new_jpaproject_wiz.gif)bin372 -> 372 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/new-jpa-project.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/etool16/new_jpaproject_wiz.gif)bin991 -> 991 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/warningstd.pngbin993 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/export-as-img-hover.pngbin1222 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/export-as-img.pngbin1047 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/header_left_bg.pngbin232 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/header_mid_bg.pngbin190 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/header_right_bg.pngbin232 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/print-hover.pngbin1219 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/print.pngbin1051 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/shadow-bottom.pngbin928 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/shadow-lower-left.pngbin978 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/shadow-lower-right.pngbin989 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/shadow-side.pngbin924 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/shadow-upper-right.pngbin976 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/toolbar_bg.pngbin196 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/jpa-facet.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/etool16/jpa_facet.gif)bin896 -> 896 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/basic.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/basic.gif)bin897 -> 897 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/column.gifbin113 -> 215 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/element-collection.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/element-collection.gif)bin872 -> 872 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/embeddable.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/embeddable.gif)bin1003 -> 1003 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/embedded-id.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/embedded-id.gif)bin953 -> 953 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/embedded.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/embedded.gif)bin905 -> 905 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/entity-gen-column-key.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/columnKey.gif)bin1715 -> 1715 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/entity-gen-column.gifbin0 -> 113 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/entity-gen-table-object.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/table_obj.gif)bin561 -> 561 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/entity-gen-table.gifbin0 -> 953 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/entity-mappings.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/entity-mappings.gif)bin974 -> 974 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/entity.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/entity.gif)bin1010 -> 1010 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/enum.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/enum_obj.gif)bin361 -> 361 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/forward.gifbin138 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/id.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/id.gif)bin938 -> 938 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/jpa-content.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/jpa-content.gif)bin896 -> 896 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/jpa-file.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/jpa-file.gif)bin968 -> 968 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/jpa-jar-file.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/jpa-jar-file.gif)bin1013 -> 1013 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/jpql-function.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/jpql.function.gif)bin261 -> 261 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/jpql-identifier.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/jpql.identifier.gif)bin627 -> 627 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/jpql-variable.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/jpql.variable.gif)bin99 -> 99 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/many-to-many.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/many-to-many.gif)bin328 -> 328 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/many-to-one.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/many-to-one.gif)bin307 -> 307 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/mapped-superclass.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/mapped-superclass.gif)bin1005 -> 1005 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/moveRight.gifbin138 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/null-attribute-mapping.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/null-attribute-mapping.gif)bin911 -> 911 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/null-type-mapping.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/null-type-mapping.gif)bin586 -> 586 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/one-to-many.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/one-to-many.gif)bin306 -> 306 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/one-to-one.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/one-to-one.gif)bin283 -> 283 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/persistence-unit.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/persistence-unit.gif)bin931 -> 931 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/persistence.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/persistence.gif)bin961 -> 961 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/table.gifbin953 -> 365 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/transient.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/transient.gif)bin892 -> 892 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/version.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/version.gif)bin321 -> 321 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/save-image-16.pngbin508 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/views/jpa-details.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/eview16/jpa_details.gif)bin953 -> 953 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/views/jpa-perspective.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/eview16/jpa_perspective.gif)bin896 -> 896 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/views/jpa-structure.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/eview16/jpa_structure.gif)bin900 -> 900 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/wizards/entity-banner.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/wizban/new_entity_wizban.gif)bin3316 -> 3316 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/wizards/jpa-file-banner.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/wizban/new_jpa_file_wizban.gif)bin3070 -> 3070 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/wizards/jpa-project-banner.gif (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/wizban/new_jpa_prj_wiz.gif)bin2791 -> 2791 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/plugin.xml34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/JpaPlatformUi.java14
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/JpaWorkbench.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/JptJpaUiImages.java130
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/MappingResourceUiDefinition.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/ResourceUiDefinition.java5
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/DefaultMappingUiDefinition.java5
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/JpaDetailsPageManager.java3
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/JpaDetailsProvider.java10
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/MappingUiDefinition.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/java/DefaultJavaAttributeMappingUiDefinition.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/java/DefaultJavaTypeMappingUiDefinition.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/java/JavaAttributeMappingUiDefinition.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/java/JavaTypeMappingUiDefinition.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/java/JavaUiFactory.java288
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/orm/OrmAttributeMappingUiDefinition.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/orm/OrmTypeMappingUiDefinition.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/orm/OrmXmlUiFactory.java246
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/editors/JpaEditorPageDefinition.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/AbstractJpaPlatformUiProvider.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/AbstractResourceUiDefinition.java7
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/ImageRepository.java154
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/InternalJpaWorkbench.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JpaStructureNodeAdapterFactory.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JpaXmlCompletionProposalComputer.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JptUiIcons.java107
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/actions/MakePersistentAction.java170
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractBasicMappingComposite.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractBasicMappingUiDefinition.java7
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEmbeddableComposite.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEmbeddableUiDefinition.java7
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEmbeddedIdMappingComposite.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEmbeddedIdMappingUiDefinition.java7
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEmbeddedMappingComposite.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEmbeddedMappingUiDefinition.java7
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEntityComposite.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEntityUiDefinition.java7
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractIdMappingComposite.java17
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractIdMappingUiDefinition.java7
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractJavaMappedSuperclassComposite.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractJpaDetailsPageManager.java (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractJpaDetailsPage.java)18
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractManyToManyMappingComposite.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractManyToManyMappingUiDefinition.java7
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractManyToOneMappingComposite.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractManyToOneMappingUiDefinition.java7
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractMappedSuperclassComposite.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractMappedSuperclassUiDefinition.java7
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractMappingUiDefinition.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractOneToManyMappingComposite.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractOneToManyMappingUiDefinition.java7
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractOneToOneMappingComposite.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractOneToOneMappingUiDefinition.java7
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractOrderingComposite.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractPrimaryKeyJoinColumnsComposite.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractTransientMappingUiDefinition.java7
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractVersionMappingComposite.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractVersionMappingUiDefinition.java7
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AddQueryDialog.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/BaseJoinColumnDialog.java117
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/BaseJoinColumnDialogPane.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/BaseJoinColumnStateObject.java5
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/BasicMappingComposite.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/CascadeComposite.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/EmbeddedIdMappingComposite.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/EmbeddedMappingComposite.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/EnumTypeComboViewer.java23
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/IdMappingComposite.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/InverseJoinColumnInJoinTableDialog.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/InverseJoinColumnInJoinTableStateObject.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnDialog.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnDialogPane.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnInJoiningStrategyDialog.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnInReferenceTableDialog.java83
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnInReferenceTableStateObject.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnJoiningStrategyPane.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnsComposite.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinTableComposite.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoiningStrategyJoinColumnsComposite.java19
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoiningStrategyJoinColumnsWithOverrideOptionComposite.java22
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/ManyToManyMappingComposite.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/ManyToOneMappingComposite.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/MapAsComposite.java129
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/OneToManyMappingComposite.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/OneToOneMappingComposite.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/OrderingComposite.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PersistentAttributeDetailsPageManager.java (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PersistentAttributeDetailsPage.java)81
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PersistentAttributeMapAsComposite.java17
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PersistentTypeDetailsPageManager.java (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PersistentTypeDetailsPage.java)75
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PersistentTypeMapAsComposite.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PrimaryKeyJoinColumnDialog.java107
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PrimaryKeyJoinColumnInSecondaryTableDialog.java116
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PrimaryKeyJoinColumnInSecondaryTableStateObject.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PrimaryKeyJoinColumnsInSecondaryTableComposite.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/QueriesComposite.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/ReferenceTableComposite.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/TemporalTypeCombo.java19
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/TransientMappingComposite.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/VersionMappingComposite.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/AbstractJavaResourceUiDefinition.java9
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/AbstractJavaUiFactory.java163
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/BaseJavaUiFactory.java183
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/DefaultBasicMappingUiDefinition.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/DefaultEmbeddedMappingUiDefinition.java5
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/GenericJavaUiFactory.java15
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaBasicMappingUiDefinition.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaEmbeddableComposite.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaEmbeddableUiDefinition.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaEmbeddedIdMappingUDefinition.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaEmbeddedMappingUiDefinition.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaEntityComposite.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaEntityUiDefinition.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaIdMappingUiDefinition.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaManyToManyMappingUiDefinition.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaManyToOneMappingUiDefinition.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaMappedSuperclassComposite.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaMappedSuperclassUiDefinition.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaOneToManyMappingUiDefinition.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaOneToOneMappingUiDefinition.java14
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaPersistentAttributeDetailsPageManager.java (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaPersistentAttributeDetailsPage.java)34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaPersistentAttributeDetailsProvider.java8
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaPersistentTypeDetailsProvider.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaTransientMappingUiDefinition.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaVersionMappingUiDefinition.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/NullJavaAttributeMappingUiDefinition.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/NullJavaTypeMappingUiDefinition.java16
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AbstractEntityMappingsDetailsPageManager.java (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AbstractEntityMappingsDetailsPage.java)25
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AbstractOrmEmbeddableComposite.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AbstractOrmEntityComposite.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AbstractOrmXmlResourceUiDefinition.java9
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AbstractOrmXmlUiFactory.java154
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AddGeneratorDialog.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/BaseOrmXmlUiFactory.java144
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/EntityMappingsDetailsPage.java82
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/EntityMappingsDetailsPageManager.java22
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/EntityMappingsDetailsProvider.java10
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/EntityMappingsGeneratorsComposite.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/GenericOrmXmlUiFactory.java7
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmBasicMappingComposite.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmBasicMappingUiDefinition.java13
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddableComposite.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddableUiDefinition.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddedIdMappingComposite.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddedIdMappingUiDefinition.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddedMappingComposite.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddedMappingUiDefinition.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEntityComposite.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEntityUiDefinition.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmIdMappingComposite.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmIdMappingUiDefinition.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmManyToManyMappingComposite.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmManyToManyMappingUiDefinition.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmManyToOneMappingComposite.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmManyToOneMappingUiDefinition.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmMappedSuperclassComposite.java13
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmMappedSuperclassUiDefinition.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmMappingNameText.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmOneToManyMappingComposite.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmOneToManyMappingUiDefinition.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmOneToOneMappingComposite.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmOneToOneMappingUiDefinition.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmPackageChooser.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmPersistentAttributeDetailsPageManager.java (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmPersistentAttributeDetailsPage.java)37
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmPersistentAttributeDetailsProvider.java9
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmPersistentTypeDetailsProvider.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmTransientMappingUiDefinition.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmVersionMappingComposite.java21
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmVersionMappingUiDefinition.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/PersistenceUnitMetadataComposite.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/UnsupportedOrmAttributeMappingUiDefinition.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/editors/JpaXmlEditor.java202
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/GenericOrmXml2_0UiFactory.java146
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/OrmXml2_0FlagModel.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/AbstractElementCollectionMapping2_0Composite.java79
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/AbstractElementCollectionMapping2_0UiDefinition.java7
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/AbstractManyToOneMapping2_0Composite.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/AbstractOneToOneMapping2_0Composite.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/CascadePane2_0.java21
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/CollectionTable2_0Composite.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/ElementCollectionMapping2_0Composite.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/EmbeddedIdMapping2_0Composite.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/Ordering2_0Composite.java22
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/Generic2_0JavaUiFactory.java134
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaElementCollectionMapping2_0UiDefinition.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaEmbeddable2_0Composite.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaEmbeddedMapping2_0Composite.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaEntity2_0Composite.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaIdMapping2_0Composite.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaManyToManyMapping2_0Composite.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaManyToOneMapping2_0Composite.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaMappedSuperclass2_0Composite.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaOneToManyMapping2_0Composite.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaOneToOneMapping2_0Composite.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/EntityMappings2_0DetailsProvider.java10
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/EntityMappingsDetailsPageManager2_0.java (renamed from jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/EntityMappings2_0DetailsPage.java)21
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmBasicMapping2_0Composite.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmElementCollectionMapping2_0Composite.java21
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmElementCollectionMapping2_0UiDefinition.java13
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmEmbeddedIdMapping2_0Composite.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmEmbeddedMapping2_0Composite.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmEntity2_0Composite.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmIdMapping2_0Composite.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmManyToManyMapping2_0Composite.java18
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmManyToOneMapping2_0Composite.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmOneToManyMapping2_0Composite.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmOneToOneMapping2_0Composite.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmVersionMapping2_0Composite.java21
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/PersistenceUnit2_0OptionsEditorPage.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/PersistenceUnitConnection2_0EditorPage.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/PersistenceUnitConnection2_0EditorPageDefinition.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/PersistenceUnitEditorPageDefinition.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/PersistenceUnitOptions2_0EditorPageDefinition.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpql/JpaJpqlContentProposalProvider.java3
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpql/JpaJpqlJavaCompletionProposalComputer.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpql/JpaJpqlSseCompletionProposalComputer.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpql/JpqlCompletionProposalComputer.java148
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/menus/MapAsContribution.java255
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/menus/PersistentAttributeMapAsContribution.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/menus/PersistentTypeMapAsContribution.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/navigator/JpaNavigatorContentProvider.java13
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/navigator/RootContextNodeModelItemLabelProvider.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/GenericPersistenceUnitJarFilesComposite.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/GenericPersistenceUnitMappingFilesComposite.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/PersistenceUnitClassesComposite.java138
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/PersistenceUnitConnectionEditorPage.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/PersistenceUnitConnectionEditorPageDefinition.java14
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/PersistenceUnitGeneralEditorPage.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/PersistenceUnitGeneralEditorPageDefinition.java15
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/PersistenceUnitJarFilesComposite.java88
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/PersistenceUnitMappingFilesComposite.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/PersistenceUnitPropertiesEditorPage.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/PersistenceUnitPropertiesEditorPageDefinition.java21
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/base/AbstractJpaPlatformUi.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/ClassRefItemLabelProvider.java20
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/GenericNavigatorItemLabelProviderFactory.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/JarFileRefItemLabelProvider.java20
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/MappingFileRefItemLabelProvider.java23
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/PersistenceUnitItemLabelProvider.java20
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/PersistentAttributeItemLabelProvider.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/PersistentTypeItemLabelProvider.java22
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/OrmStructureItemLabelProviderFactory.java10
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/PersistenceStructureItemLabelProviderFactory.java10
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/views/JpaDetailsView.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/views/JpaStructurePage.java16
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/views/JpaStructureView.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/JpaFacetActionPage.java5
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/JpaMakePersistentWizard.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/JpaMakePersistentWizardPage.java142
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/conversion/java/JavaMetadataConversionWizard.java5
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/EntityWizard.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/AssociationTablesPage.java8
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/DatabaseGroup.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/DefaultTableGenerationWizardPage.java13
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/GenerateEntitiesFromSchemaWizard.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/PromptJPAProjectWizardPage.java7
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/SelectTableDialog.java5
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/TableAssociationsWizardPage.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/TableFigure.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/TablesAndColumnsCustomizationWizardPage.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/TablesSelectorWizardPage.java21
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/orm/MappingFileWizard.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/proj/JpaProjectWizard.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/jpa2/details/java/JavaUiFactory2_0.java19
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/jpa2/details/orm/OrmXmlUiFactory2_0.java18
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.ui.tests/.classpath1
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.ui.tests/META-INF/MANIFEST.MF1
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.ui.tests/src/org/eclipse/jpt/jpa/ui/tests/internal/JptJpaUiTests.java3
653 files changed, 8975 insertions, 11714 deletions
diff --git a/common/plugins/org.eclipse.jpt.common.core/schema/libraryValidators.exsd b/common/plugins/org.eclipse.jpt.common.core/schema/libraryValidators.exsd
index de22d26281..106e5f92c1 100644
--- a/common/plugins/org.eclipse.jpt.common.core/schema/libraryValidators.exsd
+++ b/common/plugins/org.eclipse.jpt.common.core/schema/libraryValidators.exsd
@@ -92,7 +92,7 @@ The following example is the included generic library validator, which is used f
point="org.eclipse.jpt.common.core.libraryValidators">
<libraryValidator
id="genericUserLibraryValidator"
- class="org.eclipse.jpt.core.internal.libval.GenericJpaUserLibraryValidator">
+ class="org.eclipse.jpt.jpa.core.internal.libval.GenericJpaUserLibraryValidator">
<enablement>
<with variable="libraryProvider">
<test property="org.eclipse.jpt.core.extendsId" value="jpa-user-library-provider"/>
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/command/CommandJobCommandAdapter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/command/CommandJobCommandAdapter.java
index 36e837913e..fd69870adb 100644
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/command/CommandJobCommandAdapter.java
+++ b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/command/CommandJobCommandAdapter.java
@@ -18,26 +18,37 @@ import org.eclipse.jpt.common.utility.internal.ObjectTools;
/**
* Adapt a {@link Command} to the {@link JobCommand} interface.
- * Necessarily, the progress monitor is ignored and a status of
- * OK is returned.
+ * The adapter can also be configured to return a particular
+ * {@link IStatus status}, by default {@link Status#OK}.
+ * Necessarily, the progress monitor is checked only once, just
+ * before the {@link Command} is {@link Command#execute() executed}.
*/
public class CommandJobCommandAdapter
implements JobCommand
{
private final Command command;
+ private final IStatus status;
public CommandJobCommandAdapter(Command command) {
+ this(command, Status.OK_STATUS);
+ }
+
+ public CommandJobCommandAdapter(Command command, IStatus status) {
super();
- if (command == null) {
+ if ((command == null) || (status == null)) {
throw new NullPointerException();
}
this.command = command;
+ this.status = status;
}
public IStatus execute(IProgressMonitor monitor) {
+ if (monitor.isCanceled()) {
+ return Status.CANCEL_STATUS;
+ }
this.command.execute();
- return Status.OK_STATUS;
+ return this.status;
}
@Override
diff --git a/common/plugins/org.eclipse.jpt.common.ui/build.properties b/common/plugins/org.eclipse.jpt.common.ui/build.properties
index 09040302a1..60d75fdfcc 100644
--- a/common/plugins/org.eclipse.jpt.common.ui/build.properties
+++ b/common/plugins/org.eclipse.jpt.common.ui/build.properties
@@ -13,6 +13,7 @@ output.. = bin/
bin.includes = .,\
META-INF/,\
about.html,\
+ images/,\
plugin.xml,\
plugin.properties,\
.options
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/add-connection.gif b/common/plugins/org.eclipse.jpt.common.ui/images/buttons/add-connection.gif
index 864034f74e..864034f74e 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/add-connection.gif
+++ b/common/plugins/org.eclipse.jpt.common.ui/images/buttons/add-connection.gif
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/add.png b/common/plugins/org.eclipse.jpt.common.ui/images/buttons/add.png
index 6bd3486b7a..6bd3486b7a 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/add.png
+++ b/common/plugins/org.eclipse.jpt.common.ui/images/buttons/add.png
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/browse-mini.png b/common/plugins/org.eclipse.jpt.common.ui/images/buttons/browse-mini.png
index 1f64f24965..1f64f24965 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/browse-mini.png
+++ b/common/plugins/org.eclipse.jpt.common.ui/images/buttons/browse-mini.png
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/browse.png b/common/plugins/org.eclipse.jpt.common.ui/images/buttons/browse.png
index 8081fd9293..8081fd9293 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/browse.png
+++ b/common/plugins/org.eclipse.jpt.common.ui/images/buttons/browse.png
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/collapse-all.png b/common/plugins/org.eclipse.jpt.common.ui/images/buttons/collapse-all.png
index 3582d18d5b..3582d18d5b 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/collapse-all.png
+++ b/common/plugins/org.eclipse.jpt.common.ui/images/buttons/collapse-all.png
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/delete.png b/common/plugins/org.eclipse.jpt.common.ui/images/buttons/delete.png
index afba8b4463..afba8b4463 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/delete.png
+++ b/common/plugins/org.eclipse.jpt.common.ui/images/buttons/delete.png
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/deselect-all.png b/common/plugins/org.eclipse.jpt.common.ui/images/buttons/deselect-all.png
index 49544f5703..49544f5703 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/deselect-all.png
+++ b/common/plugins/org.eclipse.jpt.common.ui/images/buttons/deselect-all.png
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/dot.gif b/common/plugins/org.eclipse.jpt.common.ui/images/buttons/dot.gif
index 57a514d649..57a514d649 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/dot.gif
+++ b/common/plugins/org.eclipse.jpt.common.ui/images/buttons/dot.gif
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/edit.png b/common/plugins/org.eclipse.jpt.common.ui/images/buttons/edit.png
index 306d6a1c5f..306d6a1c5f 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/edit.png
+++ b/common/plugins/org.eclipse.jpt.common.ui/images/buttons/edit.png
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/expand-all.png b/common/plugins/org.eclipse.jpt.common.ui/images/buttons/expand-all.png
index db729a3990..db729a3990 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/expand-all.png
+++ b/common/plugins/org.eclipse.jpt.common.ui/images/buttons/expand-all.png
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/move-down.png b/common/plugins/org.eclipse.jpt.common.ui/images/buttons/move-down.png
index f6e5281b70..f6e5281b70 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/move-down.png
+++ b/common/plugins/org.eclipse.jpt.common.ui/images/buttons/move-down.png
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/move-up.png b/common/plugins/org.eclipse.jpt.common.ui/images/buttons/move-up.png
index 7c8b1ccf79..7c8b1ccf79 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/move-up.png
+++ b/common/plugins/org.eclipse.jpt.common.ui/images/buttons/move-up.png
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/reconnect.png b/common/plugins/org.eclipse.jpt.common.ui/images/buttons/reconnect.png
index df009468ab..df009468ab 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/reconnect.png
+++ b/common/plugins/org.eclipse.jpt.common.ui/images/buttons/reconnect.png
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/refresh.gif b/common/plugins/org.eclipse.jpt.common.ui/images/buttons/refresh.gif
index 3ca04d06ff..3ca04d06ff 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/refresh.gif
+++ b/common/plugins/org.eclipse.jpt.common.ui/images/buttons/refresh.gif
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/restore-defaults.png b/common/plugins/org.eclipse.jpt.common.ui/images/buttons/restore-defaults.png
index 2d74ae4e01..2d74ae4e01 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/restore-defaults.png
+++ b/common/plugins/org.eclipse.jpt.common.ui/images/buttons/restore-defaults.png
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/select-all.png b/common/plugins/org.eclipse.jpt.common.ui/images/buttons/select-all.png
index 4eaff2beab..4eaff2beab 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/select-all.png
+++ b/common/plugins/org.eclipse.jpt.common.ui/images/buttons/select-all.png
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/file.png b/common/plugins/org.eclipse.jpt.common.ui/images/objects/file.png
index f5c1810a63..f5c1810a63 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/file.png
+++ b/common/plugins/org.eclipse.jpt.common.ui/images/objects/file.png
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/folder.png b/common/plugins/org.eclipse.jpt.common.ui/images/objects/folder.png
index 9759da4e20..9759da4e20 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/folder.png
+++ b/common/plugins/org.eclipse.jpt.common.ui/images/objects/folder.png
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/package.png b/common/plugins/org.eclipse.jpt.common.ui/images/objects/package.png
index 471cc4367d..471cc4367d 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/package.png
+++ b/common/plugins/org.eclipse.jpt.common.ui/images/objects/package.png
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/warning.gif b/common/plugins/org.eclipse.jpt.common.ui/images/objects/warning.gif
index 14009e9974..14009e9974 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/warning.gif
+++ b/common/plugins/org.eclipse.jpt.common.ui/images/objects/warning.gif
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/overlays/error.gif b/common/plugins/org.eclipse.jpt.common.ui/images/overlays/error.gif
index 119dcccd5a..119dcccd5a 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/overlays/error.gif
+++ b/common/plugins/org.eclipse.jpt.common.ui/images/overlays/error.gif
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/overlays/warning.png b/common/plugins/org.eclipse.jpt.common.ui/images/overlays/warning.png
index 8c1e86c479..8c1e86c479 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/overlays/warning.png
+++ b/common/plugins/org.eclipse.jpt.common.ui/images/overlays/warning.png
Binary files differ
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/JptCommonUiImages.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/JptCommonUiImages.java
new file mode 100644
index 0000000000..bb183aad2c
--- /dev/null
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/JptCommonUiImages.java
@@ -0,0 +1,126 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Oracle. All rights reserved.
+ * 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.common.ui;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jpt.common.ui.internal.plugin.JptCommonUiPlugin;
+import org.eclipse.swt.SWT;
+
+/**
+ * Actually, just the image descriptors....
+ * <p>
+ * Code should use these constants to acquire (and release) the images provided
+ * by Dali. The images should be managed by a
+ * {@link org.eclipse.jface.resource.ResourceManager "local" resource manager}.
+ * <p>
+ * Also, the {@link org.eclipse.ui.IWorkbench Eclipse workbench} supplies more
+ * general purpose {@link org.eclipse.ui.ISharedImages images}.
+ *
+ * @see org.eclipse.jface.resource.ResourceManager#createImage(ImageDescriptor)
+ * @see org.eclipse.jface.resource.ResourceManager#createImageWithDefault(ImageDescriptor)
+ * @see org.eclipse.jface.resource.ResourceManager#destroyImage(ImageDescriptor)
+ * @see org.eclipse.core.runtime.FileLocator#find(org.osgi.framework.Bundle, org.eclipse.core.runtime.IPath, java.util.Map)
+ * @see org.eclipse.ui.IWorkbench#getSharedImages()
+ * @see org.eclipse.ui.ISharedImages
+ */
+@SuppressWarnings("nls")
+public final class JptCommonUiImages {
+
+ // ********** Dali standard directories **********
+
+ /**
+ * @see org.eclipse.core.runtime.FileLocator#find(org.osgi.framework.Bundle, org.eclipse.core.runtime.IPath, java.util.Map)
+ */
+ public static final String LOCALE = "$nl$";
+ public static final String LOCALE_ = LOCALE + '/';
+
+ public static final String IMAGES = LOCALE_ + "images";
+ public static final String IMAGES_ = IMAGES + '/';
+
+ public static final String BUTTONS = IMAGES_ + "buttons";
+ public static final String BUTTONS_ = BUTTONS + '/';
+
+ public static final String OBJECTS = IMAGES_ + "objects";
+ public static final String OBJECTS_ = OBJECTS + '/';
+
+ public static final String OVERLAYS = IMAGES_ + "overlays";
+ public static final String OVERLAYS_ = OVERLAYS + '/';
+
+ public static final String VIEWS = IMAGES_ + "views";
+ public static final String VIEWS_ = VIEWS + '/';
+
+ public static final String WIZARDS = IMAGES_ + "wizards";
+ public static final String WIZARDS_ = WIZARDS + '/';
+
+
+ // ********** buttons **********
+
+ public static final ImageDescriptor DOT_BUTTON = buildImageDescriptor(BUTTONS_ + "dot.gif");
+ public static final ImageDescriptor ADD_BUTTON = buildImageDescriptor(BUTTONS_ + "add.png");
+ public static final ImageDescriptor EDIT_BUTTON = buildImageDescriptor(BUTTONS_ + "edit.png");
+ public static final ImageDescriptor DELETE_BUTTON = buildImageDescriptor(BUTTONS_ + "delete.png");
+ public static final ImageDescriptor MOVE_UP_BUTTON = buildImageDescriptor(BUTTONS_ + "move-up.png");
+ public static final ImageDescriptor MOVE_DOWN_BUTTON = buildImageDescriptor(BUTTONS_ + "move-down.png");
+ public static final ImageDescriptor EXPAND_ALL_BUTTON = buildImageDescriptor(BUTTONS_ + "expand-all.png");
+ public static final ImageDescriptor COLLAPSE_ALL_BUTTON = buildImageDescriptor(BUTTONS_ + "collapse-all.png");
+ public static final ImageDescriptor RESTORE_DEFAULTS_BUTTON = buildImageDescriptor(BUTTONS_ + "restore-defaults.png");
+ public static final ImageDescriptor BROWSE_BUTTON = buildImageDescriptor(BUTTONS_ + "browse.png");
+ public static final ImageDescriptor MINI_BROWSE_BUTTON = buildImageDescriptor(BUTTONS_ + "browse-mini.png");
+ public static final ImageDescriptor SELECT_ALL_BUTTON = buildImageDescriptor(BUTTONS_ + "select-all.png");
+ public static final ImageDescriptor DESELECT_ALL_BUTTON = buildImageDescriptor(BUTTONS_ + "deselect-all.png");
+ public static final ImageDescriptor REFRESH_BUTTON = buildImageDescriptor(BUTTONS_ + "refresh.gif");
+ public static final ImageDescriptor ADD_CONNECTION_BUTTON = buildImageDescriptor(BUTTONS_ + "add-connection.gif");
+ public static final ImageDescriptor RECONNECT_BUTTON = buildImageDescriptor(BUTTONS_ + "reconnect.png");
+
+
+ // ********** objects **********
+
+ public static final ImageDescriptor FILE = buildImageDescriptor(OBJECTS_ + "file.png");
+ public static final ImageDescriptor FOLDER = buildImageDescriptor(OBJECTS_ + "folder.png");
+ public static final ImageDescriptor PACKAGE = buildImageDescriptor(OBJECTS_ + "package.png");
+ public static final ImageDescriptor WARNING = buildImageDescriptor(OBJECTS_ + "warning.gif");
+
+
+ // ********** overlays **********
+
+ public static final ImageDescriptor ERROR_OVERLAY = buildImageDescriptor(OVERLAYS_ + "error.gif");
+ public static final ImageDescriptor WARNING_OVERLAY = buildImageDescriptor(OVERLAYS_ + "warning.png");
+
+
+ // ********** misc **********
+
+ /**
+ * If the specified flag is <code>true</code>, return an image descriptor
+ * corresponding to the specified descriptor "grayed" out; otherwise return
+ * the specified descriptor unchanged.
+ * @see SWT#IMAGE_GRAY
+ */
+ public static ImageDescriptor gray(ImageDescriptor descriptor, boolean gray) {
+ return gray ? gray(descriptor) : descriptor;
+ }
+
+ /**
+ * Return an image descriptor corresponding to the specified image
+ * descriptor "grayed" out.
+ * @see org.eclipse.swt.graphics.Image#Image(org.eclipse.swt.graphics.Device, org.eclipse.swt.graphics.Image, int)
+ * @see SWT#IMAGE_GRAY
+ */
+ public static ImageDescriptor gray(ImageDescriptor descriptor) {
+ return ImageDescriptor.createWithFlags(descriptor, SWT.IMAGE_GRAY);
+ }
+
+ private static ImageDescriptor buildImageDescriptor(String path) {
+ return JptCommonUiPlugin.instance().buildImageDescriptor(path);
+ }
+
+ private JptCommonUiImages() {
+ throw new UnsupportedOperationException();
+ }
+}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/WidgetFactory.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/WidgetFactory.java
index 6526be1374..f6cfa81e0e 100644
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/WidgetFactory.java
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/WidgetFactory.java
@@ -37,179 +37,136 @@ import org.eclipse.ui.forms.widgets.Section;
* @since 2.0
*/
public interface WidgetFactory {
-
/**
- * Creates a new regular button.
- *
- * @param parent The parent container
- * @param text The button's text
- * @return A new <code>Button</code>
+ * Create a new regular button with the specified parent and text.
+ * @see #createCheckBox(Composite, String)
+ * @see #createPushButton(Composite, String)
+ * @see #createRadioButton(Composite, String)
*/
Button createButton(Composite parent, String text);
/**
- * Creates a new check box button.
- *
- * @param parent The parent container
- * @param text The button's text
- * @return A new <code>Button</code>
+ * Create a new check box with the specified parent and text.
+ * @see #createButton(Composite, String)
+ * @see #createPushButton(Composite, String)
+ * @see #createRadioButton(Composite, String)
*/
Button createCheckBox(Composite parent, String text);
/**
- * Creates a new non-editable <code>Combo</code>.
- *
- * @param parent The parent container
- * @return A new <code>Combo</code>
+ * Create a new drop-down list box with the specified parent.
*/
Combo createCombo(Composite parent);
/**
- * Creates a new container.
- *
- * @param parent The parent container
- * @return A new <code>Composite</code>
+ * Create a new composite with the specified parent.
*/
Composite createComposite(Composite parent);
/**
- * Creates a new DateTime.
- *
- * @param container The parent container
- * @param style The style is to tell the type of widget
- * (<code>SWT.DATE</code> or <code>SWT.TIME</code> or <code>SWT.CALENDAR</code>)
- * @return A new <code>DateTime</code>
+ * Create a new date time widget with the specified parent and style.
+ * @see org.eclipse.swt.SWT#DATE
+ * @see org.eclipse.swt.SWT#TIME
+ * @see org.eclipse.swt.SWT#CALENDAR
*/
DateTime createDateTime(Composite parent, int style);
/**
- * Creates a new editable <code>Combo</code>.
- *
- * @param parent The parent container
- * @return A new <code>Combo</code>
+ * Create a new combo-box with the specified parent.
*/
Combo createEditableCombo(Composite parent);
/**
- * Creates a new titled pane (group box).
- *
- * @param parent The parent container
- * @param title The group pane's title
- * @return A new <code>Group</code>
+ * Create a new group box with the specified parent and title.
*/
Group createGroup(Composite parent, String title);
/**
- * Creates a new label that is shown as a hyperlink.
- *
- * @param parent The parent container
- * @param text The label's text
- * @return A new <code>Hyperlink</code>
+ * Create a new hyperlink label with the specified parent and
+ * text.
*/
Hyperlink createHyperlink(Composite parent, String text);
/**
- * Creates a new label.
- *
- * @param container The parent container
- * @param labelText The label's text
- * @return A new <code>Label</code>
+ * Create a new label with the specified parent and text.
*/
- Label createLabel(Composite container, String labelText);
+ Label createLabel(Composite parent, String text);
/**
- * Creates a new list.
- *
- * @param container The parent container
- * @param style The style is usually to tell what type of selection
- * (<code>SWT.MULTI</code> or <code>SWT.SINGLE</code>)
- * @return A new <code>Label</code>
+ * Create a new list box with the specified parent and style.
+ * @see org.eclipse.swt.SWT#MULTI
+ * @see org.eclipse.swt.SWT#SINGLE
*/
- List createList(Composite container, int style);
+ List createList(Composite parent, int style);
/**
- * Creates a new editable text area.
- *
- * @param parent The parent container
- * @param parent The number of lines the text area should display
- * @return A new <code>Text</code>
+ * Create a new editable multi-line text field with the specified parent.
*/
Text createMultiLineText(Composite parent);
/**
- * Creates a new editable text field that handles password.
- *
- * @param container The parent container
- * @return A new <code>Text</code>
+ * Create a new editable password text field with the specified parent.
*/
- Text createPasswordText(Composite container);
+ Text createPasswordText(Composite parent);
/**
- * Creates a new push button (toggle between selected and unselected).
- *
- * @param parent The parent container
- * @param text The button's text
- * @return A new <code>Button</code>
+ * Create a new push button (i.e. a button that toggles between
+ * <em>selected</em> and <em>unselected</em>) with the specified parent and
+ * text.
+ * @see #createButton(Composite, String)
+ * @see #createCheckBox(Composite, String)
+ * @see #createRadioButton(Composite, String)
*/
Button createPushButton(Composite parent, String text);
/**
- * Creates a new radio button.
- *
- * @param parent The parent container
- * @param text The button's text
- * @return A new <code>Button</code>
+ * Create a new radio button with the specified parent and text.
+ * @see #createButton(Composite, String)
+ * @see #createCheckBox(Composite, String)
+ * @see #createPushButton(Composite, String)
*/
Button createRadioButton(Composite parent, String text);
/**
- * Creates a new section, which is a collapsable pane with a title bar.
- *
- * @param parent The parent container
- * @param style The style of the title bar, which can be
- * <code>ExpandableComposite.TWISTIE</code> and
- * <code>ExpandableComposite.TITLE_BAR</code> and
- * <code>ExpandableComposite.EXPANDED</code>
- * @return A new <code>Section</code>
+ * Create a new section (i.e. a collapsible group box) with the specified
+ * parent and expansion style.
+ * @see org.eclipse.ui.forms.widgets.ExpandableComposite#TWISTIE
+ * @see org.eclipse.ui.forms.widgets.ExpandableComposite#TREE_NODE
+ * @see org.eclipse.ui.forms.widgets.ExpandableComposite#FOCUS_TITLE
+ * @see org.eclipse.ui.forms.widgets.ExpandableComposite#CLIENT_INDENT
+ * @see org.eclipse.ui.forms.widgets.ExpandableComposite#COMPACT
+ * @see org.eclipse.ui.forms.widgets.ExpandableComposite#EXPANDED
+ * @see org.eclipse.ui.forms.widgets.ExpandableComposite#TITLE_BAR
+ * @see org.eclipse.ui.forms.widgets.ExpandableComposite#SHORT_TITLE_BAR
+ * @see org.eclipse.ui.forms.widgets.ExpandableComposite#NO_TITLE
+ * @see org.eclipse.ui.forms.widgets.ExpandableComposite#LEFT_TEXT_CLIENT_ALIGNMENT
+ * @see org.eclipse.ui.forms.widgets.ExpandableComposite#NO_TITLE_FOCUS_BOX
+ * @see org.eclipse.ui.forms.widgets.Section#DESCRIPTION
*/
- Section createSection(Composite parent, int style);
+ Section createSection(Composite parent, int expansionStyle);
/**
- * Creates a new spinner.
- *
- * @param parent The parent container
- * @return A new <code>Spinner</code>
+ * Create a new spinner with the specified parent.
*/
Spinner createSpinner(Composite parent);
/**
- * Creates a new table.
- *
- * @param container The parent container
- * @param style The style to apply to the table
- * @return A new <code>Table</code>
+ * Create a new table with the specified parent.
*/
Table createTable(Composite parent, int style);
/**
- * Creates a new editable text field.
- *
- * @param container The parent container
- * @return A new <code>Text</code>
+ * Create a new editable text field with the specified parent.
*/
Text createText(Composite parent);
/**
- * Creates a new tri-state check box.
- *
- * @param parent The parent container
- * @param text The button's text
- * @return A new <code>Button</code> that has 3 selection states
+ * Create a new tri-state check box with the specified parent and text.
*/
Button createTriStateCheckBox(Composite parent, String text);
/**
- * Dispose of the widget factory
+ * Dispose the widget factory.
*/
void dispose();
-} \ No newline at end of file
+}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/JptUIPlugin.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/JptUIPlugin.java
index e6de59a66d..c686e1e902 100644
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/JptUIPlugin.java
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/JptUIPlugin.java
@@ -16,26 +16,19 @@ import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.preferences.InstanceScope;
-import org.eclipse.draw2d.ImageUtilities;
import org.eclipse.jface.dialogs.DialogSettings;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.jpt.common.core.internal.utility.JptPlugin;
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.preferences.ScopedPreferenceStore;
import org.osgi.framework.Bundle;
/**
* Common Dali UI plug-in behavior:<ul>
* <li>dialog settings
- * <li>image registry
+ * <li>image descriptor
* <li>UI preference store
* </ul>
*/
@@ -44,7 +37,6 @@ public abstract class JptUIPlugin
{
// NB: the plug-in must be synchronized whenever accessing any of this state
private IDialogSettings dialogSettings;
- private ImageRegistry imageRegistry;
private IPreferenceStore preferenceStore;
@@ -67,15 +59,11 @@ public abstract class JptUIPlugin
@Override
protected void stop_() throws Exception {
try {
- if (this.imageRegistry != null) {
- this.imageRegistry.dispose();
- }
if (this.dialogSettings != null) {
this.saveDialogSettings();
}
} finally {
this.preferenceStore = null;
- this.imageRegistry = null;
this.dialogSettings = null;
super.stop_();
}
@@ -177,184 +165,30 @@ public abstract class JptUIPlugin
protected static final String SIMPLE_DIALOG_SETTINGS_FILE_NAME = "dialog_settings.xml"; //$NON-NLS-1$
- // ********** images **********
+ // ********** image descriptor **********
/**
- * Return a "normal" (as opposed to "ghost") image for the specified key.
- * The key will be transformed into the name of a
- * <code>.gif</code> file in the plug-in's <code>icons</code> folder.
- * This image is built, held, and disposed by the plug-in.
+ * Build an image descriptor for the image file with the specified path
+ * in the plug-in's bundle.
*
- * @see #getGhostImage(String)
- * @see #getImage(String, boolean)
* @see org.eclipse.ui.IWorkbench#getSharedImages()
+ * @see org.eclipse.ui.ISharedImages#getImageDescriptor(String)
+ * @see FileLocator#find(Bundle, IPath, java.util.Map)
*/
- public Image getImage(String key) {
- return this.getImage(key, false); // false = normal (non-ghost)
- }
-
- /**
- * Return a "ghost" image for the specified key.
- * The key will be transformed into the name of a
- * <code>.gif</code> file in the plug-in's <code>icons</code> folder.
- * This image is built, held, and disposed by the plug-in.
- *
- * @see #getImage(String)
- * @see #getImage(String, boolean)
- * @see org.eclipse.ui.IWorkbench#getSharedImages()
- */
- public Image getGhostImage(String key) {
- return this.getImage(key, true); // true = ghost
- }
-
- /**
- * Return an image for the specified key. "Ghost" the image if the specified
- * flag is <code>true</code>.
- * The key will be transformed into the name of a
- * <code>.gif</code> file in the plug-in's <code>icons</code> folder.
- * This image is built, held, and disposed by the plug-in.
- *
- * @see #getGhostImage(String)
- * @see #getImage(String)
- * @see org.eclipse.ui.IWorkbench#getSharedImages()
- */
- public Image getImage(String key, boolean ghost) {
- this.checkImageKey(key);
- ImageRegistry registry = this.getImageRegistry();
- if (registry == null) {
- return null;
- }
- // lock the registry while retrieving (and possibly building) the image
- synchronized (registry) {
- return ghost ? this.getGhostImage(registry, key) : this.getImage(registry, key);
- }
- }
-
- /**
- * Pre-condition: The specified registry is <code>synchronized</code>.
- */
- protected Image getGhostImage(ImageRegistry registry, String key) {
- String ghostKey = this.buildGhostImageKey(key);
- Image ghostImage = registry.get(ghostKey);
- if (ghostImage == null) {
- ghostImage = this.buildGhostImage(registry, key);
- registry.put(ghostKey, ghostImage);
- }
- return ghostImage;
- }
-
- protected String buildGhostImageKey(String key) {
- return key + '-' + this.getGhostImageKeySuffix();
- }
-
- protected String getGhostImageKeySuffix() {
- return GHOST_IMAGE_KEY_SUFFIX;
- }
-
- /**
- * Value: <code>{@value}</code>
- */
- protected static final String GHOST_IMAGE_KEY_SUFFIX = "gray"; //$NON-NLS-1$
-
- protected Image buildGhostImage(ImageRegistry registry, String key) {
- Image image = this.getImage(registry, key);
- Color lightGray = new Color(image.getDevice(), 223, 223, 223);
- Image shadedImage = new Image(image.getDevice(), ImageUtilities.createShadedImage(image, lightGray));
- Image ghostImage = new Image(image.getDevice(), shadedImage, SWT.IMAGE_GRAY);
- shadedImage.dispose();
- lightGray.dispose();
- return ghostImage;
- }
-
- /**
- * Pre-condition: The specified registry is <code>synchronized</code>.
- */
- protected Image getImage(ImageRegistry registry, String key) {
- Image image = registry.get(key);
- if (image == null) {
- // a bad image descriptor will result in a "default" image
- registry.put(key, this.buildImageDescriptor_(key));
- image = registry.get(key);
+ public ImageDescriptor buildImageDescriptor(String path) {
+ if (StringTools.isBlank(path)) {
+ throw new IllegalArgumentException("image path cannot be blank"); //$NON-NLS-1$
}
- return image;
- }
- /**
- * Return an image descriptor for the specified key.
- * The key will be transformed into the name of a
- * <code>.gif</code> file in the plug-in's <code>icons</code> folder.
- */
- public ImageDescriptor buildImageDescriptor(String key) {
- this.checkImageKey(key);
- return this.buildImageDescriptor_(key);
- }
-
- /**
- * Pre-condition: the specified key is not blank.
- */
- protected ImageDescriptor buildImageDescriptor_(String key) {
Bundle bundle = this.getBundle();
if (bundle == null) {
return null;
}
- IPath path = this.buildImageFilePath(key);
- URL url = FileLocator.find(bundle, path, null);
+ URL url = FileLocator.find(bundle, new Path(path), null);
return (url == null) ? null : ImageDescriptor.createFromURL(url);
}
- protected IPath buildImageFilePath(String key) {
- return new Path(this.buildRelativeImageFileName(key));
- }
-
- protected String buildRelativeImageFileName(String key) {
- return this.getRelativeImageDirectoryName() + '/' + key + '.' + this.getImageFileExt();
- }
-
- protected String getRelativeImageDirectoryName() {
- return RELATIVE_IMAGE_DIRECTORY_NAME;
- }
- /**
- * Value: <code>{@value}</code>
- */
- protected static final String RELATIVE_IMAGE_DIRECTORY_NAME = "icons"; //$NON-NLS-1$
-
- protected String getImageFileExt() {
- return IMAGE_FILE_EXT;
- }
- /**
- * Value: <code>{@value}</code>
- */
- protected static final String IMAGE_FILE_EXT = "gif"; //$NON-NLS-1$
-
- protected void checkImageKey(String key) {
- if (StringTools.isBlank(key)) {
- throw new IllegalArgumentException("image key cannot be blank"); //$NON-NLS-1$
- }
- }
-
- /**
- * Return the UI plug-in's image registry.
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#getImageRegistry()
- */
- protected synchronized ImageRegistry getImageRegistry() {
- if ((this.imageRegistry == null) && this.isActive()) {
- this.imageRegistry = this.buildImageRegistry();
- }
- return this.imageRegistry;
- }
-
- // TODO the image registry holds icons for the life of the plug-in
- // (i.e. until the workspace is closed). This is better than before when
- // we constantly created new images(!), but:
- // Bug 306437 is about cleaning this up and using Local Resource Managers
- // on our views so that closing the JPA perspective would mean the icons are disposed.
- // But then do we have multiple versions of the same icon?
- protected ImageRegistry buildImageRegistry() {
- Display display = SWTUtil.getDisplay();
- return (display == null) ? null : new ImageRegistry(display);
- }
-
// ********** preference store **********
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/AbstractItemExtendedLabelProvider.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/AbstractItemExtendedLabelProvider.java
index 04e43cc468..42b0c33e77 100644
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/AbstractItemExtendedLabelProvider.java
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/AbstractItemExtendedLabelProvider.java
@@ -9,6 +9,7 @@
******************************************************************************/
package org.eclipse.jpt.common.ui.internal.jface;
+import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jpt.common.ui.jface.ItemExtendedLabelProvider;
import org.eclipse.jpt.common.ui.jface.ItemLabelProvider;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
@@ -21,13 +22,13 @@ import org.eclipse.swt.graphics.Image;
/**
* Abstract {@link ItemLabelProvider} that provides support for listening to an
* {@link #item} and notifying the
- * {@link org.eclipse.jpt.common.ui.jface.ItemLabelProvider.Manager manager}
+ * {@link org.eclipse.jpt.common.ui.jface.ItemExtendedLabelProvider.Manager manager}
* whenever the item changes in a significant way.
* <p>
* Subclasses can implement the following methods if the corresponding aspects
* of the {@link #item} change:<ul>
- * <li>{@link #buildImageModel()}<br>
- * Return a {@link PropertyValueModel} that represents the item's image
+ * <li>{@link #buildImageDescriptorModel()}<br>
+ * Return a {@link PropertyValueModel} that represents the item's image descriptor
* <li>{@link #buildTextModel()}<br>
* Return a {@link PropertyValueModel} that represents the item's text
* <li>{@link #buildDescriptionModel()}<br>
@@ -35,35 +36,46 @@ import org.eclipse.swt.graphics.Image;
* </ul>
* Alternatively, subclasses can implement the following methods if the
* corresponding aspects of the {@link #item} do <em>not</em> change:<ul>
- * <li>{@link #getImage()}<br>
- * Return the item's image
+ * <li>{@link #getImageDescriptor()}<br>
+ * Return the item's image descriptor
* <li>{@link #getText()}<br>
* Return the item's text
* <li>{@link #getDescription()}<br>
* Return the item's description
* </ul>
- * For each aspect (image, text, and description) one and only one of the two
- * methods must be overridden.
+ * For each aspect (image descriptor, text, and description) one and only one
+ * of the two methods must be overridden.
*
* @see StaticItemExtendedLabelProvider
*/
public abstract class AbstractItemExtendedLabelProvider<I>
implements ItemExtendedLabelProvider
{
- protected final ItemLabelProvider.Manager manager;
-
protected final I item;
- protected volatile PropertyChangeListener listener;
+ protected final ItemExtendedLabelProvider.Manager manager;
+
+ protected volatile PropertyValueModel<ImageDescriptor> imageDescriptorModel;
- protected volatile PropertyValueModel<Image> imageModel;
+ protected volatile PropertyChangeListener imageDescriptorListener;
protected volatile PropertyValueModel<String> textModel;
+ protected volatile PropertyChangeListener textListener;
+
protected volatile PropertyValueModel<String> descriptionModel;
+ protected volatile PropertyChangeListener descriptionListener;
- protected AbstractItemExtendedLabelProvider(I item, ItemLabelProvider.Manager manager) {
+
+ protected AbstractItemExtendedLabelProvider(I item, ItemExtendedLabelProvider.Manager manager) {
+ super();
+ if (item == null) {
+ throw new NullPointerException();
+ }
+ if (manager == null) {
+ throw new NullPointerException();
+ }
this.item = item;
this.manager = manager;
}
@@ -71,41 +83,80 @@ public abstract class AbstractItemExtendedLabelProvider<I>
// ********** image **********
- public Image getImage() {
- return this.getImageModel().getValue();
+ public final Image getImage() {
+ ImageDescriptor descriptor = this.getImageDescriptor();
+ return (descriptor == null) ? null : this.manager.getResourceManager().createImage(descriptor);
+ }
+
+ protected ImageDescriptor getImageDescriptor() {
+ return this.getImageDescriptorModel().getValue();
}
/**
- * Return the image model (lazy-initialized).
+ * Return the image descriptor model (lazy-initialized).
*/
- protected synchronized PropertyValueModel<Image> getImageModel() {
- if (this.imageModel == null) {
- this.imageModel = this.buildImageModel();
- this.engageImageModel();
+ protected synchronized PropertyValueModel<ImageDescriptor> getImageDescriptorModel() {
+ if (this.imageDescriptorModel == null) {
+ this.imageDescriptorModel = this.buildImageDescriptorModel();
+ this.engageImageDescriptorModel();
}
- return this.imageModel;
+ return this.imageDescriptorModel;
}
/**
- * Construct an image model.
+ * Construct an image descriptor model.
*/
- protected PropertyValueModel<Image> buildImageModel() {
+ protected PropertyValueModel<ImageDescriptor> buildImageDescriptorModel() {
throw new UnsupportedOperationException();
}
- protected void engageImageModel() {
- this.imageModel.addPropertyChangeListener(PropertyValueModel.VALUE, this.getListener());
+ protected void engageImageDescriptorModel() {
+ this.imageDescriptorModel.addPropertyChangeListener(PropertyValueModel.VALUE, this.getImageDescriptorListener());
+ }
+
+ protected void disengageImageDescriptorModel() {
+ this.imageDescriptorModel.removePropertyChangeListener(PropertyValueModel.VALUE, this.imageDescriptorListener);
}
- protected void disengageImageModel() {
- this.imageModel.removePropertyChangeListener(PropertyValueModel.VALUE, this.listener);
+ protected void disposeImageDescriptorModel() {
+ if (this.imageDescriptorModel != null) {
+ ImageDescriptor descriptor = this.imageDescriptorModel.getValue();
+ if (descriptor != null) {
+ this.manager.getResourceManager().destroyImage(descriptor);
+ }
+ this.disengageImageDescriptorModel();
+ this.imageDescriptorModel = null;
+ }
}
- protected void disposeImageModel() {
- if (this.imageModel != null) {
- this.disengageImageModel();
- this.imageModel = null;
+
+ // ********** image descriptor listener **********
+
+ protected synchronized PropertyChangeListener getImageDescriptorListener() {
+ if (this.imageDescriptorListener == null) {
+ this.imageDescriptorListener = this.buildImageDescriptorListener();
}
+ return this.imageDescriptorListener;
+ }
+
+ /**
+ * Build a listener that will listen to the {@link #imageDescriptorModel}.
+ */
+ protected PropertyChangeListener buildImageDescriptorListener() {
+ return new ImageDescriptorListener();
+ }
+
+ /* CU private */ class ImageDescriptorListener
+ extends PropertyChangeAdapter
+ {
+ @Override
+ public void propertyChanged(PropertyChangeEvent event) {
+ AbstractItemExtendedLabelProvider.this.imageDescriptorChanged();
+ }
+ }
+
+ /* CU private */ void imageDescriptorChanged() {
+ this.manager.updateLabel(this.item);
}
@@ -134,11 +185,11 @@ public abstract class AbstractItemExtendedLabelProvider<I>
}
protected void engageTextModel() {
- this.textModel.addPropertyChangeListener(PropertyValueModel.VALUE, this.getListener());
+ this.textModel.addPropertyChangeListener(PropertyValueModel.VALUE, this.getTextListener());
}
protected void disengageTextModel() {
- this.textModel.removePropertyChangeListener(PropertyValueModel.VALUE, this.listener);
+ this.textModel.removePropertyChangeListener(PropertyValueModel.VALUE, this.textListener);
}
protected void disposeTextModel() {
@@ -149,6 +200,36 @@ public abstract class AbstractItemExtendedLabelProvider<I>
}
+ // ********** text listener **********
+
+ protected synchronized PropertyChangeListener getTextListener() {
+ if (this.textListener == null) {
+ this.textListener = this.buildTextListener();
+ }
+ return this.textListener;
+ }
+
+ /**
+ * Build a listener that will listen to the {@link #textModel}.
+ */
+ protected PropertyChangeListener buildTextListener() {
+ return new TextListener();
+ }
+
+ /* CU private */ class TextListener
+ extends PropertyChangeAdapter
+ {
+ @Override
+ public void propertyChanged(PropertyChangeEvent event) {
+ AbstractItemExtendedLabelProvider.this.textChanged();
+ }
+ }
+
+ /* CU private */ void textChanged() {
+ this.manager.updateLabel(this.item);
+ }
+
+
// ********** description **********
public String getDescription() {
@@ -174,11 +255,11 @@ public abstract class AbstractItemExtendedLabelProvider<I>
}
protected void engageDescriptionModel() {
- this.descriptionModel.addPropertyChangeListener(PropertyValueModel.VALUE, this.getListener());
+ this.descriptionModel.addPropertyChangeListener(PropertyValueModel.VALUE, this.getDescriptionListener());
}
protected void disengageDescriptionModel() {
- this.descriptionModel.removePropertyChangeListener(PropertyValueModel.VALUE, this.listener);
+ this.descriptionModel.removePropertyChangeListener(PropertyValueModel.VALUE, this.descriptionListener);
}
protected void disposeDescriptionModel() {
@@ -189,41 +270,40 @@ public abstract class AbstractItemExtendedLabelProvider<I>
}
- // ********** listener **********
+ // ********** description listener **********
- protected synchronized PropertyChangeListener getListener() {
- if (this.listener == null) {
- this.listener = this.buildListener();
+ protected synchronized PropertyChangeListener getDescriptionListener() {
+ if (this.descriptionListener == null) {
+ this.descriptionListener = this.buildDescriptionListener();
}
- return this.listener;
+ return this.descriptionListener;
}
/**
- * Build a listener that will listen to the {@link #imageModel},
- * {@link #textModel}, and {@link #descriptionModel}.
+ * Build a listener that will listen to the {@link #descriptionModel}.
*/
- protected PropertyChangeListener buildListener() {
- return new Listener();
+ protected PropertyChangeListener buildDescriptionListener() {
+ return new DescriptionListener();
}
- /* CU private */ class Listener
+ /* CU private */ class DescriptionListener
extends PropertyChangeAdapter
{
@Override
public void propertyChanged(PropertyChangeEvent event) {
- AbstractItemExtendedLabelProvider.this.itemChanged();
+ AbstractItemExtendedLabelProvider.this.descriptionChanged();
}
}
- /* CU private */ void itemChanged() {
- this.manager.updateLabel(this.item);
+ /* CU private */ void descriptionChanged() {
+ this.manager.updateDescription(this.item);
}
// ********** dispose **********
public synchronized void dispose() {
- this.disposeImageModel();
+ this.disposeImageDescriptorModel();
this.disposeTextModel();
this.disposeDescriptionModel();
}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/AbstractItemStructuredStateProviderManager.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/AbstractItemStructuredStateProviderManager.java
index 7d856122df..aad50d2efd 100644
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/AbstractItemStructuredStateProviderManager.java
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/AbstractItemStructuredStateProviderManager.java
@@ -10,6 +10,7 @@
package org.eclipse.jpt.common.ui.internal.jface;
import java.util.HashMap;
+import org.eclipse.jface.resource.ResourceManager;
import org.eclipse.jface.viewers.BaseLabelProvider;
import org.eclipse.jface.viewers.LabelProviderChangedEvent;
import org.eclipse.jface.viewers.StructuredViewer;
@@ -56,12 +57,21 @@ public abstract class AbstractItemStructuredStateProviderManager<V extends Struc
protected final HashMap<Object, ItemExtendedLabelProvider> itemLabelProviders = new HashMap<Object, ItemExtendedLabelProvider>();
+ /**
+ * Never <code>null</code>.
+ */
+ protected final ResourceManager resourceManager;
+
protected volatile V viewer;
- protected AbstractItemStructuredStateProviderManager(ItemExtendedLabelProviderFactory itemLabelProviderFactory) {
+ protected AbstractItemStructuredStateProviderManager(ItemExtendedLabelProviderFactory itemLabelProviderFactory, ResourceManager resourceManager) {
super();
this.itemLabelProviderFactory = itemLabelProviderFactory;
+ if (resourceManager == null) {
+ throw new NullPointerException();
+ }
+ this.resourceManager = resourceManager;
}
@@ -85,7 +95,7 @@ public abstract class AbstractItemStructuredStateProviderManager<V extends Struc
public Image getImage(Object element) {
ItemLabelProvider provider = this.getItemLabelProvider(element);
- return (provider == null) ? null :provider.getImage();
+ return (provider == null) ? null : provider.getImage();
}
public String getText(Object element) {
@@ -218,13 +228,12 @@ public abstract class AbstractItemStructuredStateProviderManager<V extends Struc
// ********** misc **********
- protected void execute(Runnable runnable) {
- SWTUtil.execute(this.viewer, runnable);
+ public ResourceManager getResourceManager() {
+ return this.resourceManager;
}
- @Override
- public String toString() {
- return ObjectTools.toString(this);
+ protected void execute(Runnable runnable) {
+ SWTUtil.execute(this.viewer, runnable);
}
protected boolean viewerIsAlive() {
@@ -232,15 +241,21 @@ public abstract class AbstractItemStructuredStateProviderManager<V extends Struc
return (control != null) && ! control.isDisposed();
}
+ @Override
+ public String toString() {
+ return ObjectTools.toString(this);
+ }
+
// ********** dispose **********
/**
- * Disposes all items
+ * Disposes resource manager and all item providers.
*/
@Override
public synchronized void dispose() {
this.disposeProviders();
+ this.resourceManager.dispose();
super.dispose();
}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/AbstractStaticItemLabelProvider.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/AbstractStaticItemLabelProvider.java
new file mode 100644
index 0000000000..3759516e36
--- /dev/null
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/AbstractStaticItemLabelProvider.java
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Oracle. All rights reserved.
+ * 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.common.ui.internal.jface;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jpt.common.ui.jface.ItemLabelProvider;
+import org.eclipse.jpt.common.utility.internal.ObjectTools;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * Item label provider that contains unchanging image and text.
+ */
+public abstract class AbstractStaticItemLabelProvider<M extends ItemLabelProvider.Manager>
+ implements ItemLabelProvider
+{
+ protected final ImageDescriptor imageDescriptor;
+ protected final String text;
+ protected final M manager;
+
+ /**
+ * Construct an item label provider that returns the specified text but
+ * no image.
+ */
+ protected AbstractStaticItemLabelProvider(String text) {
+ this(null, text, null);
+ }
+
+ /**
+ * Construct an item label provider that returns the specified image
+ * and text. The manager need only be specified if the specified image
+ * descriptor is not <code>null</code>.
+ */
+ protected AbstractStaticItemLabelProvider(ImageDescriptor imageDescriptor, String text, M manager) {
+ super();
+ this.imageDescriptor = imageDescriptor;
+ this.text = text;
+ if ((imageDescriptor != null) && (manager == null)) {
+ throw new NullPointerException();
+ }
+ this.manager = manager;
+ }
+
+ public Image getImage() {
+ return (this.imageDescriptor == null) ? null : this.getImage_();
+ }
+
+ /**
+ * Pre-condition: the image descriptor is not <code>null</code>.
+ */
+ protected Image getImage_() {
+ return this.manager.getResourceManager().createImage(this.imageDescriptor);
+ }
+
+ public String getText() {
+ return this.text;
+ }
+
+ public void dispose() {
+ if (this.imageDescriptor != null) {
+ this.manager.getResourceManager().destroyImage(this.imageDescriptor);
+ }
+ }
+
+ @Override
+ public String toString() {
+ return ObjectTools.toString(this, this.text);
+ }
+}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/ImageImageDescriptor.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/ImageImageDescriptor.java
deleted file mode 100644
index e2079e0227..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/ImageImageDescriptor.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.common.ui.internal.jface;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-
-/**
- * Image descriptor for an image.
- */
-public class ImageImageDescriptor extends ImageDescriptor
-{
-
- private Image fImage;
-
- /**
- * Constructor for ImagImageDescriptor.
- */
- public ImageImageDescriptor(Image image) {
- super();
- this.fImage = image;
- }
-
- @Override
- public boolean equals(Object obj) {
- return (obj != null) && getClass().equals(obj.getClass()) && this.fImage.equals(((ImageImageDescriptor) obj).fImage);
- }
-
- @Override
- public ImageData getImageData() {
- return this.fImage.getImageData();
- }
-
- @Override
- public int hashCode() {
- return this.fImage.hashCode();
- }
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/ItemStructuredStateProviderManager.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/ItemStructuredStateProviderManager.java
index 677c1d526f..2d9b249774 100644
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/ItemStructuredStateProviderManager.java
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/ItemStructuredStateProviderManager.java
@@ -9,6 +9,7 @@
******************************************************************************/
package org.eclipse.jpt.common.ui.internal.jface;
+import org.eclipse.jface.resource.ResourceManager;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.jpt.common.ui.jface.ItemExtendedLabelProviderFactory;
import org.eclipse.jpt.common.ui.jface.ItemStructuredContentProvider;
@@ -26,12 +27,12 @@ public class ItemStructuredStateProviderManager
protected final ItemStructuredContentProviderFactory itemContentProviderFactory;
- public ItemStructuredStateProviderManager(ItemStructuredContentProviderFactory itemContentProviderFactory) {
- this(itemContentProviderFactory, null);
+ public ItemStructuredStateProviderManager(ItemStructuredContentProviderFactory itemContentProviderFactory, ResourceManager resourceManager) {
+ this(itemContentProviderFactory, null, resourceManager);
}
- public ItemStructuredStateProviderManager(ItemStructuredContentProviderFactory itemContentProviderFactory, ItemExtendedLabelProviderFactory itemLabelProviderFactory) {
- super(itemLabelProviderFactory);
+ public ItemStructuredStateProviderManager(ItemStructuredContentProviderFactory itemContentProviderFactory, ItemExtendedLabelProviderFactory itemLabelProviderFactory, ResourceManager resourceManager) {
+ super(itemLabelProviderFactory, resourceManager);
if (itemContentProviderFactory == null) {
throw new NullPointerException();
}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/ItemTreeStateProviderManager.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/ItemTreeStateProviderManager.java
index cf71d489e1..46942082c2 100644
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/ItemTreeStateProviderManager.java
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/ItemTreeStateProviderManager.java
@@ -9,8 +9,8 @@
******************************************************************************/
package org.eclipse.jpt.common.ui.internal.jface;
+import org.eclipse.jface.resource.ResourceManager;
import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
import org.eclipse.jpt.common.ui.jface.ItemExtendedLabelProviderFactory;
import org.eclipse.jpt.common.ui.jface.ItemTreeContentProvider;
import org.eclipse.jpt.common.ui.jface.ItemTreeContentProviderFactory;
@@ -32,12 +32,12 @@ public class ItemTreeStateProviderManager
protected final ItemTreeContentProviderFactory itemContentProviderFactory;
- public ItemTreeStateProviderManager(ItemTreeContentProviderFactory itemContentProviderFactory) {
- this(itemContentProviderFactory, null);
+ public ItemTreeStateProviderManager(ItemTreeContentProviderFactory itemContentProviderFactory, ResourceManager resourceManager) {
+ this(itemContentProviderFactory, null, resourceManager);
}
- public ItemTreeStateProviderManager(ItemTreeContentProviderFactory itemContentProviderFactory, ItemExtendedLabelProviderFactory itemLabelProviderFactory) {
- super(itemLabelProviderFactory);
+ public ItemTreeStateProviderManager(ItemTreeContentProviderFactory itemContentProviderFactory, ItemExtendedLabelProviderFactory itemLabelProviderFactory, ResourceManager resourceManager) {
+ super(itemLabelProviderFactory, resourceManager);
if (itemContentProviderFactory == null) {
throw new NullPointerException();
}
@@ -74,7 +74,7 @@ public class ItemTreeStateProviderManager
* Dispatch to the UI thread.
*/
public void updateChildren(Object inputElement) {
- SWTUtil.execute(this.viewer, new UpdateChildrenRunnable(inputElement));
+ this.execute(new UpdateChildrenRunnable(inputElement));
}
/* CU private */ class UpdateChildrenRunnable
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/NavigatorContentProvider.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/NavigatorContentProvider.java
index a0160da32e..0844615188 100644
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/NavigatorContentProvider.java
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/NavigatorContentProvider.java
@@ -9,6 +9,7 @@
******************************************************************************/
package org.eclipse.jpt.common.ui.internal.jface;
+import org.eclipse.jface.resource.ResourceManager;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jpt.common.ui.jface.ItemExtendedLabelProviderFactory;
import org.eclipse.jpt.common.ui.jface.ItemTreeContentProviderFactory;
@@ -28,6 +29,7 @@ import org.eclipse.ui.navigator.ICommonContentProvider;
public abstract class NavigatorContentProvider
implements ICommonContentProvider
{
+ protected final ResourceManager resourceManager;
protected TreeStateProvider delegate;
@@ -38,9 +40,18 @@ public abstract class NavigatorContentProvider
*/
protected NavigatorContentProvider() {
super();
+ this.resourceManager = this.buildResourceManager();
}
/**
+ * Return a <em>local</em> resource manager to be used, typically, by the
+ * item label providers to retrieve {@link org.eclipse.swt.graphics.Image}s.
+ * The returned resource manager will be disposed when the provider is
+ * {@link #dispose() disposed}.
+ */
+ protected abstract ResourceManager buildResourceManager();
+
+ /**
* The content provider is initialized first; so we build the delegate
* here.
*/
@@ -51,7 +62,8 @@ public abstract class NavigatorContentProvider
protected TreeStateProvider buildDelegate() {
return new ItemTreeStateProviderManager(
this.buildItemContentProviderFactory(),
- this.buildItemLabelProviderFactory()
+ this.buildItemLabelProviderFactory(),
+ this.resourceManager
);
}
@@ -124,6 +136,7 @@ public abstract class NavigatorContentProvider
public void dispose() {
this.delegate.dispose();
+ this.resourceManager.dispose();
}
/**
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/OverlayImageDescriptor.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/OverlayImageDescriptor.java
new file mode 100644
index 0000000000..9258926050
--- /dev/null
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/OverlayImageDescriptor.java
@@ -0,0 +1,198 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2008 IBM Corporation and others.
+ * Copyright (c) 2012 Oracle. All rights reserved.
+ * 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.common.ui.internal.jface;
+
+import java.util.Arrays;
+import org.eclipse.jface.resource.CompositeImageDescriptor;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.IDecoration;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.Point;
+
+/**
+ * An overlay image descriptor is an image descriptor that can be used
+ * to overlay decoration images on to the 4 corner quadrants of a base image.
+ * The four quadrants are:<ul>
+ * <li>{@link IDecoration#TOP_LEFT}
+ * <li>{@link IDecoration#TOP_RIGHT}
+ * <li>{@link IDecoration#BOTTOM_LEFT}
+ * <li>{@link IDecoration#BOTTOM_RIGHT}
+ * </ul>
+ * Additionally, the overlay can be used to provide an underlay corresponding
+ * to {@link IDecoration#UNDERLAY}.
+ * Alternatively, the base image can be replaced by specifying an image
+ * corresponding to {@link IDecoration#REPLACE}.
+ *
+ * @see IDecoration
+ * @see org.eclipse.jface.viewers.DecorationOverlayIcon DecorationOverlayIcon
+ */
+public class OverlayImageDescriptor
+ extends CompositeImageDescriptor
+{
+ private ImageDescriptor base;
+
+ private ImageDescriptor[] overlays;
+
+ private Point size;
+
+
+ /**
+ * Construct the overlay image descriptor for the specified base image,
+ * overlaid by the image descriptors in the specified array.
+ * The indices of the array correspond to the values
+ * of the 6 overlay constants defined on {@link IDecoration}:<ol start=0>
+ * <li>{@link IDecoration#TOP_LEFT}
+ * <li>{@link IDecoration#TOP_RIGHT}
+ * <li>{@link IDecoration#BOTTOM_LEFT}
+ * <li>{@link IDecoration#BOTTOM_RIGHT}
+ * <li>{@link IDecoration#UNDERLAY}
+ * <li>{@link IDecoration#REPLACE}
+ * </ol>
+ * The resulting image will have the same size as the specified base image.
+ */
+ public OverlayImageDescriptor(ImageDescriptor base, ImageDescriptor[] overlays) {
+ this(base, overlays, new Point(base.getImageData().width, base.getImageData().height));
+ }
+
+ /**
+ * Construct the overlay image descriptor for the specified base image,
+ * overlaid in the specified quadrant by the specified overlay image
+ * descriptor.
+ * The specified quandrant must correspond to on of the values
+ * of the 6 overlay constants defined on {@link IDecoration}:<ol start=0>
+ * <li>{@link IDecoration#TOP_LEFT}
+ * <li>{@link IDecoration#TOP_RIGHT}
+ * <li>{@link IDecoration#BOTTOM_LEFT}
+ * <li>{@link IDecoration#BOTTOM_RIGHT}
+ * <li>{@link IDecoration#UNDERLAY}
+ * <li>{@link IDecoration#REPLACE}
+ * </ol>
+ * The resulting image will have the same size as the specified base image.
+ */
+ public OverlayImageDescriptor(ImageDescriptor base, ImageDescriptor overlay, int quadrant) {
+ this(base, convertToArray(overlay, quadrant));
+ }
+
+ private static ImageDescriptor[] convertToArray(ImageDescriptor overlay, int quadrant) {
+ ImageDescriptor[] overlays = new ImageDescriptor[] { null, null, null, null, null, null };
+ overlays[quadrant] = overlay;
+ return overlays;
+ }
+
+ /**
+ * Construct the overlay image descriptor for the specified base image,
+ * overlaid by the image descriptors in the specified array.
+ * The indices of the array correspond to the values
+ * of the 6 overlay constants defined on {@link IDecoration}:<ol start=0>
+ * <li>{@link IDecoration#TOP_LEFT}
+ * <li>{@link IDecoration#TOP_RIGHT}
+ * <li>{@link IDecoration#BOTTOM_LEFT}
+ * <li>{@link IDecoration#BOTTOM_RIGHT}
+ * <li>{@link IDecoration#UNDERLAY}
+ * <li>{@link IDecoration#REPLACE}
+ * </ol>
+ * The resulting image will have the specified size.
+ */
+ public OverlayImageDescriptor(ImageDescriptor base, ImageDescriptor[] overlays, Point size) {
+ super();
+ if ((base == null) || (overlays == null) || (size == null)) {
+ throw new NullPointerException();
+ }
+ this.base = base;
+ this.overlays = overlays;
+ this.size = size;
+ }
+
+ /**
+ * Draw the underlay image first, followed by either the base image or the
+ * replacement image, followed by the overlay images in the order indicated
+ * by the overlay constants defined on {@link IDecoration}.
+ */
+ @Override
+ protected void drawCompositeImage(int width, int height) {
+ if (this.overlays.length > IDecoration.UNDERLAY) {
+ ImageDescriptor underlay = this.overlays[IDecoration.UNDERLAY];
+ if (underlay != null) {
+ this.drawImage(underlay.getImageData(), 0, 0);
+ }
+ }
+
+ ImageDescriptor temp = this.base;
+ if (this.overlays.length > IDecoration.REPLACE) {
+ ImageDescriptor replace = this.overlays[IDecoration.REPLACE];
+ if (replace != null) {
+ temp = replace;
+ }
+ }
+ this.drawImage(this.convertToImageData(temp), 0, 0);
+
+ for (int i = 0; i < this.overlays.length; i++) {
+ ImageDescriptor overlay = this.overlays[i];
+ if (overlay == null) {
+ continue;
+ }
+ ImageData overlayData = this.convertToImageData(overlay);
+ switch (i) {
+ case IDecoration.TOP_LEFT:
+ this.drawImage(overlayData, 0, 0);
+ break;
+ case IDecoration.TOP_RIGHT:
+ this.drawImage(overlayData, (this.size.x - overlayData.width), 0);
+ break;
+ case IDecoration.BOTTOM_LEFT:
+ this.drawImage(overlayData, 0, (this.size.y - overlayData.height));
+ break;
+ case IDecoration.BOTTOM_RIGHT:
+ this.drawImage(overlayData, (this.size.x - overlayData.width), (this.size.y - overlayData.height));
+ break;
+ default:
+ // NOP
+ }
+ }
+ }
+
+ private ImageData convertToImageData(ImageDescriptor imageDescriptor) {
+ ImageData imageData = imageDescriptor.getImageData();
+ return (imageData != null) ? imageData : ImageDescriptor.getMissingImageDescriptor().getImageData();
+ }
+
+ @Override
+ protected Point getSize() {
+ return this.size;
+ }
+
+ @Override
+ protected int getTransparentPixel() {
+ return this.base.getImageData().transparentPixel;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if ( ! (o instanceof OverlayImageDescriptor)) {
+ return false;
+ }
+ OverlayImageDescriptor other = (OverlayImageDescriptor) o;
+ return this.base.equals(other.base)
+ && Arrays.equals(this.overlays, other.overlays)
+ && this.size.equals(other.size);
+ }
+
+ @Override
+ public int hashCode() {
+ int code = this.base.hashCode();
+ for (ImageDescriptor overlay : this.overlays) {
+ if (overlay != null) {
+ code ^= overlay.hashCode();
+ }
+ }
+ return code ^= this.size.hashCode();
+ }
+}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/PluggableLabelProvider.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/PluggableLabelProvider.java
new file mode 100644
index 0000000000..6f7eca24c3
--- /dev/null
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/PluggableLabelProvider.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Oracle. All rights reserved.
+ * 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.common.ui.internal.jface;
+
+import org.eclipse.jpt.common.utility.internal.transformer.StringObjectTransformer;
+import org.eclipse.jpt.common.utility.transformer.Transformer;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * A label provider that returns the value returned by the
+ * {@link #textTransformer text transformer} for an element's text and
+ * the value returned by the {@link #imageTransformer image transformer} for
+ * the element's image.
+ *
+ * @parm <E> the type of the objects passed to the label provider
+ */
+public class PluggableLabelProvider<E>
+ extends PluggableTextLabelProvider<E>
+{
+ private volatile Transformer<E, Image> imageTransformer;
+
+
+ /**
+ * Construct a label provider that returns an element's
+ * {@link Object#toString() toString()} value for its text and
+ * <code>null</code> for its image.
+ * @see #setImageTransformer(Transformer)
+ * @see org.eclipse.jface.viewers.LabelProvider LabelProvider
+ */
+ public PluggableLabelProvider() {
+ this(Transformer.Null.<E, Image>instance(), StringObjectTransformer.<E>instance());
+ }
+
+ /**
+ * Construct a label provider that returns the value returned by the
+ * specified transformer for an element's text and
+ * <code>null</code> for its image.
+ * @see #setImageTransformer(Transformer)
+ */
+ public PluggableLabelProvider(Transformer<E, String> textTransformer) {
+ this(Transformer.Null.<E, Image>instance(), textTransformer);
+ }
+
+ /**
+ * Construct a label provider that returns the value returned by the
+ * specified text transformer for an element's text and
+ * the value returned by the specified image transformer for
+ * the element's image.
+ */
+ public PluggableLabelProvider(Transformer<E, Image> imageTransformer, Transformer<E, String> textTransformer) {
+ super(textTransformer);
+ if (imageTransformer == null) {
+ throw new NullPointerException();
+ }
+ this.imageTransformer = imageTransformer;
+ }
+
+ /**
+ * @exception ClassCastException if the element is not the same type as the
+ * image {@link Transformer transformer}'s generic type argument {@code <T1>}.
+ */
+ @Override
+ @SuppressWarnings("unchecked")
+ public Image getImage(Object element) {
+ return this.imageTransformer.transform((E) element);
+ }
+
+ public void setImageTransformer(Transformer<E, Image> imageTransformer) {
+ if (imageTransformer == null) {
+ throw new NullPointerException();
+ }
+ this.imageTransformer = imageTransformer;
+ }
+}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/PluggableTableLabelProvider.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/PluggableTableLabelProvider.java
new file mode 100644
index 0000000000..0054efe531
--- /dev/null
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/PluggableTableLabelProvider.java
@@ -0,0 +1,121 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Oracle. All rights reserved.
+ * 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.common.ui.internal.jface;
+
+import java.io.Serializable;
+import org.eclipse.jpt.common.utility.internal.ObjectTools;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * A table label provider that returns the value returned by the
+ * {@link #textTransformer text transformer} for an element's text and
+ * the value returned by the {@link #imageTransformer image transformer} for
+ * the element's image.
+ *
+ * @parm <E> the type of the objects passed to the label provider
+ */
+public class PluggableTableLabelProvider<E>
+ extends PluggableTextTableLabelProvider<E>
+{
+ private volatile Transformer<E, Image> imageTransformer;
+
+
+ /**
+ * Construct a label provider that returns an element's
+ * {@link Object#toString() toString()} value for its text and
+ * <code>null</code> for its image.
+ * @see #setImageTransformer(ImageTransformer)
+ */
+ public PluggableTableLabelProvider() {
+ this(DefaultImageTransformer.<E>instance(), DefaultTextTransformer.<E>instance());
+ }
+
+ /**
+ * Construct a label provider that returns the value returned by the
+ * specified transformer for an element's text and
+ * <code>null</code> for its image.
+ * @see #setImageTransformer(ImageTransformer)
+ */
+ public PluggableTableLabelProvider(TextTransformer<E> textTransformer) {
+ this(DefaultImageTransformer.<E>instance(), textTransformer);
+ }
+
+ /**
+ * Construct a label provider that returns the value returned by the
+ * specified text transformer for an element's text and
+ * the value returned by the specified image transformer for
+ * the element's image.
+ */
+ public PluggableTableLabelProvider(ImageTransformer<E> imageTransformer, TextTransformer<E> textTransformer) {
+ super(textTransformer);
+ if (imageTransformer == null) {
+ throw new NullPointerException();
+ }
+ this.imageTransformer = imageTransformer;
+ }
+
+ /**
+ * @exception ClassCastException if the element is not the same type as the
+ * {@link ImageTransformer image transformer}'s generic type argument {@code <E>}.
+ */
+ @Override
+ @SuppressWarnings("unchecked")
+ public Image getColumnImage(Object element, int columnIndex) {
+ return this.imageTransformer.transform((E) element, columnIndex);
+ }
+
+ public void setImageTransformer(ImageTransformer<E> imageTransformer) {
+ if (imageTransformer == null) {
+ throw new NullPointerException();
+ }
+ this.imageTransformer = imageTransformer;
+ }
+
+
+ // ********** transformers **********
+
+ public interface ImageTransformer<E>
+ extends Transformer<E, Image>
+ {
+ Image transform(E element, int columnIndex);
+ }
+
+ public static class DefaultImageTransformer<E>
+ implements ImageTransformer<E>, Serializable
+ {
+ @SuppressWarnings("rawtypes")
+ public static final ImageTransformer<?> INSTANCE = new DefaultImageTransformer();
+
+ @SuppressWarnings("unchecked")
+ public static <R> ImageTransformer<R> instance() {
+ return (ImageTransformer<R>) INSTANCE;
+ }
+
+ // ensure single instance
+ private DefaultImageTransformer() {
+ super();
+ }
+
+ public Image transform(E element, int columnIndex) {
+ return null;
+ }
+
+ @Override
+ public String toString() {
+ return ObjectTools.toString(this);
+ }
+
+ private static final long serialVersionUID = 1L;
+ private Object readResolve() {
+ // replace this object with the singleton
+ return INSTANCE;
+ }
+ }
+}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/PluggableTextLabelProvider.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/PluggableTextLabelProvider.java
new file mode 100644
index 0000000000..6290fb591d
--- /dev/null
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/PluggableTextLabelProvider.java
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Oracle. All rights reserved.
+ * 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.common.ui.internal.jface;
+
+import org.eclipse.jface.viewers.BaseLabelProvider;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jpt.common.utility.internal.ObjectTools;
+import org.eclipse.jpt.common.utility.internal.transformer.StringObjectTransformer;
+import org.eclipse.jpt.common.utility.transformer.Transformer;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * A label provider that returns the value returned by the
+ * {@link #textTransformer text transformer} for an element's text and
+ * <code>null</code> for its image.
+ *
+ * @see org.eclipse.jface.viewers.LabelProvider LabelProvider
+ *
+ * @parm <E> the type of the objects passed to the label provider
+ */
+public class PluggableTextLabelProvider<E>
+ extends BaseLabelProvider
+ implements ILabelProvider
+{
+ private volatile Transformer<E, String> textTransformer;
+
+
+ /**
+ * Construct a label provider that returns an element's
+ * {@link Object#toString() toString()} value for its text and
+ * <code>null</code> for its image.
+ * @see #setTextTransformer(Transformer)
+ * @see org.eclipse.jface.viewers.LabelProvider LabelProvider
+ */
+ public PluggableTextLabelProvider() {
+ this(StringObjectTransformer.<E>instance());
+ }
+
+ /**
+ * Construct a label provider that returns the value returned by the
+ * specified transformer for an element's text and
+ * <code>null</code> for its image.
+ */
+ public PluggableTextLabelProvider(Transformer<E, String> textTransformer) {
+ super();
+ if (textTransformer == null) {
+ throw new NullPointerException();
+ }
+ this.textTransformer = textTransformer;
+ }
+
+ /**
+ * Return <code>null</code>.
+ */
+ public Image getImage(Object element) {
+ return null;
+ }
+
+ /**
+ * @exception ClassCastException if the element is not the same type as the
+ * text {@link Transformer transformer}'s generic type argument {@code <T1>}.
+ */
+ @SuppressWarnings("unchecked")
+ public String getText(Object element) {
+ return this.textTransformer.transform((E) element);
+ }
+
+ public void setTextTransformer(Transformer<E, String> textTransformer) {
+ if (textTransformer == null) {
+ throw new NullPointerException();
+ }
+ this.textTransformer = textTransformer;
+ }
+
+ @Override
+ public String toString() {
+ return ObjectTools.toString(this);
+ }
+}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/PluggableTextTableLabelProvider.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/PluggableTextTableLabelProvider.java
new file mode 100644
index 0000000000..cb5114142c
--- /dev/null
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/PluggableTextTableLabelProvider.java
@@ -0,0 +1,129 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Oracle. All rights reserved.
+ * 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.common.ui.internal.jface;
+
+import java.io.Serializable;
+import org.eclipse.jface.viewers.BaseLabelProvider;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jpt.common.utility.internal.ObjectTools;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * A table label provider that returns the value returned by the
+ * {@link #textTransformer text transformer} for an element's text and
+ * <code>null</code> for its image.
+ *
+ * @see org.eclipse.jface.viewers.LabelProvider LabelProvider
+ *
+ * @parm <E> the type of the objects passed to the label provider
+ */
+public class PluggableTextTableLabelProvider<E>
+ extends BaseLabelProvider
+ implements ITableLabelProvider
+{
+ private volatile TextTransformer<E> textTransformer;
+
+
+ /**
+ * Construct a label provider that returns an element's
+ * {@link Object#toString() toString()} value for its text and
+ * <code>null</code> for its image.
+ * @see #setTextTransformer(TextTransformer)
+ */
+ public PluggableTextTableLabelProvider() {
+ this(DefaultTextTransformer.<E>instance());
+ }
+
+ /**
+ * Construct a label provider that returns the value returned by the
+ * specified transformer for an element's text and
+ * <code>null</code> for its image.
+ */
+ public PluggableTextTableLabelProvider(TextTransformer<E> textTransformer) {
+ super();
+ if (textTransformer == null) {
+ throw new NullPointerException();
+ }
+ this.textTransformer = textTransformer;
+ }
+
+ /**
+ * Return <code>null</code>.
+ */
+ public Image getColumnImage(Object element, int columnIndex) {
+ return null;
+ }
+
+ /**
+ * @exception ClassCastException if the element is not the same type as the
+ * {@link TextTransformer text transformer}'s generic type argument {@code <E>}.
+ */
+ @SuppressWarnings("unchecked")
+ public String getColumnText(Object element, int columnIndex) {
+ return this.textTransformer.transform((E) element, columnIndex);
+ }
+
+ public void setTextTransformer(TextTransformer<E> textTransformer) {
+ if (textTransformer == null) {
+ throw new NullPointerException();
+ }
+ this.textTransformer = textTransformer;
+ }
+
+ @Override
+ public String toString() {
+ return ObjectTools.toString(this);
+ }
+
+
+ // ********** transformers **********
+
+ public interface Transformer<T1, T2> {
+ T2 transform(T1 element, int columnIndex);
+ }
+
+ public interface TextTransformer<E>
+ extends Transformer<E, String>
+ {
+ String transform(E element, int columnIndex);
+ }
+
+ public static class DefaultTextTransformer<E>
+ implements TextTransformer<E>, Serializable
+ {
+ @SuppressWarnings("rawtypes")
+ public static final TextTransformer<?> INSTANCE = new DefaultTextTransformer();
+
+ @SuppressWarnings("unchecked")
+ public static <R> TextTransformer<R> instance() {
+ return (TextTransformer<R>) INSTANCE;
+ }
+
+ // ensure single instance
+ private DefaultTextTransformer() {
+ super();
+ }
+
+ public String transform(E element, int columnIndex) {
+ return (element == null) ? null : element.toString();
+ }
+
+ @Override
+ public String toString() {
+ return ObjectTools.toString(this);
+ }
+
+ private static final long serialVersionUID = 1L;
+ private Object readResolve() {
+ // replace this object with the singleton
+ return INSTANCE;
+ }
+ }
+}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/ResourceManagerLabelProvider.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/ResourceManagerLabelProvider.java
new file mode 100644
index 0000000000..7ca174bcae
--- /dev/null
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/ResourceManagerLabelProvider.java
@@ -0,0 +1,113 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Oracle. All rights reserved.
+ * 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.common.ui.internal.jface;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.resource.LocalResourceManager;
+import org.eclipse.jface.resource.ResourceManager;
+import org.eclipse.jpt.common.utility.internal.transformer.StringObjectTransformer;
+import org.eclipse.jpt.common.utility.transformer.Transformer;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * A label provider that returns the value returned by the
+ * {@link #textTransformer text transformer} for an element's text and
+ * the value returned by the
+ * {@link #imageDescriptorTransformer image descriptor transformer} to
+ * retrieve the element's image from a {@link ResourceManager resource manager}.
+ * The label provider uses a local {@link ResourceManager}
+ * to allocate the label images. This resource manager will be disposed
+ * when the label provider is disposed.
+ *
+ * @parm <E> the type of the objects passed to the label provider
+ */
+public class ResourceManagerLabelProvider<E>
+ extends PluggableTextLabelProvider<E>
+{
+ private volatile Transformer<E, ImageDescriptor> imageDescriptorTransformer;
+ private final ResourceManager resourceManager;
+
+
+ /**
+ * Construct a label provider that uses the
+ * {@link JFaceResources#getResources() default JFace resource manager}
+ * to allocate the label images.
+ * @see #setImageDescriptorTransformer(Transformer)
+ * @see #setTextTransformer(Transformer)
+ */
+ public ResourceManagerLabelProvider() {
+ this(JFaceResources.getResources());
+ }
+
+ /**
+ * Construct a label provider that uses the specified resource manager to
+ * allocate the label images.
+ * @see #setImageDescriptorTransformer(Transformer)
+ * @see #setTextTransformer(Transformer)
+ */
+ public ResourceManagerLabelProvider(ResourceManager resourceManager) {
+ this(Transformer.Null.<E, ImageDescriptor>instance(), resourceManager);
+ }
+
+ /**
+ * Construct a label provider that returns an element's
+ * {@link Object#toString() toString()} value for its text and
+ * the value returned by the specified image descriptor transformer to
+ * retrieve the element's image from the specified resource manager.
+ * @see #setTextTransformer(Transformer)
+ */
+ public ResourceManagerLabelProvider(Transformer<E, ImageDescriptor> imageDescriptorTransformer, ResourceManager resourceManager) {
+ this(imageDescriptorTransformer, StringObjectTransformer.<E>instance(), resourceManager);
+ }
+
+ /**
+ * Construct a label provider that returns the value returned by the
+ * specified text transformer for an element's text and
+ * the value returned by the specified image descriptor transformer to
+ * retrieve the element's image from the specified resource manager.
+ */
+ public ResourceManagerLabelProvider(Transformer<E, ImageDescriptor> imageDescriptorTransformer, Transformer<E, String> textTransformer, ResourceManager resourceManager) {
+ super(textTransformer);
+ if ((imageDescriptorTransformer == null) || (resourceManager == null)) {
+ throw new NullPointerException();
+ }
+ this.imageDescriptorTransformer = imageDescriptorTransformer;
+ this.resourceManager = new LocalResourceManager(resourceManager);
+ }
+
+ /**
+ * @exception ClassCastException if the element is not the same type as the
+ * image {@link Transformer transformer}'s generic type argument {@code <T1>}.
+ */
+ @Override
+ public Image getImage(Object element) {
+ ImageDescriptor imageDescriptor = this.getImageDescriptor(element);
+ return (imageDescriptor == null) ? null : this.resourceManager.createImage(imageDescriptor);
+ }
+
+ @SuppressWarnings("unchecked")
+ private ImageDescriptor getImageDescriptor(Object element) {
+ return this.imageDescriptorTransformer.transform((E) element);
+ }
+
+ public void setImageDescriptorTransformer(Transformer<E, ImageDescriptor> imageDescriptorTransformer) {
+ if (imageDescriptorTransformer == null) {
+ throw new NullPointerException();
+ }
+ this.imageDescriptorTransformer = imageDescriptorTransformer;
+ }
+
+ @Override
+ public void dispose() {
+ this.resourceManager.dispose();
+ super.dispose();
+ }
+}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/ResourceManagerTableLabelProvider.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/ResourceManagerTableLabelProvider.java
new file mode 100644
index 0000000000..d7b2bebd9f
--- /dev/null
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/ResourceManagerTableLabelProvider.java
@@ -0,0 +1,155 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Oracle. All rights reserved.
+ * 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.common.ui.internal.jface;
+
+import java.io.Serializable;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.resource.LocalResourceManager;
+import org.eclipse.jface.resource.ResourceManager;
+import org.eclipse.jpt.common.utility.internal.ObjectTools;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * A table label provider that returns the value returned by the
+ * {@link #textTransformer text transformer} for an element's text and
+ * the value returned by the
+ * {@link #imageDescriptorTransformer image descriptor transformer} to
+ * retrieve the element's image from a {@link ResourceManager resource manager}.
+ * The label provider uses a local {@link ResourceManager}
+ * to allocate the label images. This resource manager will be disposed
+ * when the label provider is disposed.
+ *
+ * @parm <E> the type of the objects passed to the label provider
+ */
+public class ResourceManagerTableLabelProvider<E>
+ extends PluggableTextTableLabelProvider<E>
+{
+ private volatile ImageDescriptorTransformer<E> imageDescriptorTransformer;
+ private final ResourceManager resourceManager;
+
+
+ /**
+ * Construct a table label provider that uses the
+ * {@link JFaceResources#getResources() default JFace resource manager}
+ * to allocate the label images.
+ * @see #setImageDescriptorTransformer(ImageDescriptorTransformer)
+ * @see #setTextTransformer(TextTransformer)
+ */
+ public ResourceManagerTableLabelProvider() {
+ this(JFaceResources.getResources());
+ }
+
+ /**
+ * Construct a table label provider that uses the specified resource manager to
+ * allocate the label images.
+ * @see #setImageDescriptorTransformer(ImageDescriptorTransformer)
+ * @see #setTextTransformer(TextTransformer)
+ */
+ public ResourceManagerTableLabelProvider(ResourceManager resourceManager) {
+ this(DefaultImageDescriptorTransformer.<E>instance(), resourceManager);
+ }
+
+ /**
+ * Construct a table label provider that returns an element's
+ * {@link Object#toString() toString()} value for its text and
+ * the value returned by the specified image descriptor transformer to
+ * retrieve the element's image from the specified resource manager.
+ * @see #setTextTransformer(TextTransformer)
+ */
+ public ResourceManagerTableLabelProvider(ImageDescriptorTransformer<E> imageDescriptorTransformer, ResourceManager resourceManager) {
+ this(imageDescriptorTransformer, DefaultTextTransformer.<E>instance(), resourceManager);
+ }
+
+ /**
+ * Construct a table label provider that returns the value returned by the
+ * specified text transformer for an element's text and
+ * the value returned by the specified image descriptor transformer to
+ * retrieve the element's image from the specified resource manager.
+ */
+ public ResourceManagerTableLabelProvider(ImageDescriptorTransformer<E> imageDescriptorTransformer, TextTransformer<E> textTransformer, ResourceManager resourceManager) {
+ super(textTransformer);
+ if ((imageDescriptorTransformer == null) || (resourceManager == null)) {
+ throw new NullPointerException();
+ }
+ this.imageDescriptorTransformer = imageDescriptorTransformer;
+ this.resourceManager = new LocalResourceManager(resourceManager);
+ }
+
+ /**
+ * @exception ClassCastException if the element is not the same type as the
+ * {@link ImageDescriptorTransformer image descriptor transformer}'s
+ * generic type argument {@code <T1>}.
+ */
+ @Override
+ public Image getColumnImage(Object element, int columnIndex) {
+ ImageDescriptor imageDescriptor = this.getColumnImageDescriptor(element, columnIndex);
+ return (imageDescriptor == null) ? null : this.resourceManager.createImage(imageDescriptor);
+ }
+
+ @SuppressWarnings("unchecked")
+ private ImageDescriptor getColumnImageDescriptor(Object element, int columnIndex) {
+ return this.imageDescriptorTransformer.transform((E) element, columnIndex);
+ }
+
+ public void setImageDescriptorTransformer(ImageDescriptorTransformer<E> imageDescriptorTransformer) {
+ if (imageDescriptorTransformer == null) {
+ throw new NullPointerException();
+ }
+ this.imageDescriptorTransformer = imageDescriptorTransformer;
+ }
+
+ @Override
+ public void dispose() {
+ this.resourceManager.dispose();
+ super.dispose();
+ }
+
+
+ // ********** transformers **********
+
+ public interface ImageDescriptorTransformer<E>
+ extends Transformer<E, ImageDescriptor>
+ {
+ ImageDescriptor transform(E element, int columnIndex);
+ }
+
+ public static class DefaultImageDescriptorTransformer<E>
+ implements ImageDescriptorTransformer<E>, Serializable
+ {
+ @SuppressWarnings("rawtypes")
+ public static final ImageDescriptorTransformer<?> INSTANCE = new DefaultImageDescriptorTransformer();
+
+ @SuppressWarnings("unchecked")
+ public static <R> ImageDescriptorTransformer<R> instance() {
+ return (ImageDescriptorTransformer<R>) INSTANCE;
+ }
+
+ // ensure single instance
+ private DefaultImageDescriptorTransformer() {
+ super();
+ }
+
+ public ImageDescriptor transform(E element, int columnIndex) {
+ return null;
+ }
+
+ @Override
+ public String toString() {
+ return ObjectTools.toString(this);
+ }
+
+ private static final long serialVersionUID = 1L;
+ private Object readResolve() {
+ // replace this object with the singleton
+ return INSTANCE;
+ }
+ }
+}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/StaticItemExtendedLabelProvider.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/StaticItemExtendedLabelProvider.java
index 5033a00292..f58191198c 100644
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/StaticItemExtendedLabelProvider.java
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/StaticItemExtendedLabelProvider.java
@@ -9,14 +9,14 @@
******************************************************************************/
package org.eclipse.jpt.common.ui.internal.jface;
+import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jpt.common.ui.jface.ItemExtendedLabelProvider;
-import org.eclipse.swt.graphics.Image;
/**
* Item label provider that contains unchanging image, text, and description.
*/
public class StaticItemExtendedLabelProvider
- extends StaticItemLabelProvider
+ extends AbstractStaticItemLabelProvider<ItemExtendedLabelProvider.Manager>
implements ItemExtendedLabelProvider
{
protected final String description;
@@ -27,7 +27,7 @@ public class StaticItemExtendedLabelProvider
* description.
*/
public StaticItemExtendedLabelProvider(String text) {
- this(null, text);
+ this(null, text, null);
}
/**
@@ -35,16 +35,16 @@ public class StaticItemExtendedLabelProvider
* and text. The provider will also return the specified text as the
* description.
*/
- public StaticItemExtendedLabelProvider(Image image, String text) {
- this(image, text, text);
+ public StaticItemExtendedLabelProvider(ImageDescriptor imageDescriptor, String text, ItemExtendedLabelProvider.Manager manager) {
+ this(imageDescriptor, text, text, manager);
}
/**
* Construct an item label provider that returns the specified image, text,
* and description.
*/
- public StaticItemExtendedLabelProvider(Image image, String text, String description) {
- super(image, text);
+ public StaticItemExtendedLabelProvider(ImageDescriptor imageDescriptor, String text, String description, ItemExtendedLabelProvider.Manager manager) {
+ super(imageDescriptor, text, manager);
this.description = description;
}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/StaticItemLabelProvider.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/StaticItemLabelProvider.java
index d2c2aa4bee..a610675cf1 100644
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/StaticItemLabelProvider.java
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/StaticItemLabelProvider.java
@@ -9,51 +9,25 @@
******************************************************************************/
package org.eclipse.jpt.common.ui.internal.jface;
+import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jpt.common.ui.jface.ItemLabelProvider;
-import org.eclipse.jpt.common.utility.internal.ObjectTools;
-import org.eclipse.swt.graphics.Image;
-/**
- * Item label provider that contains unchanging image and text.
- */
public class StaticItemLabelProvider
- implements ItemLabelProvider
+ extends AbstractStaticItemLabelProvider<ItemLabelProvider.Manager>
{
- protected final Image image;
- protected final String text;
-
/**
* Construct an item label provider that returns the specified text but
* no image.
*/
public StaticItemLabelProvider(String text) {
- this(null, text);
+ super(text);
}
/**
* Construct an item label provider that returns the specified image
* and text.
*/
- public StaticItemLabelProvider(Image image, String text) {
- super();
- this.image = image;
- this.text = text;
- }
-
- public Image getImage() {
- return this.image;
- }
-
- public String getText() {
- return this.text;
- }
-
- public void dispose() {
- // NOP
- }
-
- @Override
- public String toString() {
- return ObjectTools.toString(this, this.text);
+ public StaticItemLabelProvider(ImageDescriptor imageDescriptor, String text, ItemLabelProvider.Manager manager) {
+ super(imageDescriptor, text, manager);
}
}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/StructuredContentProviderAdapter.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/StructuredContentProviderAdapter.java
deleted file mode 100644
index 157413cea6..0000000000
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/StructuredContentProviderAdapter.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * 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.common.ui.internal.jface;
-
-import org.eclipse.jface.viewers.AbstractListViewer;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jpt.common.ui.internal.listeners.SWTListChangeListenerWrapper;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.ObjectTools;
-import org.eclipse.jpt.common.utility.internal.model.value.CollectionListValueModelAdapter;
-import org.eclipse.jpt.common.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.common.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.common.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.common.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-
-/**
- * This adapter can be used to keep an AbstractListViewer
- * (e.g. a ListViewer or ComboViewer) in synch with a ListValueModel
- * (or a CollectionValueModel).
- */
-public class StructuredContentProviderAdapter
- implements IStructuredContentProvider
-{
- /** The underlying model list. */
- protected ListValueModel listHolder;
-
- /** The list viewer we keep in synch with the model list. */
- protected final AbstractListViewer listViewer;
-
- /** A listener that allows us to forward changes made to the underlying model list. */
- protected final ListChangeListener listChangeListener;
-
-
- // ********** static **********
-
- /**
- * Adapt the specified list viewer to the specified list holder so they
- * stay in synch.
- */
- public static StructuredContentProviderAdapter adapt(AbstractListViewer listViewer, ListValueModel listHolder) {
- // we need only construct the adapter and it will hook up to the list viewer etc.
- return new StructuredContentProviderAdapter(listViewer, listHolder);
- }
-
- /**
- * Adapt the specified list viewer to the specified list holder so they
- * stay in synch.
- */
- public static StructuredContentProviderAdapter adapt(AbstractListViewer listViewer, CollectionValueModel collectionHolder) {
- // we need only construct the adapter and it will hook up to the list viewer etc.
- return new StructuredContentProviderAdapter(listViewer, collectionHolder);
- }
-
-
- // ********** constructors **********
-
- /**
- * Constructor.
- */
- protected StructuredContentProviderAdapter(AbstractListViewer listViewer, ListValueModel listHolder) {
- super();
- this.listChangeListener = this.buildListChangeListener();
- this.listViewer = listViewer;
- this.listViewer.setContentProvider(this);
- // the list viewer will call back to #inputChanged(Viewer, Object, Object)
- this.listViewer.setInput(listHolder);
- }
-
- /**
- * Constructor.
- */
- protected StructuredContentProviderAdapter(AbstractListViewer listViewer, CollectionValueModel collectionHolder) {
- this(listViewer, new CollectionListValueModelAdapter(collectionHolder));
- }
-
-
- // ********** initialization **********
-
- protected ListChangeListener buildListChangeListener() {
- return new SWTListChangeListenerWrapper(this.buildListChangeListener_());
- }
-
- protected ListChangeListener buildListChangeListener_() {
- return new ListChangeListener() {
- public void itemsAdded(ListAddEvent e) {
- StructuredContentProviderAdapter.this.itemsAdded(e);
- }
- public void itemsRemoved(ListRemoveEvent e) {
- StructuredContentProviderAdapter.this.itemsRemoved(e);
- }
- public void itemsReplaced(ListReplaceEvent e) {
- StructuredContentProviderAdapter.this.itemsReplaced(e);
- }
- public void itemsMoved(ListMoveEvent e) {
- StructuredContentProviderAdapter.this.itemsMoved(e);
- }
- public void listCleared(ListClearEvent e) {
- StructuredContentProviderAdapter.this.listCleared();
- }
- public void listChanged(ListChangeEvent e) {
- StructuredContentProviderAdapter.this.listChanged();
- }
- @Override
- public String toString() {
- return "list listener"; //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** IStructuredContentProvider implementation **********
-
- public Object[] getElements(Object inputElement) {
- if (inputElement != this.listHolder) {
- throw new IllegalArgumentException("invalid input element: " + inputElement); //$NON-NLS-1$
- }
- return this.listHolder.toArray();
- }
-
- /**
- * This is called by the list viewer, so don't update the list viewer here.
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- if (viewer != this.listViewer) {
- throw new IllegalArgumentException("invalid viewer: " + viewer); //$NON-NLS-1$
- }
- if (oldInput != this.listHolder) {
- throw new IllegalArgumentException("invalid old input: " + oldInput); //$NON-NLS-1$
- }
- this.modelChanged((ListValueModel) oldInput, (ListValueModel) newInput);
- }
-
- public void dispose() {
- // do nothing - listeners should've already been removed in #inputChanged(Viewer, Object, Object)
- }
-
-
- // ********** internal methods **********
-
- protected void modelChanged(ListValueModel oldModel, ListValueModel newModel) {
- if (oldModel != null) {
- this.listHolder.removeListChangeListener(ListValueModel.LIST_VALUES, this.listChangeListener);
- }
- this.listHolder = newModel;
- if (newModel != null) {
- this.listHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.listChangeListener);
- }
- }
-
-
- // ********** public API **********
-
- /**
- * Return the underlying list model.
- */
- public ListValueModel model() {
- return this.listHolder;
- }
-
- /**
- * Set the underlying list model.
- */
- public void setModel(ListValueModel listHolder) {
- // the list viewer will call back to #inputChanged(Viewer, Object, Object)
- this.listViewer.setInput(listHolder);
- }
-
- /**
- * Set the underlying collection model.
- */
- public void setModel(CollectionValueModel collectionHolder) {
- this.setModel(new CollectionListValueModelAdapter(collectionHolder));
- }
-
-
- // ********** list change support **********
-
- /**
- * Items were added to the underlying model list.
- * Synchronize the list viewer.
- */
- protected void itemsAdded(ListAddEvent e) {
- int i = e.getIndex();
- for (Object item : e.getItems()) {
- this.listViewer.insert(item, i++);
- }
- }
-
- /**
- * Items were removed from the underlying model list.
- * Synchronize the list viewer.
- */
- protected void itemsRemoved(ListRemoveEvent e) {
- this.listViewer.remove(ArrayTools.array(e.getItems(), e.getItemsSize()));
- }
-
- /**
- * Items were replaced in the underlying model list.
- * Synchronize the list viewer.
- */
- protected void itemsReplaced(ListReplaceEvent e) {
- this.listViewer.remove(ArrayTools.array(e.getOldItems(), e.getItemsSize()));
- int i = e.getIndex();
- for (Object item : e.getNewItems()) {
- this.listViewer.insert(item, i++);
- }
- }
-
- /**
- * Items were moved in the underlying model list.
- * Synchronize the list viewer.
- */
- protected void itemsMoved(ListMoveEvent e) {
- int len = e.getLength();
- Object[] items = new Object[len];
- int offset = e.getSourceIndex();
- for (int i = 0; i < len; i++) {
- items[i] = this.listHolder.get(offset + i);
- }
- this.listViewer.remove(items);
-
- offset = e.getTargetIndex();
- for (int i = 0; i < len; i++) {
- this.listViewer.insert(items[i], offset + i);
- }
- }
-
- /**
- * The underlying model list was cleared.
- * Synchronize the list viewer.
- */
- protected void listCleared() {
- this.listViewer.refresh();
- }
-
- /**
- * The underlying model list has changed "dramatically".
- * Synchronize the list viewer.
- */
- protected void listChanged() {
- this.listViewer.refresh();
- }
-
-
- // ********** Object overrides **********
-
- @Override
- public String toString() {
- return ObjectTools.toString(this, this.listHolder);
- }
-
-}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/TableItemModelAdapter.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/TableItemModelAdapter.java
index 6c1d3aade7..48bc60ca30 100644
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/TableItemModelAdapter.java
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/swt/TableItemModelAdapter.java
@@ -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
******************************************************************************/
@@ -13,9 +13,10 @@ import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jpt.common.ui.internal.listeners.SWTPropertyChangeListenerWrapper;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
+import org.eclipse.jpt.common.utility.model.listener.PropertyChangeAdapter;
import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
+import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
@@ -50,7 +51,7 @@ public class TableItemModelAdapter {
* The value models used to listen to each property that are display by the
* table item.
*/
- private ModifiablePropertyValueModel<?>[] valueHolders;
+ private ModifiablePropertyValueModel<?>[] valueModels;
/**
* The list of <code>PropertyChangeListener</code>s used to be notified when
@@ -61,7 +62,8 @@ public class TableItemModelAdapter {
/**
* The label used to format the objects into a string representation.
*/
- private ITableLabelProvider labelProvider;
+ private final ITableLabelProvider labelProvider;
+
// ********** static methods **********
@@ -82,7 +84,7 @@ public class TableItemModelAdapter {
@SuppressWarnings("unchecked")
protected TableItemModelAdapter(TableItem tableItem, ColumnAdapter<?> columnAdapter, ITableLabelProvider labelProvider) {
super();
- if (tableItem == null || columnAdapter == null || labelProvider == null) {
+ if ((tableItem == null) || (columnAdapter == null) || (labelProvider == null)) {
throw new NullPointerException();
}
this.tableItem = tableItem;
@@ -92,12 +94,12 @@ public class TableItemModelAdapter {
this.tableItemDisposeListener = this.buildTableItemDisposeListener();
this.tableItem.addDisposeListener(this.tableItemDisposeListener);
- this.valueHolders = this.columnAdapter.cellModels(tableItem.getData());
+ this.valueModels = this.columnAdapter.cellModels(tableItem.getData());
this.propertyChangeListeners = this.buildPropertyChangeListeners();
for (int index = this.columnAdapter.columnCount(); --index >= 0; ) {
- tableItemChanged(index, tableItem.getData(), false);
- valueHolders[index].addPropertyChangeListener(PropertyValueModel.VALUE, propertyChangeListeners[index]);
+ this.tableItemChanged(index, tableItem.getData(), false);
+ this.valueModels[index].addPropertyChangeListener(PropertyValueModel.VALUE, this.propertyChangeListeners[index]);
}
}
@@ -105,9 +107,9 @@ public class TableItemModelAdapter {
// ********** initialization **********
private PropertyChangeListener[] buildPropertyChangeListeners() {
- PropertyChangeListener[] listeners = new PropertyChangeListener[columnAdapter.columnCount()];
- for (int index = listeners.length; --index >= 0; ) {
- listeners[index] = buildPropertyChangeListener(index);
+ PropertyChangeListener[] listeners = new PropertyChangeListener[this.columnAdapter.columnCount()];
+ for (int index = listeners.length; index-- > 0; ) {
+ listeners[index] = this.buildPropertyChangeListener(index);
}
return listeners;
}
@@ -124,23 +126,31 @@ public class TableItemModelAdapter {
}
protected DisposeListener buildTableItemDisposeListener() {
- return new DisposeListener() {
- public void widgetDisposed(DisposeEvent event) {
- TableItemModelAdapter.this.tableItemDisposed(event);
- }
- @Override
- public String toString() {
- return "TableItem dispose listener";
- }
- };
+ return new TableItemDisposeListener();
+ }
+
+ protected class TableItemDisposeListener
+ extends DisposeAdapter
+ {
+ @Override
+ public void widgetDisposed(DisposeEvent event) {
+ TableItemModelAdapter.this.tableItemDisposed();
+ }
+
}
// ********** behavior **********
- protected void tableItemChanged(int index, Object subject, boolean revalidate) {
+ protected void cellModelChanged(int index) {
+ if ( ! this.tableItem.isDisposed()) {
+ Table table = this.tableItem.getParent();
+ this.tableItemChanged(index, this.tableItem.getData(), table.getColumnCount() == 0);
+ }
+ }
- if (!this.tableItem.isDisposed()) {
+ protected void tableItemChanged(int index, Object subject, boolean revalidate) {
+ if ( ! this.tableItem.isDisposed()) {
this.updateTableItemText(index, subject);
this.updateTableItemImage(index, subject);
@@ -172,13 +182,13 @@ public class TableItemModelAdapter {
// ********** dispose **********
- protected void tableItemDisposed(DisposeEvent event) {
+ protected void tableItemDisposed() {
// the button is not yet "disposed" when we receive this event
// so we can still remove our listeners
this.tableItem.removeDisposeListener(this.tableItemDisposeListener);
- for (int index = valueHolders.length; --index >= 0; ) {
- valueHolders[index].removePropertyChangeListener(PropertyValueModel.VALUE, propertyChangeListeners[index]);
+ for (int index = this.valueModels.length; index-- > 0; ) {
+ this.valueModels[index].removePropertyChangeListener(PropertyValueModel.VALUE, this.propertyChangeListeners[index]);
}
}
@@ -190,20 +200,19 @@ public class TableItemModelAdapter {
return ObjectTools.toString(this);
}
- private class TableItemPropertyChangeListener implements PropertyChangeListener {
+ protected class TableItemPropertyChangeListener
+ extends PropertyChangeAdapter
+ {
+ private final int index;
- private final int index;
-
- TableItemPropertyChangeListener(int index) {
- super();
- this.index = index;
- }
+ protected TableItemPropertyChangeListener(int index) {
+ super();
+ this.index = index;
+ }
- public void propertyChanged(PropertyChangeEvent event) {
- if (!tableItem.isDisposed()) {
- Table table = tableItem.getParent();
- tableItemChanged(index, tableItem.getData(), table.getColumnCount() == 0);
- }
- }
- }
-} \ No newline at end of file
+ @Override
+ public void propertyChanged(PropertyChangeEvent event) {
+ TableItemModelAdapter.this.cellModelChanged(this.index);
+ }
+ }
+}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/AddRemoveListPane.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/AddRemoveListPane.java
index 991a30501d..2182f293e8 100644
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/AddRemoveListPane.java
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/AddRemoveListPane.java
@@ -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
******************************************************************************/
@@ -435,7 +435,7 @@ public class AddRemoveListPane<T extends Model, E extends Object> extends AddRem
* @param table The main widget of this pane
*/
protected void initializeTable(Table table) {
- table.setData("column.width", new Integer(0));
+ table.setData("column.width", Integer.valueOf(0));
table.setHeaderVisible(false);
table.setLinesVisible(false);
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/AddRemovePane.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/AddRemovePane.java
index a46cf7e448..53f2f53554 100644
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/AddRemovePane.java
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/AddRemovePane.java
@@ -47,7 +47,6 @@ public abstract class AddRemovePane<T extends Model, E extends Object> extends P
{
private Adapter<E> adapter;
private Button addButton;
- private IBaseLabelProvider labelProvider;
private ListValueModel<?> listModel;
private Button optionalButton;
private Button removeButton;
@@ -409,10 +408,6 @@ public abstract class AddRemovePane<T extends Model, E extends Object> extends P
this.adapter.optionOnSelection(this.selectedItemsModel);
}
- protected IBaseLabelProvider getLabelProvider() {
- return this.labelProvider;
- }
-
protected final ListValueModel<?> getListModel() {
return this.listModel;
}
@@ -447,7 +442,6 @@ public abstract class AddRemovePane<T extends Model, E extends Object> extends P
IBaseLabelProvider labelProvider)
{
this.listModel = listModel;
- this.labelProvider = labelProvider;
this.adapter = (adapter == null) ? buildAdapter() : adapter;
this.selectedItemsModel = selectedItemsModel;
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/DefaultWidgetFactory.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/DefaultWidgetFactory.java
index 9dfcf3db9d..6a75dc1951 100644
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/DefaultWidgetFactory.java
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/DefaultWidgetFactory.java
@@ -25,190 +25,124 @@ import org.eclipse.ui.forms.widgets.Hyperlink;
import org.eclipse.ui.forms.widgets.Section;
/**
- * This <code>WidgetFactory</code> simply creates plain SWT widgets.
- *
- * @version 2.0
- * @since 2.0
+ * This widget factory simply creates plain SWT widgets.
+ *
+ * @see FormWidgetFactory
*/
-public class DefaultWidgetFactory implements WidgetFactory {
+public final class DefaultWidgetFactory
+ implements WidgetFactory
+{
+ public static WidgetFactory instance() {
+ return INSTANCE;
+ }
- /**
- * The singleton instance of this <code>IWidgetFactory</code>
- */
private static final WidgetFactory INSTANCE = new DefaultWidgetFactory();
/**
- * Creates a new <code>DefaultWidgetFactory</code>.
+ * Ensure singleton.
*/
private DefaultWidgetFactory() {
super();
}
- /**
- * Returns the singleton instance of this <code>IWidgetFactory</code>.
- *
- * @return The singleton instance of this <code>IWidgetFactory</code>
- */
- public static WidgetFactory instance() {
- return INSTANCE;
- }
-
- /**
- * {@inheritDoc}
- */
public Button createButton(Composite parent, String text) {
- return this.createButton(parent, text, SWT.NULL);
- }
-
- /**
- * Creates a new button.
- *
- * @param parent The parent container
- * @param text The button's text
- * @param style The style to apply to the button, which determines its type:
- * toggle, push, check box, radio
- * @return The newly created <code>Button</code>
- */
- private Button createButton(Composite parent, String text, int style) {
- Button button = new Button(parent, style);
- button.setText(text);
- return button;
+ return this.createButton(parent, text, SWT.NONE);
}
- /**
- * {@inheritDoc}
- */
public Button createCheckBox(Composite parent, String text) {
return this.createButton(parent, text, SWT.CHECK);
}
- /**
- * {@inheritDoc}
- */
public Combo createCombo(Composite parent) {
- return new Combo(parent, SWT.BORDER | SWT.READ_ONLY);
+ return this.createCombo(parent, SWT.READ_ONLY);
}
- /**
- * {@inheritDoc}
- */
public Composite createComposite(Composite parent) {
- return new Composite(parent, SWT.NULL);
+ return new Composite(parent, SWT.NONE);
}
- /**
- * {@inheritDoc}
- */
public DateTime createDateTime(Composite parent, int style) {
return new DateTime(parent, style);
}
- /**
- * {@inheritDoc}
- */
public Combo createEditableCombo(Composite parent) {
- return new Combo(parent, SWT.BORDER);
+ return this.createCombo(parent, SWT.NONE);
}
- /**
- * {@inheritDoc}
- */
public Group createGroup(Composite parent, String title) {
- Group group = new Group(parent, SWT.NULL);
+ Group group = new Group(parent, SWT.NONE);
group.setText(title);
return group;
}
- /**
- * {@inheritDoc}
- */
public Hyperlink createHyperlink(Composite parent, String text) {
- Hyperlink hyperlink = new Hyperlink(parent, SWT.NULL);
+ Hyperlink hyperlink = new Hyperlink(parent, SWT.NONE);
hyperlink.setText(text);
return hyperlink;
}
- /**
- * {@inheritDoc}
- */
public Label createLabel(Composite parent, String labelText) {
Label label = new Label(parent, SWT.WRAP);
label.setText(labelText);
return label;
}
- /**
- * {@inheritDoc}
- */
public List createList(Composite parent, int style) {
return new List(parent, SWT.BORDER | style);
}
- /**
- * {@inheritDoc}
- */
public Text createMultiLineText(Composite parent) {
- return new Text(parent, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL);
+ return this.createText(parent, SWT.MULTI | SWT.V_SCROLL);
}
- /**
- * {@inheritDoc}
- */
public Text createPasswordText(Composite parent) {
- return new Text(parent, SWT.BORDER | SWT.PASSWORD);
+ return this.createText(parent, SWT.PASSWORD);
}
- /**
- * {@inheritDoc}
- */
public Button createPushButton(Composite parent, String text) {
return this.createButton(parent, text, SWT.PUSH);
}
- /**
- * {@inheritDoc}
- */
public Button createRadioButton(Composite parent, String text) {
return this.createButton(parent, text, SWT.RADIO);
}
- /**
- * {@inheritDoc}
- */
public Section createSection(Composite parent, int style) {
return new Section(parent, style);
}
- /**
- * {@inheritDoc}
- */
public Spinner createSpinner(Composite parent) {
- return new Spinner(parent, SWT.NULL);
+ return new Spinner(parent, SWT.NONE);
}
- /**
- * {@inheritDoc}
- */
public Table createTable(Composite parent, int style) {
return new Table(parent, SWT.BORDER | style);
}
- /**
- * {@inheritDoc}
- */
public Text createText(Composite parent) {
- return new Text(parent, SWT.BORDER);
+ return this.createText(parent, SWT.NONE);
}
- /**
- * {@inheritDoc}
- */
public Button createTriStateCheckBox(Composite parent, String text) {
TriStateCheckBox checkBox = new TriStateCheckBox(parent, text, this);
return checkBox.getCheckBox();
}
+ private Button createButton(Composite parent, String text, int style) {
+ Button button = new Button(parent, style);
+ button.setText(text);
+ return button;
+ }
+
+ private Combo createCombo(Composite parent, int style) {
+ return new Combo(parent, style | SWT.BORDER);
+ }
+
+ private Text createText(Composite parent, int style) {
+ return new Text(parent, style | SWT.BORDER);
+ }
+
public void dispose() {
- //nothing to dispose
+ // NOP
}
-} \ No newline at end of file
+}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/Dialog.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/Dialog.java
index cef31c6d9e..9ac6812157 100644
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/Dialog.java
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/Dialog.java
@@ -10,9 +10,12 @@
package org.eclipse.jpt.common.ui.internal.widgets;
import org.eclipse.jface.dialogs.TitleAreaDialog;
+import org.eclipse.jface.resource.LocalResourceManager;
+import org.eclipse.jface.resource.ResourceManager;
+import org.eclipse.jpt.common.utility.internal.StringTools;
import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
+import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.common.utility.node.Node;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
@@ -33,14 +36,23 @@ import org.eclipse.ui.help.IWorkbenchHelpSystem;
*
* @see Node
* @see DialogPane
- *
- * @version 3.3
- * @since 2.0
*/
-@SuppressWarnings("nls")
-public abstract class Dialog<T extends Node> extends TitleAreaDialog
+public abstract class Dialog<T extends Node>
+ extends TitleAreaDialog
{
/**
+ * Resource manager used to allocate images, colors, and fonts.
+ * Passed to composite managers.
+ */
+ protected final ResourceManager resourceManager;
+
+ /**
+ * Cache the title until the dialog is created and the dialog's shell
+ * needs to be configured.
+ */
+ private final String title;
+
+ /**
* The main content pane of this dialog.
*/
private DialogPane<?> pane;
@@ -50,29 +62,23 @@ public abstract class Dialog<T extends Node> extends TitleAreaDialog
*/
private ModifiablePropertyValueModel<T> subjectHolder;
- /**
- * Caches the title text until the dialog is created and the dialog's shell
- * needs to be configured.
- */
- private String title;
/**
- * Creates a new <code>Dialog</code>.
- *
- * @param parent The parent shell
+ * Construct a dialog with the specified resource manager and no title.
*/
- protected Dialog(Shell parent) {
- this(parent, "");
+ protected Dialog(Shell parentShell, ResourceManager resourceManager) {
+ this(parentShell, resourceManager, StringTools.EMPTY_STRING);
}
/**
- * Creates a new <code>Dialog</code>.
- *
- * @param parent The parent shell
- * @param title The dialog's title
+ * Construct a dialog with the specified resource manager and title.
*/
- protected Dialog(Shell parent, String title) {
- super(parent);
+ protected Dialog(Shell parentShell, ResourceManager resourceManager, String title) {
+ super(parentShell);
+ if ((resourceManager == null) || (title == null)) {
+ throw new NullPointerException();
+ }
+ this.resourceManager = new LocalResourceManager(resourceManager);
this.title = title;
initialize();
}
@@ -90,7 +96,7 @@ public abstract class Dialog<T extends Node> extends TitleAreaDialog
/**
* Creates the state object (model object) that will be used to keep track
* of the information entered in this dialog. The state object will be stored
- * in the subject holder and can be retrieved using {@link #subject()}.
+ * in the subject holder and can be retrieved using {@link #getSubject()}.
*
* @return A new state object
*/
@@ -108,34 +114,23 @@ public abstract class Dialog<T extends Node> extends TitleAreaDialog
return Node.NULL_VALIDATOR;
}
- /**
- * {@inheritDoc}
- */
@Override
protected void configureShell(Shell shell) {
super.configureShell(shell);
- shell.setText(getTitle());
+ shell.setText(this.title);
}
- /**
- * {@inheritDoc}
- */
@Override
public void create() {
super.create();
- installSubject();
+ this.installSubject();
}
- /*
- * (non-Javadoc)
- */
@Override
protected Control createContents(Composite parent) {
- if (hasTitleArea()) {
- return super.createContents(parent);
- }
-
- return createDefaultContent(parent);
+ return this.hasTitleArea() ?
+ super.createContents(parent) :
+ this.createDefaultContent(parent);
}
/**
@@ -147,7 +142,6 @@ public abstract class Dialog<T extends Node> extends TitleAreaDialog
* @return The
*/
private Composite createDefaultContent(Composite parent) {
-
Composite composite = new Composite(parent, SWT.NULL);
GridLayout layout = new GridLayout(1, false);
@@ -159,15 +153,12 @@ public abstract class Dialog<T extends Node> extends TitleAreaDialog
applyDialogFont(composite);
initializeDialogUnits(composite);
- dialogArea = createDialogArea(composite);
- buttonBar = createButtonBar(composite);
+ this.dialogArea = createDialogArea(composite);
+ this.buttonBar = createButtonBar(composite);
return composite;
}
- /*
- * (non-Javadoc)
- */
@Override
protected Composite createDialogArea(Composite parent) {
@@ -189,7 +180,7 @@ public abstract class Dialog<T extends Node> extends TitleAreaDialog
container.setLayoutData(gridData);
// Initialize the content pane
- pane = buildLayout(container);
+ this.pane = buildLayout(container);
// Initialize the UI part, which requires the widgets being created
initializeUI();
@@ -233,6 +224,7 @@ public abstract class Dialog<T extends Node> extends TitleAreaDialog
* have been created.
*/
protected void initializeUI() {
+ // NOP
}
/**
@@ -248,7 +240,7 @@ public abstract class Dialog<T extends Node> extends TitleAreaDialog
subject.setValidator(buildValidator());
}
- subjectHolder.setValue(subject);
+ this.subjectHolder.setValue(subject);
}
/**
@@ -257,7 +249,7 @@ public abstract class Dialog<T extends Node> extends TitleAreaDialog
* @return The pane showing the custom widgets
*/
protected DialogPane<?> getPane() {
- return pane;
+ return this.pane;
}
/**
@@ -267,7 +259,7 @@ public abstract class Dialog<T extends Node> extends TitleAreaDialog
* used
*/
public T getSubject() {
- return subjectHolder.getValue();
+ return this.subjectHolder.getValue();
}
/**
@@ -277,18 +269,7 @@ public abstract class Dialog<T extends Node> extends TitleAreaDialog
* an instance of <code>DialogPane</code>
*/
protected final PropertyValueModel<T> getSubjectHolder() {
- return subjectHolder;
- }
-
- /**
- * Retrieves the dialog's title. The title passed to the constructor will be
- * returned by default but if it wasn't specified, this method can be used
- * to return it.
- *
- * @return Either the title passed to the constructor or a different title
- */
- protected String getTitle() {
- return title;
+ return this.subjectHolder;
}
/**
@@ -310,4 +291,10 @@ public abstract class Dialog<T extends Node> extends TitleAreaDialog
public final boolean wasConfirmed() {
return getReturnCode() == OK;
}
-} \ No newline at end of file
+
+ @Override
+ public boolean close() {
+ this.resourceManager.dispose();
+ return super.close();
+ }
+}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/DialogPane.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/DialogPane.java
index a3c536222d..cf46db7006 100644
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/DialogPane.java
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/DialogPane.java
@@ -9,61 +9,52 @@
******************************************************************************/
package org.eclipse.jpt.common.ui.internal.widgets;
+import org.eclipse.jface.resource.ResourceManager;
import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.common.utility.node.Node;
import org.eclipse.swt.widgets.Composite;
/**
- * The abstract pane to use when the pane is shown in an <code>Dialog</code>.
- *
- * @see Dialog
- *
- * @version 2.0
- * @since 2.0
+ * The abstract pane to use when the pane is shown in a {@link Dialog}.
*/
-public abstract class DialogPane<T extends Node> extends Pane<T> {
-
+public abstract class DialogPane<T extends Node>
+ extends Pane<T>
+{
/**
- * Creates a new <code>DialogPane</code>.
- *
- * @param parentPane The parent controller of this one
- * @param parent The parent container
- *
- * @category Constructor
+ * Construct a dialog pane that uses the specified parent pane's:<ul>
+ * <li>subject model
+ * <li><em>enabled</em> model
+ * </ul>
*/
- protected DialogPane(DialogPane<? extends T> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
+ protected DialogPane(
+ DialogPane<? extends T> parent,
+ Composite parentComposite) {
+ super(parent, parentComposite);
}
/**
- * Creates a new <code>DialogPane</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- *
- * @category Constructor
+ * Construct a dialog pane that uses the specified parent pane's:<ul>
+ * <li><em>enabled</em> model
+ * </ul>
*/
- protected DialogPane(DialogPane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
+ protected DialogPane(
+ DialogPane<?> parent,
+ PropertyValueModel<? extends T> subjectModel,
+ Composite parentComposite) {
+ super(parent, subjectModel, parentComposite);
}
/**
- * Creates a new <code>DialogPane</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- *
- * @category Constructor
+ * Construct a <em>root</em> dialog pane with the specified subject model
+ * and resource manager.
+ * The pane will use the default (non-form) widget factory.
+ * The pane will be <em>disabled</em> whenever the subject is
+ * <code>null</code>.
*/
- protected DialogPane(PropertyValueModel<? extends T> subjectHolder,
- Composite parent) {
-
- super(subjectHolder, parent, DefaultWidgetFactory.instance());
+ protected DialogPane(
+ PropertyValueModel<? extends T> subjectModel,
+ Composite parentComposite,
+ ResourceManager resourceManager) {
+ super(subjectModel, parentComposite, DefaultWidgetFactory.instance(), resourceManager);
}
-} \ No newline at end of file
+}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/EnumComboViewer.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/EnumComboViewer.java
index 5eecb224b5..ca4224d732 100644
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/EnumComboViewer.java
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/EnumComboViewer.java
@@ -17,7 +17,6 @@ import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jpt.common.ui.WidgetFactory;
import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
import org.eclipse.jpt.common.utility.model.Model;
import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
@@ -96,21 +95,6 @@ abstract class EnumComboViewer<T extends Model, V> extends Pane<T>
super(parentPane, subjectHolder, enabledModel, parent);
}
- /**
- * Creates a new <code>EnumComboViewer</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various widgets
- */
- EnumComboViewer(PropertyValueModel<? extends T> subjectHolder,
- PropertyValueModel<Boolean> enabledModel,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, enabledModel, parent, widgetFactory);
- }
-
@Override
protected boolean addsComposite() {
return false;
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/FormWidgetFactory.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/FormWidgetFactory.java
index ab671d1d7d..e66122bea3 100644
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/FormWidgetFactory.java
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/FormWidgetFactory.java
@@ -9,7 +9,6 @@
******************************************************************************/
package org.eclipse.jpt.common.ui.internal.widgets;
-import org.eclipse.core.runtime.Assert;
import org.eclipse.jpt.common.ui.WidgetFactory;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
@@ -30,251 +29,172 @@ import org.eclipse.ui.forms.widgets.ScrolledForm;
import org.eclipse.ui.forms.widgets.Section;
/**
- * This <code>WidgetFactory</code> is responsible to create the widgets
- * using the <code>FormToolkit</code> in order use the form style (flat-style)
- * look and feel. Clients that create a FormWidgetFactory must call {@link #dispose()}
+ * This widget factory delegates its behavior to a {@link FormToolkit}.
+ * in order use the <em>form</em> style (i.e. the flat style)
+ * look and feel. Clients must call {@link #dispose()}
* when they are finished using the widget factory.
-
*
- * @see FormToolkit
- * @version 3.3
- * @since 2.0
+ * @see DefaultWidgetFactory
*/
-@SuppressWarnings("nls")
-public class FormWidgetFactory implements WidgetFactory {
+public class FormWidgetFactory
+ implements WidgetFactory
+{
+ private final FormToolkit formToolkit;
- /**
- * The actual factory responsible for creating the new widgets.
- */
- private final FormToolkit widgetFactory;
/**
- * Creates a new <code>FormWidgetFactory</code>.
+ * Construct a widget factory that delegates to the specified
+ * <em>form</em> toolkit.
* <p>
- * Clients that call this method must call {@link #dispose()}
+ * Any client that calls this constructor must call {@link #dispose()} when
+ * it is finished using the resulting widget factory.
*/
- public FormWidgetFactory(FormToolkit widgetFactory) {
+ public FormWidgetFactory(FormToolkit formToolkit) {
super();
-
- Assert.isNotNull(widgetFactory, "The widget factory cannot be null");
- this.widgetFactory = widgetFactory;
+ if (formToolkit == null) {
+ throw new NullPointerException();
+ }
+ this.formToolkit = formToolkit;
}
- /**
- * Wraps the given <code>Composite</code> into a new <code>Composite</code>
- * in order to have the widgets' border painted. Except for <code>CCombo</code>,
- * the top and bottom margins have to be 2 pixel and the left and right
- * margins have to be 1 pixel.
- *
- * @param container The parent of the sub-pane
- * @return A new <code>Composite</code> that has the necessary space to paint
- * the border
- */
- protected Composite createBorderContainer(Composite container) {
- return createBorderContainer(container, 2, 1);
- }
-
- protected Composite createBorderContainer(Composite container, int marginHeight, int marginWidth) {
-
- GridLayout layout = new GridLayout(1, false);
- layout.marginHeight = marginHeight;
- layout.marginWidth = marginWidth;
-
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
-
- container = this.widgetFactory.createComposite(container);
- container.setLayoutData(gridData);
- container.setLayout(layout);
-
- return container;
- }
-
- /**
- * {@inheritDoc}
- */
public Button createButton(Composite parent, String text) {
- return createButton(parent, text, SWT.NULL);
- }
-
- /**
- * Creates a new button.
- *
- * @param parent The parent container
- * @param text The button's text
- * @param style The style to apply to the button, which determines its type:
- * toggle, push, check box, radio
- * @return The newly created <code>Button</code>
- */
- protected Button createButton(Composite parent, String text, int style) {
- return this.widgetFactory.createButton(parent, text, SWT.FLAT | style);
+ return this.createButton(parent, text, SWT.NULL);
}
- /**
- * {@inheritDoc}
- */
public Button createCheckBox(Composite parent, String text) {
- return createButton(parent, text, SWT.CHECK);
+ return this.createButton(parent, text, SWT.CHECK);
}
- /**
- * {@inheritDoc}
- */
public Combo createCombo(Composite parent) {
- return new Combo(parent, SWT.READ_ONLY | SWT.FLAT);
+ return this.createCombo(parent, SWT.READ_ONLY);
}
- /**
- * {@inheritDoc}
- */
public Composite createComposite(Composite parent) {
- return this.widgetFactory.createComposite(parent);
+ return this.formToolkit.createComposite(parent);
}
- /**
- * {@inheritDoc}
- */
+
public DateTime createDateTime(Composite parent, int style) {
- parent = createBorderContainer(parent);
+ parent = this.createBorderContainer(parent);
DateTime dateTime = new DateTime(parent, style | SWT.FLAT);
dateTime.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
- this.widgetFactory.adapt(dateTime, true, false);
+ this.formToolkit.adapt(dateTime, true, false);
return dateTime;
}
-
- /**
- * {@inheritDoc}
- */
public Combo createEditableCombo(Composite parent) {
- Combo combo = new Combo(parent, SWT.FLAT);
- return combo;
+ return this.createCombo(parent, SWT.NONE);
}
- /**
- * {@inheritDoc}
- */
public Group createGroup(Composite parent, String title) {
Group group = new Group(parent, SWT.NULL);
group.setText(title);
return group;
}
- /**
- * {@inheritDoc}
- */
public Hyperlink createHyperlink(Composite parent, String text) {
- return this.widgetFactory.createHyperlink(parent, text, SWT.FLAT);
+ return this.formToolkit.createHyperlink(parent, text, SWT.FLAT);
}
- /**
- * {@inheritDoc}
- */
public Label createLabel(Composite container, String labelText) {
- return this.widgetFactory.createLabel(container, labelText, SWT.WRAP);
+ return this.formToolkit.createLabel(container, labelText, SWT.WRAP);
}
- /**
- * {@inheritDoc}
- */
public List createList(Composite container, int style) {
List list = new List(container, SWT.FLAT | style);
list.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
return list;
}
- /**
- * {@inheritDoc}
- */
public Text createMultiLineText(Composite parent) {
- return createText(parent, SWT.MULTI | SWT.V_SCROLL);
+ return this.createText(parent, SWT.MULTI | SWT.V_SCROLL);
}
- /**
- * {@inheritDoc}
- */
public Text createPasswordText(Composite parent) {
- return createText(parent, SWT.PASSWORD);
+ return this.createText(parent, SWT.PASSWORD);
}
- /**
- * {@inheritDoc}
- */
public Button createPushButton(Composite parent, String text) {
- return createButton(parent, text, SWT.PUSH);
+ return this.createButton(parent, text, SWT.PUSH);
}
- /**
- * {@inheritDoc}
- */
public Button createRadioButton(Composite parent, String text) {
- return createButton(parent, text, SWT.RADIO);
+ return this.createButton(parent, text, SWT.RADIO);
}
- /**
- * {@inheritDoc}
- */
public Section createSection(Composite parent, int style) {
- return this.widgetFactory.createSection(parent, SWT.FLAT | style);
+ return this.formToolkit.createSection(parent, SWT.FLAT | style);
}
public ScrolledForm createScrolledForm(Composite parent) {
- return this.widgetFactory.createScrolledForm(parent);
+ return this.formToolkit.createScrolledForm(parent);
}
- /**
- * {@inheritDoc}
- */
public Spinner createSpinner(Composite parent) {
- parent = createBorderContainer(parent);
+ parent = this.createBorderContainer(parent);
Spinner spinner = new Spinner(parent, SWT.FLAT);
spinner.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
- this.widgetFactory.adapt(spinner, true, false);
+ this.formToolkit.adapt(spinner, true, false);
return spinner;
}
- /**
- * {@inheritDoc}
- */
public Table createTable(Composite parent, int style) {
- Table table = this.widgetFactory.createTable(parent, SWT.BORDER | style);
+ Table table = this.formToolkit.createTable(parent, SWT.BORDER | style);
table.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
return table;
}
- /**
- * {@inheritDoc}
- */
public Text createText(Composite parent) {
- return createText(parent, SWT.NONE);
+ return this.createText(parent, SWT.NONE);
}
- protected Text createText(Composite parent, int style) {
- return this.widgetFactory.createText(parent, null, SWT.BORDER | SWT.FLAT | style);
+ private Text createText(Composite parent, int style) {
+ return this.formToolkit.createText(parent, null, SWT.BORDER | SWT.FLAT | style);
}
- /**
- * {@inheritDoc}
- */
public Button createTriStateCheckBox(Composite parent, String text) {
TriStateCheckBox checkBox = new TriStateCheckBox(parent, text, this);
return checkBox.getCheckBox();
}
/**
- * Returns the actual factory responsible for creating the new widgets.
- *
- * @return The factory creating the widgets with the form style (flat-style)
+ * Wraps the given <code>Composite</code> into a new <code>Composite</code>
+ * in order to have the widgets' border painted. Except for <code>CCombo</code>,
+ * the top and bottom margins have to be 2 pixel and the left and right
+ * margins have to be 1 pixel.
*/
- public FormToolkit getWidgetFactory() {
- return this.widgetFactory;
+ private Composite createBorderContainer(Composite parent) {
+ return this.createBorderContainer(parent, 2, 1);
+ }
+
+ private Composite createBorderContainer(Composite parent, int marginHeight, int marginWidth) {
+ GridLayout layout = new GridLayout(1, false);
+ layout.marginHeight = marginHeight;
+ layout.marginWidth = marginWidth;
+
+ GridData gridData = new GridData();
+ gridData.horizontalAlignment = GridData.FILL;
+ gridData.grabExcessHorizontalSpace = true;
+
+ Composite composite = this.formToolkit.createComposite(parent);
+ composite.setLayoutData(gridData);
+ composite.setLayout(layout);
+
+ return composite;
+ }
+
+ private Button createButton(Composite parent, String text, int style) {
+ return this.formToolkit.createButton(parent, text, SWT.FLAT | style);
+ }
+
+ private Combo createCombo(Composite parent, int style) {
+ return new Combo(parent, style | SWT.FLAT);
}
public void dispose() {
- this.widgetFactory.dispose();
+ this.formToolkit.dispose();
}
-} \ No newline at end of file
+}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/NewNameDialog.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/NewNameDialog.java
index cd8ede0a9b..b5bfbbfde5 100644
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/NewNameDialog.java
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/NewNameDialog.java
@@ -10,20 +10,17 @@
package org.eclipse.jpt.common.ui.internal.widgets;
import java.util.Collection;
+import org.eclipse.jface.resource.ResourceManager;
import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
+import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
-/**
- * The dialog used to requests a name from the user.
- *
- * @version 2.0
- * @since 2.0
- */
-public class NewNameDialog extends ValidatingDialog<NewNameStateObject>
+public class NewNameDialog
+ extends ValidatingDialog<NewNameStateObject>
{
private String description;
private Image descriptionImage;
@@ -32,29 +29,18 @@ public class NewNameDialog extends ValidatingDialog<NewNameStateObject>
private String name;
private Collection<String> names;
- /**
- * Creates a new <code>NewNameDialog</code>.
- *
- * @param parentShell
- * @param dialogTitle
- * @param descriptionTitle
- * @param descriptionImage
- * @param description
- * @param labelText
- * @param name
- * @param names
- */
- NewNameDialog(Shell parentShell,
- String dialogTitle,
- String descriptionTitle,
- Image descriptionImage,
- String description,
- String labelText,
- String name,
- Collection<String> names)
- {
- super(parentShell, dialogTitle);
+ NewNameDialog(
+ Shell parentShell,
+ String dialogTitle,
+ String descriptionTitle,
+ Image descriptionImage,
+ String description,
+ String labelText,
+ String name,
+ Collection<String> names,
+ ResourceManager resourceManager) {
+ super(parentShell, resourceManager, dialogTitle);
this.name = name;
this.names = names;
this.labelText = labelText;
@@ -63,102 +49,93 @@ public class NewNameDialog extends ValidatingDialog<NewNameStateObject>
this.descriptionTitle = descriptionTitle;
}
- /*
- * (non-Javadoc)
- */
@Override
protected DialogPane<NewNameStateObject> buildLayout(Composite container) {
- return new NewNameDialogPane(container);
+ return new NewNameDialogPane(this.labelText, this.getSubjectHolder(), container, this.resourceManager);
}
- /*
- * (non-Javadoc)
- */
@Override
protected NewNameStateObject buildStateObject() {
- return new NewNameStateObject(name, names);
+ return new NewNameStateObject(this.name, this.names);
}
- /*
- * (non-Javadoc)
- */
@Override
public void create() {
super.create();
+ this.getPane().selectAll();
+ this.getButton(OK).setEnabled(false);
+ }
- NewNameDialogPane pane = (NewNameDialogPane) getPane();
- pane.selectAll();
-
- getButton(OK).setEnabled(false);
+ @Override
+ protected NewNameDialogPane getPane() {
+ return (NewNameDialogPane) super.getPane();
}
- /*
- * (non-Javadoc)
- */
@Override
protected String getDescription() {
- return description;
+ return this.description;
}
- /*
- * (non-Javadoc)
- */
@Override
protected Image getDescriptionImage() {
- return descriptionImage;
+ return this.descriptionImage;
}
- /* (non-Javadoc)
- */
@Override
protected String getDescriptionTitle() {
- return descriptionTitle;
+ return this.descriptionTitle;
}
/**
- * Returns the text field's input, which is the new name the user entered.
- *
- * @return The name the user entered
+ * Return the text field's input, which is the new name the user entered.
*/
public String getName() {
- return getSubject().getName();
+ return this.getSubject().getName();
}
- private class NewNameDialogPane extends DialogPane<NewNameStateObject> {
+ static class NewNameDialogPane
+ extends DialogPane<NewNameStateObject>
+ {
+ private final String labelText;
private Text text;
- NewNameDialogPane(Composite parent) {
- super(NewNameDialog.this.getSubjectHolder(), parent);
+ NewNameDialogPane(
+ String labelText,
+ PropertyValueModel<NewNameStateObject> subjectModel,
+ Composite parentComposite,
+ ResourceManager resourceManager) {
+ super(subjectModel, parentComposite, resourceManager);
+ this.labelText = labelText;
+ }
+
+ @Override
+ protected Composite addComposite(Composite container) {
+ return this.addSubPane(container, 2, 0, 0, 0, 0);
+ }
+
+ @Override
+ protected void initializeLayout(Composite container) {
+ this.addLabel(container, this.labelText);
+ this.text = this.addText(container, this.buildNameModel());
}
- private ModifiablePropertyValueModel<String> buildNameHolder() {
+ private ModifiablePropertyValueModel<String> buildNameModel() {
return new PropertyAspectAdapter<NewNameStateObject, String>(getSubjectHolder(), NewNameStateObject.NAME_PROPERTY) {
@Override
protected String buildValue_() {
- return subject.getName();
+ return this.subject.getName();
}
@Override
protected void setValue_(String value) {
- subject.setName(value);
+ this.subject.setName(value);
}
};
}
- @Override
- protected Composite addComposite(Composite container) {
- return this.addSubPane(container, 2, 0, 0, 0, 0);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.addLabel(container, labelText);
- this.addText(container, buildNameHolder());
- }
-
void selectAll() {
- text.selectAll();
+ this.text.selectAll();
}
}
}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/NewNameDialogBuilder.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/NewNameDialogBuilder.java
index 51f87a0b8b..f06df8851d 100644
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/NewNameDialogBuilder.java
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/NewNameDialogBuilder.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2012 Oracle. All rights reserved.
* 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.
@@ -12,7 +12,7 @@ package org.eclipse.jpt.common.ui.internal.widgets;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
-import org.eclipse.core.runtime.Assert;
+import org.eclipse.jface.resource.ResourceManager;
import org.eclipse.jpt.common.utility.internal.collection.CollectionTools;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Shell;
@@ -20,13 +20,7 @@ import org.eclipse.swt.widgets.Shell;
/**
* This builder is responsible to create a fully initialized
* <code>NewNameDialog</code> once all the properties have been set.
- *
- * @see NewNameDialog
- *
- * @version 2.0
- * @since 2.0
*/
-@SuppressWarnings("nls")
public final class NewNameDialogBuilder {
/**
@@ -64,7 +58,7 @@ public final class NewNameDialogBuilder {
* The collection of names that can't be used or an empty collection if none
* are available.
*/
- private Collection<String> names;
+ private Collection<String> names = Collections.emptyList();
/**
* The parent shell of the new name dialog.
@@ -72,13 +66,21 @@ public final class NewNameDialogBuilder {
private Shell parentShell;
/**
+ * The new name dialog's resource manager;
+ */
+ private ResourceManager resourceManager;
+
+ /**
* Creates a new <code>NewNameDialogBuilder</code>.
*
* @param parentShell The parent shell of the new name dialog
*/
public NewNameDialogBuilder(Shell parentShell) {
super();
- initialize(parentShell);
+ if (parentShell == null) {
+ throw new NullPointerException();
+ }
+ this.parentShell = parentShell;
}
/**
@@ -88,31 +90,19 @@ public final class NewNameDialogBuilder {
*/
public NewNameDialog buildDialog() {
return new NewNameDialog(
- parentShell,
- dialogTitle,
- descriptionTitle,
- descriptionImage,
- description,
- labelText,
- name,
- names
+ this.parentShell,
+ this.dialogTitle,
+ this.descriptionTitle,
+ this.descriptionImage,
+ this.description,
+ this.labelText,
+ this.name,
+ this.names,
+ this.resourceManager
);
}
/**
- * Initializes this builder.
- *
- * @param parentShell The parent shell of the new name dialog
- */
- protected void initialize(Shell parentShell) {
-
- Assert.isNotNull(parentShell, "The parent shell cannot be null");
-
- this.parentShell = parentShell;
- this.names = Collections.emptyList();
- }
-
- /**
* Sets the description to be shown in the description area under the title.
*
* @param description The message to show in the description area
@@ -176,4 +166,8 @@ public final class NewNameDialogBuilder {
public void setName(String name) {
this.name = name;
}
+
+ public void setResourceManager(ResourceManager resourceManager) {
+ this.resourceManager = resourceManager;
+ }
}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/NewNameStateObject.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/NewNameStateObject.java
index 1c2dbd693e..3eaa5477dd 100644
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/NewNameStateObject.java
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/NewNameStateObject.java
@@ -21,11 +21,6 @@ import org.eclipse.jpt.common.utility.node.Problem;
/**
* This is the state object used by the <code>NewNameDialog</code>, which stores
* the current name and validates it when it is modified.
- *
- * @see NewNameDialog
- *
- * @version 2.0
- * @since 2.0
*/
@SuppressWarnings("nls")
final class NewNameStateObject extends AbstractNode
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/Pane.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/Pane.java
index 12be6ef798..b9fd86db3e 100644
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/Pane.java
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/Pane.java
@@ -11,9 +11,10 @@ package org.eclipse.jpt.common.ui.internal.widgets;
import java.util.ArrayList;
import java.util.Collection;
-import org.eclipse.core.runtime.Assert;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
+import org.eclipse.jface.resource.LocalResourceManager;
+import org.eclipse.jface.resource.ResourceManager;
import org.eclipse.jface.viewers.ComboViewer;
import org.eclipse.jface.viewers.IBaseLabelProvider;
import org.eclipse.jpt.common.ui.WidgetFactory;
@@ -21,6 +22,7 @@ import org.eclipse.jpt.common.ui.internal.listeners.SWTPropertyChangeListenerWra
import org.eclipse.jpt.common.ui.internal.plugin.JptCommonUiPlugin;
import org.eclipse.jpt.common.ui.internal.swt.ComboModelAdapter;
import org.eclipse.jpt.common.ui.internal.swt.DateTimeModelAdapter;
+import org.eclipse.jpt.common.ui.internal.swt.DisposeAdapter;
import org.eclipse.jpt.common.ui.internal.swt.SpinnerModelAdapter;
import org.eclipse.jpt.common.ui.internal.swt.TriStateCheckBoxModelAdapter;
import org.eclipse.jpt.common.ui.internal.util.LabeledButton;
@@ -28,11 +30,14 @@ import org.eclipse.jpt.common.ui.internal.util.LabeledControlUpdater;
import org.eclipse.jpt.common.ui.internal.utility.swt.SWTTools;
import org.eclipse.jpt.common.utility.internal.model.value.CompositeBooleanPropertyValueModel;
import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
+import org.eclipse.jpt.common.utility.internal.model.value.StaticPropertyValueModel;
import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
import org.eclipse.jpt.common.utility.internal.transformer.NonNullBooleanTransformer;
+import org.eclipse.jpt.common.utility.internal.transformer.NotNullObjectTransformer;
import org.eclipse.jpt.common.utility.internal.transformer.StringObjectTransformer;
import org.eclipse.jpt.common.utility.model.Model;
import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
+import org.eclipse.jpt.common.utility.model.listener.PropertyChangeAdapter;
import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
import org.eclipse.jpt.common.utility.model.value.ListValueModel;
import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
@@ -69,35 +74,35 @@ import org.eclipse.ui.help.IWorkbenchHelpSystem;
import org.eclipse.ui.part.PageBook;
/**
- * The abstract definition of a pane which holds onto a <code>PropertyValueModel</code>
- * that contains the subject of this pane.
+ * The abstract definition of a pane which holds a {@link PropertyValueModel}
+ * that contains the pane's subject.
* <p>
- * It also contains convenience methods for building buttons, labels, check
- * boxes, and radio buttons, etc.
+ * This class contains convenience methods for building buttons, labels, check
+ * boxes, radio buttons, etc.
* <p>
* It is possible to easily listen to any property changes coming from the
- * subject, {@link #addPropertyNames(Collection)} is specify which properties
+ * subject, {@link #addPropertyNames(Collection)} specifies which properties
* are of interest and {@link #propertyChanged(String)} is used to notify the
* pane when the property has changed.
- *
- * @see FormPane
+ *
* @see DialogPane
- *
- * @version 2.0
- * @since 2.0
*/
@SuppressWarnings("nls")
-public abstract class Pane<T extends Model>
-{
+public abstract class Pane<T extends Model> {
+ /**
+ * This will be <code>null</code> for <em>root</em> panes.
+ */
+ private final Pane<?> parent;
+
/**
* The listener registered with the subject in order to be notified when a
* property has changed, the property names are determined by
- * {@link #propertyNames()}.
+ * {@link #getPropertyNames()}.
*/
- private PropertyChangeListener aspectChangeListener;
+ private final PropertyChangeListener aspectChangeListener;
/**
- * The container of this composite.
+ * The container of the pane's composite.
*/
private final Composite container;
@@ -106,34 +111,37 @@ public abstract class Pane<T extends Model>
*/
private boolean populating;
-
/**
- * This listener is registered with the subject holder in order to
- * automatically repopulate this pane with the new subject.
+ * This listener is registered with the {@link #subjectModel} in order to
+ * automatically repopulate this pane when the subject changes.
*/
- private PropertyChangeListener subjectChangeListener;
+ private final PropertyChangeListener subjectChangeListener;
/**
- * The subject of this pane.
+ * The pane's subject.
*/
- private PropertyValueModel<T> subjectModel;
+ private final PropertyValueModel<? extends T> subjectModel;
/**
- * The collection of registered sub-panes will be automatically notified
- * when listeners need to be engaged or disengaged or when to populate its
- * widgets.
+ * The widget factory used by the pane and all its descendant panes to
+ * create various common widgets.
+ * This will be <code>null</code> if the pane has a {@link #parent}.
*/
- private Collection<Pane<?>> subPanes;
+ private final WidgetFactory widgetFactory;
/**
- * The factory used to create various common widgets.
+ * The resource manager used by the pane and all its descendant panes to
+ * allocate resources (images, colors, and fonts).
+ * This will be <code>null</code> if the pane has a {@link #parent}.
*/
- private WidgetFactory widgetFactory;
+ private final ResourceManager resourceManager;
/**
- * The "and" combination enabledModel passed in via constructor and the parent Pane's {@link #enabledModel}
+ * The AND of the <em>enabled</em> model passed in via the constructor and
+ * the parent pane's <em>enabled</em> model.
*/
- private PropertyValueModel<Boolean> enabledModel;
+ private final PropertyValueModel<Boolean> enabledModel;
+ private final PropertyChangeListener enabledModelListener;
/**
* A listener that allows us to stop listening to stuff when the control
@@ -141,254 +149,277 @@ public abstract class Pane<T extends Model>
*/
private final DisposeListener controlDisposeListener;
+
/**
- * Creates a new <code>Pane</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- * @param widgetFactory The factory used to create various widgets
- * @param automaticallyAlignWidgets <code>true</code> to make the widgets
- * this pane aligned with the widgets of the given parent pane;
- * <code>false</code> to not align them
- *
- * @category Constructor
+ * Construct a pane that uses the specified parent pane's:<ul>
+ * <li>subject model
+ * <li><em>enabled</em> model
+ * </ul>
*/
protected Pane(
- Pane<? extends T> parentPane,
- Composite parent) {
-
- this(
- parentPane,
- parentPane.getSubjectHolder(),
- parent);
+ Pane<? extends T> parent,
+ Composite parentComposite
+ ) {
+ this(parent, parent.getSubjectHolder(), parentComposite);
}
/**
- * Creates a new <code>Pane</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- * @param widgetFactory The factory used to create various widgets
- * @param automaticallyAlignWidgets <code>true</code> to make the widgets
- * this pane aligned with the widgets of the given parent pane;
- * <code>false</code> to not align them
- *
- * @category Constructor
+ * Construct a pane that uses the specified parent pane's:<ul>
+ * <li><em>enabled</em> model
+ * </ul>
*/
protected Pane(
- Pane<? extends T> parentPane,
- Composite parent,
- PropertyValueModel<Boolean> enabledModel) {
-
- this(
- parentPane,
- parentPane.getSubjectHolder(),
- enabledModel,
- parent);
+ Pane<?> parent,
+ PropertyValueModel<? extends T> subjectModel,
+ Composite parentComposite
+ ) {
+ this(parent, subjectModel, buildDefaultEnabledModel(), parentComposite);
}
/**
- * Creates a new <code>Pane</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various widgets
- * @param automaticallyAlignWidgets <code>true</code> to make the widgets
- * this pane aligned with the widgets of the given parent pane;
- * <code>false</code> to not align them
- *
- * @category Constructor
+ * Construct a pane that uses the specified parent pane's:<ul>
+ * <li>subject model
+ * </ul>
+ * The specified <em>enabled</em> model will be ANDed with the parent
+ * pane's <em>enabled</em> model (i.e. the pane can be <em>enabled</em>
+ * only if its parent pane is also <em>enabled</em>).
*/
protected Pane(
- Pane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent) {
-
- super();
- this.initialize(subjectHolder, parentPane.getEnabledModel(), parentPane.getWidgetFactory());
- this.initialize(parentPane);
- if (this.addsComposite()) {
- this.container = this.addComposite(parent);
- this.initializeLayout(this.container);
- }
- else {
- this.container = null;
- this.initializeLayout(parent);
- }
- this.controlDisposeListener = this.buildControlDisposeListener();
- this.getControl().addDisposeListener(this.controlDisposeListener);
- this.engageSubjectHolder();
- this.engageListeners(getSubject());
- this.populate();
+ Pane<? extends T> parent,
+ Composite parentComposite,
+ PropertyValueModel<Boolean> enabledModel
+ ) {
+ this(parent, parent.getSubjectHolder(), enabledModel, parentComposite);
}
/**
- * Creates a new <code>Pane</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various widgets
- * @param automaticallyAlignWidgets <code>true</code> to make the widgets
- * this pane aligned with the widgets of the given parent pane;
- * <code>false</code> to not align them
- * @param parentManagePane <code>true</code> to have the parent pane manage
- * the enabled state of this pane
- *
- * @category Constructor
+ * Construct a pane that uses the specified subject model and
+ * <em>enabled</em> model.
+ * <p>
+ * The specified <em>enabled</em> model will be ANDed with the parent
+ * pane's <em>enabled</em> model (i.e. the pane can be <em>enabled</em>
+ * only if its parent pane is also <em>enabled</em>).
*/
protected Pane(
- Pane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- PropertyValueModel<Boolean> enabledModel,
- Composite parent) {
+ Pane<?> parent,
+ PropertyValueModel<? extends T> subjectModel,
+ PropertyValueModel<Boolean> enabledModel,
+ Composite parentComposite
+ ) {
+ this(parent, subjectModel, enabledModel, parentComposite, null, null);
+ }
-
- super();
- this.initialize(subjectHolder, CompositeBooleanPropertyValueModel.and(this.wrapEnabledModel(enabledModel), parentPane.getEnabledModel()), parentPane.getWidgetFactory());
- this.initialize(parentPane);
- if (this.addsComposite()) {
- this.container = this.addComposite(parent);
- this.initializeLayout(this.container);
- }
- else {
- this.container = null;
- this.initializeLayout(parent);
- }
- this.controlDisposeListener = this.buildControlDisposeListener();
- this.getControl().addDisposeListener(this.controlDisposeListener);
- this.engageSubjectHolder();
- this.engageListeners(getSubject());
- this.populate();
+ /**
+ * Construct a <em>root</em> pane with the specified subject model, widget
+ * factory, and resource manager.
+ * The pane will be <em>disabled</em> whenever the subject is
+ * <code>null</code>.
+ */
+ protected Pane(
+ PropertyValueModel<? extends T> subjectModel,
+ Composite parentComposite,
+ WidgetFactory widgetFactory,
+ ResourceManager resourceManager
+ ) {
+ this(subjectModel, buildNotNullModel(subjectModel), parentComposite, widgetFactory, resourceManager);
}
/**
- * Creates a new <code>Pane</code>.
- *
- * @param subjectModel The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- *
- * @category Constructor
+ * Construct a <em>root</em> pane with the specified subject model,
+ * <em>enabled</em> model, widget factory, and resource manager.
+ * <p>
+ * The specified <em>enabled</em> model will be ANDed with the parent
+ * pane's <em>enabled</em> model (i.e. the pane can be <em>enabled</em>
+ * only if its parent pane is also <em>enabled</em>).
*/
protected Pane(
PropertyValueModel<? extends T> subjectModel,
- Composite parent,
- WidgetFactory widgetFactory) {
+ PropertyValueModel<Boolean> enabledModel,
+ Composite parentComposite,
+ WidgetFactory widgetFactory,
+ ResourceManager resourceManager
+ ) {
+ this(null, subjectModel, enabledModel, parentComposite, widgetFactory, resourceManager);
+ }
+ /**
+ * This constructor is <code>private</code> so we can enable, but also
+ * require, <em>root</em> panes (i.e. panes without parents) to specify the
+ * following:<ul>
+ * <li>subject model
+ * <li>widget factory
+ * </ul>
+ */
+ private Pane(
+ Pane<?> parent,
+ PropertyValueModel<? extends T> subjectModel,
+ PropertyValueModel<Boolean> enabledModel,
+ Composite parentComposite,
+ WidgetFactory widgetFactory,
+ ResourceManager resourceManager
+ ) {
super();
- this.initialize(subjectModel, this.buildNonNullEnabledModel(subjectModel), widgetFactory);
- if (this.addsComposite()) {
- this.container = this.addComposite(parent);
- this.initializeLayout(this.container);
+ if ((subjectModel == null) || (enabledModel == null) || (parentComposite == null)) {
+ throw new NullPointerException();
}
- else {
- this.container = null;
- this.initializeLayout(parent);
+ if (parent == null) {
+ if ((widgetFactory == null) || (resourceManager == null)) {
+ throw new NullPointerException();
+ }
}
- this.controlDisposeListener = this.buildControlDisposeListener();
- this.getControl().addDisposeListener(this.controlDisposeListener);
- this.engageSubjectHolder();
- this.engageListeners(getSubject());
- this.populate();
- }
-
- protected Pane(
- PropertyValueModel<? extends T> subjectHolder,
- PropertyValueModel<Boolean> enabledModel,
- Composite parent,
- WidgetFactory widgetFactory) {
+ this.parent = parent;
+ this.subjectModel = subjectModel;
+
+ this.enabledModel = andEnabledModel(parent, enabledModel);
+ this.enabledModelListener = this.buildEnabledModelListener();
+ this.enabledModel.addPropertyChangeListener(PropertyValueModel.VALUE, this.enabledModelListener);
+
+ this.widgetFactory = widgetFactory;
+ this.resourceManager = (resourceManager == null) ? null : new LocalResourceManager(resourceManager);
+
+ this.aspectChangeListener = this.buildAspectChangeListener();
+
+ this.initialize();
- super();
- this.initialize(subjectHolder, this.wrapEnabledModel(enabledModel), widgetFactory);
if (this.addsComposite()) {
- this.container = this.addComposite(parent);
+ this.container = this.addComposite(parentComposite);
this.initializeLayout(this.container);
- }
- else {
+ } else {
this.container = null;
- this.initializeLayout(parent);
+ this.initializeLayout(parentComposite);
}
this.controlDisposeListener = this.buildControlDisposeListener();
this.getControl().addDisposeListener(this.controlDisposeListener);
- this.engageSubjectHolder();
+
+ this.subjectChangeListener = this.buildSubjectChangeListener();
+ this.subjectModel.addPropertyChangeListener(PropertyValueModel.VALUE, this.subjectChangeListener);
+
this.engageListeners(getSubject());
this.populate();
}
- protected PropertyValueModel<Boolean> buildNonNullEnabledModel(PropertyValueModel<? extends T> subjectModel) {
- return new TransformationPropertyValueModel<T, Boolean>(subjectModel) {
- @Override
- protected Boolean transform(T value) {
- return Boolean.valueOf(value != null);
- }
- };
+
+ // ********** enabled model **********
+
+ /**
+ * Return an <em>enabled</em> model that will result in the pane's
+ * <em>enabled</em> state always matching that of its parent pane.
+ */
+ private static PropertyValueModel<Boolean> buildDefaultEnabledModel() {
+ return new StaticPropertyValueModel<Boolean>(Boolean.TRUE);
}
-
- // ********** initialization **********
+ /**
+ * Return a {@link Boolean} value model that will return
+ * {@link Boolean#TRUE} if the value of the specified value model is
+ * <em>not</em> <code>null</code>;
+ * {@link Boolean#FALSE} if the value <em>is</em> <code>null</code>.
+ */
+ protected static PropertyValueModel<Boolean> buildNotNullModel(PropertyValueModel<?> valueModel) {
+ return new TransformationPropertyValueModel<Object, Boolean>(valueModel, NotNullObjectTransformer.instance());
+ }
+
+ /**
+ * Convenience method for sub-classes.
+ * Wrap the pane's {@link #subjectModel} in a {@link #buildNotNullModel(PropertyValueModel)};
+ * i.e. a model that returns whether the subject is <code>null</code>.
+ */
+ protected PropertyValueModel<Boolean> buildNotNullSubjectModel() {
+ return buildNotNullModel(this.subjectModel);
+ }
+ /**
+ * Return a {@link Boolean} value model that will return the AND of the
+ * value of the <em>enabled</em> model of the specified (typically parent) pane
+ * and the value of the specified <em>enabled</em> model.
+ * <p>
+ * This is useful for a pane that is <em>enabled</em> when both its parent
+ * pane is <em>enabled</em> <em>and</em> the pane's model indicates the
+ * pane should be <em>enabled</em>.
+ */
@SuppressWarnings("unchecked")
- private void initialize(
- PropertyValueModel<? extends T> subjectModel,
- PropertyValueModel<Boolean> enabledModel,
- WidgetFactory widgetFactory) {
+ private static PropertyValueModel<Boolean> andEnabledModel(Pane<?> pane, PropertyValueModel<Boolean> enabledModel) {
+ enabledModel = buildNonNullModel(enabledModel);
+ // NB: we fetch private state from the pane
+ return (pane == null) ? enabledModel : CompositeBooleanPropertyValueModel.and(pane.enabledModel, enabledModel);
+ }
+
+ /**
+ * Return a {@link Boolean} value model that will return the value of the
+ * specified {@link Boolean} value model if it is <em>not</em>
+ * <code>null</code>;
+ * {@link Boolean#FALSE} if the value is <code>null</code>.
+ * <p>
+ * This is useful for <em>enabled</em> models that might return <code>null</code>
+ * (which is typical with aspect adapters etc.).
+ */
+ private static PropertyValueModel<Boolean> buildNonNullModel(PropertyValueModel<Boolean> booleanModel) {
+ return new TransformationPropertyValueModel<Boolean, Boolean>(booleanModel, NonNullBooleanTransformer.FALSE);
+ }
- Assert.isNotNull(subjectModel, "The subject model cannot be null");
- this.subjectModel = (PropertyValueModel<T>) subjectModel;
- this.widgetFactory = widgetFactory;
- this.enabledModel = enabledModel;
- this.subPanes = new ArrayList<Pane<?>>();
- this.subjectChangeListener = this.buildSubjectChangeListener();
- this.aspectChangeListener = this.buildAspectChangeListener();
+ // ********** initialization **********
- this.initialize();
+ private PropertyChangeListener buildEnabledModelListener() {
+ return new EnabledModelListener();
}
- protected void initialize() {
- // do nothing by default
+ /* CU private */ class EnabledModelListener
+ extends PropertyChangeAdapter
+ {
+ @Override
+ public void propertyChanged(PropertyChangeEvent event) {
+ Pane.this.enabledModelChanged(((Boolean) event.getOldValue()).booleanValue(), ((Boolean) event.getNewValue()).booleanValue());
+ }
+ }
+
+ protected void enabledModelChanged(@SuppressWarnings("unused") boolean oldEnabled, @SuppressWarnings("unused") boolean newEnabled) {
+ // NOP
+ }
+
+ private PropertyChangeListener buildSubjectChangeListener() {
+ return new SWTPropertyChangeListenerWrapper(this.buildSubjectChangeListener_());
+ }
+
+ private PropertyChangeListener buildSubjectChangeListener_() {
+ return new SubjectChangeListener();
+ }
+
+ /* CU private */ class SubjectChangeListener
+ extends PropertyChangeAdapter
+ {
+ @Override
+ @SuppressWarnings("unchecked")
+ public void propertyChanged(PropertyChangeEvent e) {
+ Pane.this.subjectChanged((T) e.getOldValue(), (T) e.getNewValue());
+ }
}
/**
- * Registers this pane with the parent pane.
- *
- * @param parentPane The parent pane
- * @param automaticallyAlignWidgets <code>true</code> to make the widgets
- * this pane aligned with the widgets of the given parent pane;
- * <code>false</code> to not align them
- * @param parentManagePane <code>true</code> to have the parent pane manage
- * the enabled state of this pane
- *
- * @category Initialization
+ * Initialize the pane's models. This method is called before the pane's
+ * UI widget is built in {@link #initializeLayout(Composite)}.
*/
- private void initialize(Pane<?> parentPane) {
- // Register this pane with the parent pane, it will call the methods
- // automatically (engageListeners(), disengageListeners(), populate(),
- // dispose(), etc)
- parentPane.registerSubPane(this);
+ protected void initialize() {
+ // do nothing by default
}
/**
- * Initializes the layout of this pane.
- *
- * @param container The parent container
- *
- * @category Layout
+ * Build the pane's UI widget in the specified composite, using
+ * the models built in {@link #initialize()}.
*/
- protected abstract void initializeLayout(Composite container);
+ protected abstract void initializeLayout(Composite parentComposite);
private DisposeListener buildControlDisposeListener() {
- return new DisposeListener() {
- public void widgetDisposed(DisposeEvent event) {
- Pane.this.controlDisposed();
- }
- @Override
- public String toString() {
- return "control dispose listener";
- }
- };
+ return new ControlDisposeListener();
+ }
+
+ /* CU private */ class ControlDisposeListener
+ extends DisposeAdapter
+ {
+ @Override
+ public void widgetDisposed(DisposeEvent event) {
+ Pane.this.controlDisposed();
+ }
}
@@ -514,7 +545,7 @@ public abstract class Pane<T extends Model>
String helpId,
final Runnable buttonAction) {
- Button button = this.widgetFactory.createButton(container, text);
+ Button button = this.getWidgetFactory().createButton(container, text);
button.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
@@ -629,7 +660,7 @@ public abstract class Pane<T extends Model>
* @category Layout
*/
private Combo addUnmanagedCombo(Composite container) {
- Combo combo = this.widgetFactory.createCombo(container);
+ Combo combo = this.getWidgetFactory().createCombo(container);
combo.setLayoutData(getFieldGridData());
return combo;
}
@@ -752,7 +783,6 @@ public abstract class Pane<T extends Model>
* to reduce the number of SWT Controls (USER handles in windows) created.
* Typically you would return false if the Pane is for only 1 widget. In this case
* you need to override {@link #getControl()} to return the appropriate Control
- * @return
*/
protected boolean addsComposite() {
return true;
@@ -786,7 +816,7 @@ public abstract class Pane<T extends Model>
}
protected final Combo addEditableCombo(Composite container, String helpId) {
- Combo combo = this.widgetFactory.createEditableCombo(container);
+ Combo combo = this.getWidgetFactory().createEditableCombo(container);
if (helpId != null) {
getHelpSystem().setHelp(combo, helpId);
@@ -874,7 +904,7 @@ public abstract class Pane<T extends Model>
String text,
final Runnable hyperLinkAction) {
- Hyperlink link = this.widgetFactory.createHyperlink(parent, text);
+ Hyperlink link = this.getWidgetFactory().createHyperlink(parent, text);
this.controlEnabledState(link);
link.addMouseListener(new MouseAdapter() {
@@ -895,7 +925,7 @@ public abstract class Pane<T extends Model>
protected final Hyperlink addHyperlink(Composite parent,
String text) {
- Hyperlink link = this.widgetFactory.createHyperlink(parent, text);
+ Hyperlink link = this.getWidgetFactory().createHyperlink(parent, text);
this.controlEnabledState(link);
return link;
@@ -940,7 +970,7 @@ public abstract class Pane<T extends Model>
private Label addUnmanagedLabel(Composite container,
String labelText) {
- return this.widgetFactory.createLabel(container, labelText);
+ return this.getWidgetFactory().createLabel(container, labelText);
}
/**
@@ -991,7 +1021,7 @@ public abstract class Pane<T extends Model>
int maximumValue,
String helpId) {
- Spinner spinner = this.widgetFactory.createSpinner(parent);
+ Spinner spinner = this.getWidgetFactory().createSpinner(parent);
spinner.setMinimum(minimumValue);
spinner.setMaximum(maximumValue);
GridData gridData = getFieldGridData();
@@ -1065,7 +1095,7 @@ public abstract class Pane<T extends Model>
ModifiablePropertyValueModel<Integer> secondsHolder,
String helpId) {
- DateTime dateTime = this.widgetFactory.createDateTime(parent, SWT.TIME);
+ DateTime dateTime = this.getWidgetFactory().createDateTime(parent, SWT.TIME);
DateTimeModelAdapter.adapt(hoursHolder, minutesHolder, secondsHolder, dateTime);
@@ -1117,7 +1147,7 @@ public abstract class Pane<T extends Model>
private Combo addUnmanagedEditableCombo(Composite container,
String helpId) {
- Combo combo = this.widgetFactory.createEditableCombo(container);
+ Combo combo = this.getWidgetFactory().createEditableCombo(container);
combo.setLayoutData(getFieldGridData());
@@ -1188,7 +1218,7 @@ public abstract class Pane<T extends Model>
ModifiablePropertyValueModel<String> selectionHolder,
String helpId) {
- List list = this.widgetFactory.createList(
+ List list = this.getWidgetFactory().createList(
container,
SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI
);
@@ -1212,7 +1242,7 @@ public abstract class Pane<T extends Model>
*/
protected final Text addMultiLineText(Composite container) {
- Text text = this.widgetFactory.createMultiLineText(container);
+ Text text = this.getWidgetFactory().createMultiLineText(container);
text.setLayoutData(getFieldGridData());
this.controlEnabledState(text);
@@ -1321,7 +1351,7 @@ public abstract class Pane<T extends Model>
* @category Layout
*/
protected final Composite addPane(Composite parent) {
- return this.widgetFactory.createComposite(parent);
+ return this.getWidgetFactory().createComposite(parent);
}
/**
@@ -1369,7 +1399,7 @@ public abstract class Pane<T extends Model>
*/
protected final Text addPasswordText(Composite container) {
- Text text = this.widgetFactory.createPasswordText(container);
+ Text text = this.getWidgetFactory().createPasswordText(container);
text.setLayoutData(getFieldGridData());
this.controlEnabledState(text);
@@ -1409,7 +1439,7 @@ public abstract class Pane<T extends Model>
String helpId,
final Runnable buttonAction) {
- Button button = this.widgetFactory.createPushButton(parent, buttonText);
+ Button button = this.getWidgetFactory().createPushButton(parent, buttonText);
controlEnabledState(button);
button.addSelectionListener(new SelectionAdapter() {
@Override
@@ -1494,7 +1524,7 @@ public abstract class Pane<T extends Model>
String description,
int type) {
- Section section = this.widgetFactory.createSection(container, type | ((description != null) ? Section.DESCRIPTION : SWT.NULL));
+ Section section = this.getWidgetFactory().createSection(container, type | ((description != null) ? Section.DESCRIPTION : SWT.NULL));
section.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
section.setText(sectionText);
@@ -1524,19 +1554,6 @@ public abstract class Pane<T extends Model>
};
}
- private PropertyChangeListener buildSubjectChangeListener() {
- return new SWTPropertyChangeListenerWrapper(this.buildSubjectChangeListener_());
- }
-
- private PropertyChangeListener buildSubjectChangeListener_() {
- return new PropertyChangeListener() {
- @SuppressWarnings("unchecked")
- public void propertyChanged(PropertyChangeEvent e) {
- Pane.this.subjectChanged((T) e.getOldValue(), (T) e.getNewValue());
- }
- };
- }
-
/**
* Creates a new <code>Composite</code> used as a sub-pane.
*
@@ -1679,7 +1696,7 @@ public abstract class Pane<T extends Model>
int style,
String helpId) {
- Table table = this.widgetFactory.createTable(container, style);
+ Table table = this.getWidgetFactory().createTable(container, style);
table.setHeaderVisible(true);
table.setLinesVisible(true);
@@ -1759,7 +1776,7 @@ public abstract class Pane<T extends Model>
* @category Layout
*/
private Text addUnmanagedText(Composite container) {
- Text text = this.widgetFactory.createText(container);
+ Text text = this.getWidgetFactory().createText(container);
text.setLayoutData(getFieldGridData());
return text;
}
@@ -1919,7 +1936,7 @@ public abstract class Pane<T extends Model>
int columnCount,
String helpId) {
- Group group = this.widgetFactory.createGroup(container, title);
+ Group group = this.getWidgetFactory().createGroup(container, title);
//manageWidget(group); TODO unsure if I want to manage groups,
//also should probably rename this addUnmanagedTitledPane
group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
@@ -1964,16 +1981,16 @@ public abstract class Pane<T extends Model>
Button button;
if (toggleButtonType == SWT.PUSH) {
- button = this.widgetFactory.createPushButton(parent, buttonText);
+ button = this.getWidgetFactory().createPushButton(parent, buttonText);
}
else if (toggleButtonType == SWT.RADIO) {
- button = this.widgetFactory.createRadioButton(parent, buttonText);
+ button = this.getWidgetFactory().createRadioButton(parent, buttonText);
}
else if (toggleButtonType == SWT.CHECK) {
- button = this.widgetFactory.createCheckBox(parent, buttonText);
+ button = this.getWidgetFactory().createCheckBox(parent, buttonText);
}
else {
- button = this.widgetFactory.createButton(parent, buttonText);
+ button = this.getWidgetFactory().createButton(parent, buttonText);
}
button.setLayoutData(new GridData());
@@ -2127,50 +2144,60 @@ public abstract class Pane<T extends Model>
JptCommonUiPlugin.instance().trace(TRACE_OPTION, "doPopulate");
}
- private void controlEnabledState(Control... controls) {
- SWTTools.controlEnabledState(getEnabledModel(), controls);
- }
- private void controlEnabledState(PropertyValueModel<Boolean> booleanModel, Control... controls) {
- this.controlEnabledState_(this.wrapEnabledModel(booleanModel), controls);
+ // ********** enabled models **********
+
+ protected boolean isEnabled() {
+ return this.enabledModel.getValue().booleanValue();
}
/**
- * Assume the "enabled" models can return null (which is typical with aspect
- * adapters etc.).
+ * Control the <em>enabled</em> state of the specified controls with the
+ * pane's {@link #enabledModel}.
+ * <p>
+ * Use {@link #controlEnabledState(PropertyValueModel, Control...)} if the
+ * controls might be disabled when the pane is enabled.
*/
- private PropertyValueModel<Boolean> wrapEnabledModel(PropertyValueModel<Boolean> booleanModel) {
- return new TransformationPropertyValueModel<Boolean, Boolean>(booleanModel, NonNullBooleanTransformer.FALSE);
+ protected void controlEnabledState(Control... controls) {
+ SWTTools.controlEnabledState(this.enabledModel, controls);
}
- private void controlEnabledState_(PropertyValueModel<Boolean> booleanModel, Control... controls) {
- SWTTools.controlEnabledState(this.andEnabledModel(booleanModel), controls);
- }
-
- protected PropertyValueModel<Boolean> getEnabledModel() {
- return this.enabledModel;
+ /**
+ * Use the specified boolean model to determine the <em>enabled</em>
+ * state of the specified controls (i.e. when the <em>pane</em> is enabled).
+ * If the specified boolean model returns <code>null</code> (which is
+ * typical of aspect adapters), the controls will be disabled.
+ * <p>
+ * Use {@link #controlEnabledState(Control...)} if the
+ * controls are only enabled when the pane is enabled.
+ */
+ protected void controlEnabledState(PropertyValueModel<Boolean> controlsEnabledModel, Control... controls) {
+ SWTTools.controlEnabledState(this.andEnabledModel(controlsEnabledModel), controls);
}
- @SuppressWarnings("unchecked")
+ /**
+ * AND the specified boolean model with the pane's {@link #enabledModel},
+ * resulting in an <em>enabled</em> model that can only be <code>true</code>
+ * when the pane as a whole is enabled.
+ */
private PropertyValueModel<Boolean> andEnabledModel(PropertyValueModel<Boolean> booleanModel) {
- return CompositeBooleanPropertyValueModel.and(getEnabledModel(), booleanModel);
+ return andEnabledModel(this, booleanModel);
}
- private void engageSubjectHolder() {
- this.subjectModel.addPropertyChangeListener(PropertyValueModel.VALUE, this.subjectChangeListener);
- }
+
+ // ********** subject listeners **********
/**
- * engage the specified subject
+ * Engage the specified subject
*/
- protected void engageListeners(T subject) {
+ private void engageListeners(T subject) {
if (subject != null) {
this.engageListeners_(subject);
}
}
/**
- * specified subject is not null
+ * Pre-condition: the specified subject is not <code>null</code>
*/
protected void engageListeners_(T subject) {
JptCommonUiPlugin.instance().trace(TRACE_OPTION, "engageListeners_({0})", subject);
@@ -2181,16 +2208,16 @@ public abstract class Pane<T extends Model>
}
/**
- * disengage the specified subject
+ * Disengage the specified subject
*/
- protected void disengageListeners(T subject) {
+ private void disengageListeners(T subject) {
if (subject != null) {
this.disengageListeners_(subject);
}
}
/**
- * specified subject is not null
+ * Pre-condition: the specified subject is not <code>null</code>
*/
protected void disengageListeners_(T subject) {
JptCommonUiPlugin.instance().trace(TRACE_OPTION, "disengageListeners_({0})", subject);
@@ -2200,10 +2227,6 @@ public abstract class Pane<T extends Model>
}
}
- private void disengageSubjectHolder() {
- this.subjectModel.removePropertyChangeListener(PropertyValueModel.VALUE, this.subjectChangeListener);
- }
-
/**
* Returns the main <code>Composite</code> of this pane.
*
@@ -2225,40 +2248,30 @@ public abstract class Pane<T extends Model>
*
* @category Populate
*/
- protected final PropertyValueModel<T> getSubjectHolder() {
+ protected final PropertyValueModel<? extends T> getSubjectHolder() {
return this.subjectModel;
}
/**
- * Returns the factory responsible for creating the widgets.
- *
- * @return The factory used by this pane to create the widgets
- *
- * @category Layout
+ * If the pane is a <em>root</em> pane, return its widget factory;
+ * otherwise return the pane's parent's widget factory.
*/
protected final WidgetFactory getWidgetFactory() {
- return this.widgetFactory;
+ return (this.parent == null) ? this.widgetFactory : this.parent.getWidgetFactory();
}
/**
- * Returns the helps system.
- *
- * @return The platform's help system
- *
- * @category Helper
+ * If the pane is a <em>root</em> pane, return its resource manager;
+ * otherwise return the pane's parent's resource manager.
*/
+ public final ResourceManager getResourceManager() {
+ return (this.parent == null) ? this.resourceManager : this.parent.getResourceManager();
+ }
+
protected final IWorkbenchHelpSystem getHelpSystem() {
return PlatformUI.getWorkbench().getHelpSystem();
}
-
- /**
- * Determines whether
- *
- * @return
- *
- * @category Populate
- */
protected final boolean isPopulating() {
return this.populating;
}
@@ -2276,51 +2289,34 @@ public abstract class Pane<T extends Model>
}
/**
- * Notifies the subject's property associated with the given property name
- * has changed.
- *
- * @param propertyName The property name associated with the property change
- *
- * @category Populate
+ * The subject's specified property has changed.
*/
- protected void propertyChanged(String propertyName) {
+ protected void propertyChanged(@SuppressWarnings("unused") String propertyName) {
+ // NOP
}
/**
- * Returns the list of names to listen for properties changing from the
- * subject.
- *
- * @return A non-<code>null</code> list of property names
- *
- * @category Populate
+ * Return the names of the subject's properties we listen to here and notify
+ * via calls to {@link #propertyChanged(String)}.
*/
- protected Collection<String> getPropertyNames() {
+ private Collection<String> getPropertyNames() {
ArrayList<String> propertyNames = new ArrayList<String>();
- addPropertyNames(propertyNames);
+ this.addPropertyNames(propertyNames);
return propertyNames;
}
/**
* This method is called (perhaps internally) when this needs to repopulate
* but the object of interest has not changed.
- *
- * @category Populate
*/
protected final void repopulate() {
JptCommonUiPlugin.instance().trace(TRACE_OPTION, "repopulate");
- // Populate this pane
try {
- setPopulating(true);
- doPopulate();
- }
- finally {
- setPopulating(false);
- }
-
- // Ask the sub-panes to repopulate themselves
- for (Pane<?> subPane : this.subPanes) {
- subPane.repopulate();
+ this.setPopulating(true);
+ this.doPopulate();
+ } finally {
+ this.setPopulating(false);
}
}
@@ -2329,10 +2325,6 @@ public abstract class Pane<T extends Model>
* populated or not. During population, it is required to not update the
* widgets when the model is updated nor to update the model when the widgets
* are being synchronized with the model's values.
- *
- * @param populating
- *
- * @category Populate
*/
protected final void setPopulating(boolean populating) {
this.populating = populating;
@@ -2340,8 +2332,6 @@ public abstract class Pane<T extends Model>
/**
* Either show or hides this pane.
- *
- * @param visible The new visibility state
*/
public void setVisible(boolean visible) {
if (this.container != null && !this.container.isDisposed()) {
@@ -2350,76 +2340,32 @@ public abstract class Pane<T extends Model>
}
/**
- * Returns the nearest <code>Shell</code> displaying the main widget of this
- * pane.
- *
- * @return The nearest window displaying this pane
+ * @see Control#getShell()
*/
public final Shell getShell() {
return this.getControl().getShell();
}
/**
- * Returns the subject of this pane.
- *
- * @return The subject if this pane was not disposed; <code>null</code>
- * if it was
- *
- * @category Populate
+ * Return the pane's subject.
*/
public T getSubject() {
return this.subjectModel.getValue();
}
/**
- * The subject has changed, disconnects any listeners from the old subject
- * and connects those listeners onto the new subject.
- *
- * @param oldsubject The old subject or <code>null</code> if none was set
- * @param newSubject The new subject or <code>null</code> if none needs to be
- * set
- *
- * @category Populate
+ * The pane's subject has changed. Disconnect any listeners from the old
+ * subject and connect those listeners to the new subject.
*/
- protected final void subjectChanged(T oldSubject, T newSubject) {
- if (!this.getControl().isDisposed()) {
-
+ /* CU private */ final void subjectChanged(T oldSubject, T newSubject) {
+ if ( ! this.getControl().isDisposed()) {
JptCommonUiPlugin.instance().trace(TRACE_OPTION, "subjectChanged({0}, {1})", oldSubject, newSubject);
this.disengageListeners(oldSubject);
-
this.repopulate();
-
this.engageListeners(newSubject);
}
}
-
- /**
- * Registers another <code>Pane</code> with this one so it can
- * be automatically notified about certain events such as engaging or
- * disengaging the listeners, etc.
- *
- * @param subPane The sub-pane to register
- *
- * @category Controller
- */
- protected final void registerSubPane(Pane<?> subPane) {
- this.subPanes.add(subPane);
- }
-
- /**
- * Unregisters the given <code>Pane</code> from this one so it
- * can no longer be automatically notified about certain events such as
- * engaging or disengaging the listeners, etc.
- *
- * @param subPane The sub-pane to unregister
- *
- * @category Controller
- */
- protected final void unregisterSubPane(Pane<?> subPane) {
- this.subPanes.remove(subPane);
- }
-
private void updatePane(String propertyName) {
if (!isPopulating() && !this.getControl().isDisposed()) {
this.populating = true;
@@ -2436,13 +2382,17 @@ public abstract class Pane<T extends Model>
protected void controlDisposed() {
// the control is not yet "disposed" when we receive this event
// so we can still remove our listeners
- JptCommonUiPlugin.instance().trace(TRACE_OPTION, "dispose");
+ JptCommonUiPlugin.instance().trace(TRACE_OPTION, "control disposed");
- // Dispose this pane
this.disengageListeners(getSubject());
- this.disengageSubjectHolder();
+ this.subjectModel.removePropertyChangeListener(PropertyValueModel.VALUE, this.subjectChangeListener);
+
+ this.enabledModel.removePropertyChangeListener(PropertyValueModel.VALUE, this.enabledModelListener);
this.getControl().removeDisposeListener(this.controlDisposeListener);
+ if (this.parent == null) {
+ this.resourceManager.dispose();
+ }
}
private static final String TRACE_OPTION = Pane.class.getSimpleName();
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/ValidatingDialog.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/ValidatingDialog.java
index 5e0ba91310..2ff4a83a2c 100644
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/ValidatingDialog.java
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/ValidatingDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2012 Oracle. All rights reserved.
* 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.
@@ -11,6 +11,7 @@ package org.eclipse.jpt.common.ui.internal.widgets;
import java.util.ListIterator;
import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.resource.ResourceManager;
import org.eclipse.jpt.common.utility.node.Node;
import org.eclipse.jpt.common.utility.node.Problem;
import org.eclipse.osgi.util.NLS;
@@ -20,7 +21,7 @@ import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Shell;
/**
- * This dialog is similar to it superclass, <code>Dialog</code>, with
+ * This dialog is similar to its superclass, {@link Dialog}, with
* the added value of an error message label below the main panel. A subclass
* can set this error message as needed so that it can inform the user something
* incorrect has been entered.
@@ -28,41 +29,33 @@ import org.eclipse.swt.widgets.Shell;
* If there is an error message, it will be shown. If there is a warning
* message, it will only be shown if there is no error message. Warning messages
* have a different icon than error messages.
- *
- * @version 2.0
- * @since 2.0
*/
-public abstract class ValidatingDialog<T extends Node> extends Dialog<T> {
-
+public abstract class ValidatingDialog<T extends Node>
+ extends Dialog<T>
+{
/**
- * Creates a new <code>ValidatingDialog</code>.
- *
- * @param parent The parent shell
+ * Construct a dialog with the specified resource manager and no title.
*/
- public ValidatingDialog(Shell parent) {
- super(parent);
+ public ValidatingDialog(Shell parentShell, ResourceManager resourceManager) {
+ super(parentShell, resourceManager);
}
/**
- * Creates a new <code>ValidatingDialog</code>.
- *
- * @param parent The parent shell
- * @param title The dialog's title
+ * Construct a dialog with the specified resource manager and title.
*/
- public ValidatingDialog(Shell parent, String title) {
- super(parent, title);
+ public ValidatingDialog(Shell parentShell, ResourceManager resourceManager, String title) {
+ super(parentShell, resourceManager, title);
}
- /*
- * (non-Javadoc)
- */
@Override
final Node.Validator buildValidator() {
return new Node.Validator() {
public void pause() {
+ // NOP
}
public void resume() {
+ // NOP
}
public void validate() {
@@ -225,9 +218,9 @@ public abstract class ValidatingDialog<T extends Node> extends Dialog<T> {
* pane to show the first error if any exists and update the enablement of
* the OK button.
*/
- private void validate() {
+ /* CU private */ void validate() {
getSubject().validateBranch();
updateMessage();
getButton(OK).setEnabled(!containsErrorMessage());
}
-} \ No newline at end of file
+}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/jface/ItemLabelProvider.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/jface/ItemLabelProvider.java
index 921a8e5712..1043b9f6da 100644
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/jface/ItemLabelProvider.java
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/jface/ItemLabelProvider.java
@@ -9,6 +9,7 @@
******************************************************************************/
package org.eclipse.jpt.common.ui.jface;
+import org.eclipse.jface.resource.ResourceManager;
import org.eclipse.swt.graphics.Image;
/**
@@ -53,6 +54,15 @@ public interface ItemLabelProvider {
*/
interface Manager {
/**
+ * Return a resource manager that can be used by the item label
+ * provider to retrieve {@link Image}s. The provider manager will
+ * dispose the resource manager;
+ * but, to minimize resource usage, the item label provider should
+ * dispose its own image(s) as appropriate.
+ */
+ ResourceManager getResourceManager();
+
+ /**
* The label (image and/or text) for the specified item has changed.
* Update appropriately.
*/
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/ComparatorAdapter.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/ComparatorAdapter.java
new file mode 100644
index 0000000000..abee48cc16
--- /dev/null
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/ComparatorAdapter.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Oracle. All rights reserved.
+ * 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.common.utility.internal;
+
+import java.util.Comparator;
+
+/**
+ * Convenience comparator that always returns 0;
+ *
+ * @param <T> the type of objects to be compared
+ */
+public class ComparatorAdapter<T>
+ implements Comparator<T>
+{
+ public int compare(T o1, T o2) {
+ return 0;
+ }
+
+ @Override
+ public String toString() {
+ return ObjectTools.toString(this);
+ }
+}
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/CompositeCollectionValueModel.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/CompositeCollectionValueModel.java
index 9b7e497f0c..372ad0300b 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/CompositeCollectionValueModel.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/CompositeCollectionValueModel.java
@@ -118,7 +118,7 @@ public class CompositeCollectionValueModel<E1, E2>
* model already contains other collection value models.
*/
public static <E1 extends CollectionValueModel<? extends E2>, E2> CompositeCollectionValueModel<E1, E2> forModels(CollectionValueModel<E1> collectionModel) {
- return new CompositeCollectionValueModel<E1, E2>(collectionModel, Transformer.Null.<E1>instance());
+ return new CompositeCollectionValueModel<E1, E2>(collectionModel, Transformer.Non.<E1>instance());
}
/**
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/CompositeListValueModel.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/CompositeListValueModel.java
index 878b6a2000..0c65faf173 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/CompositeListValueModel.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/CompositeListValueModel.java
@@ -126,7 +126,7 @@ public class CompositeListValueModel<E1, E2>
* model already contains other list value models.
*/
public static <E1 extends ListValueModel<? extends E2>, E2> CompositeListValueModel<E1, E2> forModels(ListValueModel<E1> listModel) {
- return new CompositeListValueModel<E1, E2>(listModel, Transformer.Null.<E1>instance());
+ return new CompositeListValueModel<E1, E2>(listModel, Transformer.Non.<E1>instance());
}
/**
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/prefs/PreferencePropertyValueModel.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/prefs/PreferencePropertyValueModel.java
index acb926451b..420b29278e 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/prefs/PreferencePropertyValueModel.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/prefs/PreferencePropertyValueModel.java
@@ -94,7 +94,7 @@ public class PreferencePropertyValueModel<P>
preferences,
key,
defaultValue,
- Transformer.Null.<String>instance()
+ Transformer.Non.<String>instance()
);
}
@@ -107,7 +107,7 @@ public class PreferencePropertyValueModel<P>
preferencesModel,
key,
defaultValue,
- Transformer.Null.<String>instance()
+ Transformer.Non.<String>instance()
);
}
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/NonNullBooleanTransformer.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/NonNullBooleanTransformer.java
index 4687c956bf..c2d44ad3af 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/NonNullBooleanTransformer.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/NonNullBooleanTransformer.java
@@ -9,6 +9,7 @@
******************************************************************************/
package org.eclipse.jpt.common.utility.internal.transformer;
+import java.io.Serializable;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
import org.eclipse.jpt.common.utility.transformer.Transformer;
@@ -23,7 +24,7 @@ import org.eclipse.jpt.common.utility.transformer.Transformer;
* </ul>
*/
public final class NonNullBooleanTransformer
- implements Transformer<Boolean, Boolean>
+ implements Transformer<Boolean, Boolean>, Serializable
{
// not null
private final Boolean nullValue;
@@ -47,7 +48,7 @@ public final class NonNullBooleanTransformer
* value is <code>null</code>. Throw a {@link NullPointerException} if the
* specified value is <code>null</code>.
*/
- public Transformer<Boolean, Boolean> valueOf(Boolean b) {
+ public static Transformer<Boolean, Boolean> valueOf(Boolean b) {
return valueOf(b.booleanValue());
}
@@ -55,7 +56,7 @@ public final class NonNullBooleanTransformer
* Return a transformer that will return the {@link Boolean} corresponding
* to the specified value if the original value is <code>null</code>.
*/
- public Transformer<Boolean, Boolean> valueOf(boolean b) {
+ public static Transformer<Boolean, Boolean> valueOf(boolean b) {
return b ? TRUE : FALSE;
}
@@ -79,4 +80,9 @@ public final class NonNullBooleanTransformer
return ObjectTools.toString(this, this.nullValue);
}
+ private static final long serialVersionUID = 1L;
+ private Object readResolve() {
+ // replace this object with the appropriate constant
+ return valueOf(this.nullValue);
+ }
}
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/NonNullStaticTransformer.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/NonNullStaticTransformer.java
new file mode 100644
index 0000000000..6c8941f9b9
--- /dev/null
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/NonNullStaticTransformer.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Oracle. All rights reserved.
+ * 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.common.utility.internal.transformer;
+
+import org.eclipse.jpt.common.utility.internal.ObjectTools;
+import org.eclipse.jpt.common.utility.transformer.Transformer;
+
+/**
+ * Transform any object into a single client-specified
+ * non-<code>null</code> object.
+ *
+ * @param <T1> the type of the object passed to the transformer
+ * @param <T2> the type of the object returned by the transformer
+ */
+public class NonNullStaticTransformer<T1, T2>
+ implements Transformer<T1, T2>
+{
+ private final T2 object;
+
+ public NonNullStaticTransformer(T2 object) {
+ super();
+ if (object == null) {
+ throw new NullPointerException();
+ }
+ this.object = object;
+ }
+
+ public T2 transform(T1 o) {
+ return this.object;
+ }
+
+ @Override
+ public String toString() {
+ return ObjectTools.toString(this, this.object);
+ }
+}
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/NonNullStringObjectTransformer.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/NonNullStringObjectTransformer.java
new file mode 100644
index 0000000000..53cd1de021
--- /dev/null
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/NonNullStringObjectTransformer.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Oracle. All rights reserved.
+ * 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.common.utility.internal.transformer;
+
+import java.io.Serializable;
+import org.eclipse.jpt.common.utility.internal.ObjectTools;
+import org.eclipse.jpt.common.utility.transformer.Transformer;
+
+/**
+ * Transform an object into the string returned by its {@link Object#toString()}
+ * method. A <code>null</code> object is transformed into a client-configured
+ * non-<code>null</code> string (<code>"null"</code> by default).
+ *
+ * @param <T> the type of the object passed to the transformer
+ */
+public class NonNullStringObjectTransformer<T>
+ implements Transformer<T, String>, Serializable
+{
+ // not null
+ private String nullString;
+
+ private static final long serialVersionUID = 1L;
+
+ public NonNullStringObjectTransformer() {
+ this(String.valueOf((Object) null));
+ }
+
+ public NonNullStringObjectTransformer(String nullString) {
+ super();
+ if (nullString == null) {
+ throw new NullPointerException();
+ }
+ this.nullString = nullString;
+ }
+
+ public String transform(T o) {
+ return (o == null) ? this.nullString : o.toString();
+ }
+
+ @Override
+ public String toString() {
+ return ObjectTools.toString(this, this.nullString);
+ }
+}
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/NotBooleanTransformer.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/NotBooleanTransformer.java
index 2e68a130e3..50e64af16e 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/NotBooleanTransformer.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/NotBooleanTransformer.java
@@ -23,6 +23,8 @@ import org.eclipse.jpt.common.utility.transformer.Transformer;
* <li>If the original {@link Boolean} is <code>null</code>,
* the transformer will return <code>null</code>.
* </ul>
+ * Use a {@link NonNullBooleanTransformer} to specify a value for when a
+ * {@link Boolean} is <code>null</code>
*/
public class NotBooleanTransformer
implements Transformer<Boolean, Boolean>, Serializable
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/NotNullObjectTransformer.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/NotNullObjectTransformer.java
new file mode 100644
index 0000000000..a43eeaf8ed
--- /dev/null
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/NotNullObjectTransformer.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Oracle. All rights reserved.
+ * 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.common.utility.internal.transformer;
+
+import java.io.Serializable;
+import org.eclipse.jpt.common.utility.transformer.Transformer;
+
+/**
+ * A {@link NotNullObjectTransformer} will transform an object to a
+ * {@link Boolean}:<ul>
+ * <li>If the object is <code>null</code>,
+ * the transformer will return {@link Boolean#FALSE}.
+ * <li>If the object is <em>not</em> <code>null</code>,
+ * the transformer will return {@link Boolean#TRUE}.
+ * </ul>
+ *
+ * @param <T> the type of the object passed to the transformer
+ */
+public class NotNullObjectTransformer<T>
+ implements Transformer<T, Boolean>, Serializable
+{
+ @SuppressWarnings("rawtypes")
+ public static final Transformer INSTANCE = new NotNullObjectTransformer();
+
+ @SuppressWarnings("unchecked")
+ public static <S> Transformer<S, Boolean> instance() {
+ return INSTANCE;
+ }
+
+ // ensure single instance
+ private NotNullObjectTransformer() {
+ super();
+ }
+
+ public Boolean transform(T o) {
+ return Boolean.valueOf(o != null);
+ }
+
+ @Override
+ public String toString() {
+ return this.getClass().getSimpleName();
+ }
+
+ private static final long serialVersionUID = 1L;
+ private Object readResolve() {
+ // replace this object with the singleton
+ return INSTANCE;
+ }
+}
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/NullObjectTransformer.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/NullObjectTransformer.java
new file mode 100644
index 0000000000..27e107802b
--- /dev/null
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/NullObjectTransformer.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Oracle. All rights reserved.
+ * 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.common.utility.internal.transformer;
+
+import java.io.Serializable;
+import org.eclipse.jpt.common.utility.transformer.Transformer;
+
+/**
+ * A {@link NullObjectTransformer} will transform an object to a
+ * {@link Boolean}:<ul>
+ * <li>If the object is <code>null</code>,
+ * the transformer will return {@link Boolean#TRUE}.
+ * <li>If the object is <em>not</em> <code>null</code>,
+ * the transformer will return {@link Boolean#FALSE}.
+ * </ul>
+ *
+ * @param <T> the type of the object passed to the transformer
+ */
+public class NullObjectTransformer<T>
+ implements Transformer<T, Boolean>, Serializable
+{
+ @SuppressWarnings("rawtypes")
+ public static final Transformer INSTANCE = new NullObjectTransformer();
+
+ @SuppressWarnings("unchecked")
+ public static <S> Transformer<S, Boolean> instance() {
+ return INSTANCE;
+ }
+
+ // ensure single instance
+ private NullObjectTransformer() {
+ super();
+ }
+
+ public Boolean transform(T o) {
+ return Boolean.valueOf(o == null);
+ }
+
+ @Override
+ public String toString() {
+ return this.getClass().getSimpleName();
+ }
+
+ private static final long serialVersionUID = 1L;
+ private Object readResolve() {
+ // replace this object with the singleton
+ return INSTANCE;
+ }
+}
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/StaticTransformer.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/StaticTransformer.java
new file mode 100644
index 0000000000..4f248a0f51
--- /dev/null
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/transformer/StaticTransformer.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Oracle. All rights reserved.
+ * 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.common.utility.internal.transformer;
+
+/**
+ * Transform any object, except <code>null</code>, into a single
+ * client-specified object. Any <code>null</code> object will be
+ * transformed into <code>null</code>.
+ *
+ * @param <T1> the type of the object passed to the transformer
+ * @param <T2> the type of the object returned by the transformer
+ */
+public class StaticTransformer<T1, T2>
+ extends AbstractTransformer<T1, T2>
+{
+ private final T2 object;
+
+ public StaticTransformer() {
+ this(null);
+ }
+
+ public StaticTransformer(T2 object) {
+ super();
+ this.object = object;
+ }
+
+ @Override
+ protected T2 transform_(T1 o) {
+ return this.object;
+ }
+}
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/transformer/Transformer.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/transformer/Transformer.java
index 0a0706ec06..834fc2c810 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/transformer/Transformer.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/transformer/Transformer.java
@@ -37,20 +37,20 @@ public interface Transformer<T1, T2> {
/**
- * A "null" transformer will perform no transformation at all;
+ * A "non" transformer will perform no transformation at all;
* it will simply return the object "untransformed".
*/
- final class Null<S>
+ final class Non<S>
implements Transformer<S, S>, Serializable
{
@SuppressWarnings("rawtypes")
- public static final Transformer INSTANCE = new Null();
+ public static final Transformer INSTANCE = new Non();
@SuppressWarnings("unchecked")
public static <R> Transformer<R, R> instance() {
return INSTANCE;
}
// ensure single instance
- private Null() {
+ private Non() {
super();
}
// simply return the object, unchanged
@@ -69,6 +69,37 @@ public interface Transformer<T1, T2> {
}
/**
+ * A "null" transformer will always return <code>null</code>.
+ */
+ final class Null<S1, S2>
+ implements Transformer<S1, S2>, Serializable
+ {
+ @SuppressWarnings("rawtypes")
+ public static final Transformer INSTANCE = new Null();
+ @SuppressWarnings("unchecked")
+ public static <R1, R2> Transformer<R1, R2> instance() {
+ return INSTANCE;
+ }
+ // ensure single instance
+ private Null() {
+ super();
+ }
+ // simply return null
+ public S2 transform(S1 o) {
+ return null;
+ }
+ @Override
+ public String toString() {
+ return ObjectTools.singletonToString(this);
+ }
+ private static final long serialVersionUID = 1L;
+ private Object readResolve() {
+ // replace this object with the singleton
+ return INSTANCE;
+ }
+ }
+
+ /**
* A "disabled" transformer will throw an exception if
* {@link #transform(Object)} is called. This is useful in situations
* where a transformer is optional and the default transformer should
diff --git a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/ImageDescriptorTest.java b/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/ImageDescriptorTest.java
new file mode 100644
index 0000000000..7cb3388f5d
--- /dev/null
+++ b/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/ImageDescriptorTest.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Oracle. All rights reserved.
+ * 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.common.ui.tests;
+
+import java.lang.reflect.Field;
+import junit.framework.TestCase;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.resource.LocalResourceManager;
+import org.eclipse.jface.resource.ResourceManager;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * This test case will verify that a class's constants
+ * <p>
+ * Construct the test case with the class that defines the image descriptors.
+ */
+@SuppressWarnings("nls")
+public class ImageDescriptorTest
+ extends TestCase
+{
+ private final Class<?> clazz;
+
+
+ public ImageDescriptorTest(Class<?> clazz) {
+ super(buildName(clazz));
+ this.clazz = clazz;
+ }
+
+ private static String buildName(Class<?> clazz) {
+ return ImageDescriptorTest.class.getSimpleName() + ": " + clazz.getName();
+ }
+
+ @Override
+ protected void runTest() throws Throwable {
+ ResourceManager resourceManager = this.buildResourceManager();
+ try {
+ this.runTest(resourceManager);
+ } finally {
+ resourceManager.dispose();
+ }
+ }
+
+ protected void runTest(ResourceManager resourceManager) throws Throwable {
+ for (Field field : this.clazz.getFields()) {
+ Object value = field.get(null);
+ if (value instanceof ImageDescriptor) {
+ ImageDescriptor descriptor = (ImageDescriptor) value;
+ try {
+ Image image = resourceManager.createImage(descriptor);
+ assertNotNull(image);
+ } catch (RuntimeException ex) {
+ fail("Problem loading image for ImageDescriptor defined in static field '"
+ + this.clazz.getSimpleName() + '.' + field.getName() + "': " + descriptor + " - " + ex);
+ }
+ } else {
+ // ignore non-image descriptors (e.g. strings);
+ // fields should probably not be null...
+ if (value == null) {
+ fail("The static field '"
+ + this.clazz.getSimpleName() + '.' + field.getName() + "' is null.");
+ }
+ }
+ }
+ }
+
+ protected ResourceManager buildResourceManager() {
+ return new LocalResourceManager(this.getParentResourceManager());
+ }
+
+ private ResourceManager getParentResourceManager() {
+ return JFaceResources.getResources();
+ }
+}
diff --git a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/JptCommonUiTests.java b/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/JptCommonUiTests.java
index 0deaf5b069..c1d1fcb33c 100644
--- a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/JptCommonUiTests.java
+++ b/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/JptCommonUiTests.java
@@ -12,6 +12,7 @@ package org.eclipse.jpt.common.ui.tests;
import junit.framework.Test;
import junit.framework.TestSuite;
import org.eclipse.jpt.common.core.tests.BundleActivatorTest;
+import org.eclipse.jpt.common.ui.JptCommonUiImages;
import org.eclipse.jpt.common.ui.WidgetFactory;
import org.eclipse.jpt.common.ui.tests.internal.swt.JptUiSWTTests;
import org.eclipse.jpt.common.ui.tests.internal.util.JptUiUtilTests;
@@ -23,6 +24,7 @@ public class JptCommonUiTests {
suite.addTest(JptUiSWTTests.suite());
suite.addTest(JptUiUtilTests.suite());
suite.addTest(new BundleActivatorTest(WidgetFactory.class));
+ suite.addTest(new ImageDescriptorTest(JptCommonUiImages.class));
return suite;
}
diff --git a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/jface/DelegatingLabelProviderUiTest.java b/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/jface/DelegatingLabelProviderUiTest.java
index f068c3024d..d04a2e05ad 100644
--- a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/jface/DelegatingLabelProviderUiTest.java
+++ b/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/jface/DelegatingLabelProviderUiTest.java
@@ -12,6 +12,8 @@ package org.eclipse.jpt.common.ui.tests.internal.jface;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.BaseLabelProvider;
import org.eclipse.jface.viewers.ComboViewer;
@@ -28,7 +30,6 @@ import org.eclipse.jpt.common.ui.internal.jface.ItemTreeStateProviderManager;
import org.eclipse.jpt.common.ui.internal.jface.StaticItemTreeContentProvider;
import org.eclipse.jpt.common.ui.jface.ItemExtendedLabelProvider;
import org.eclipse.jpt.common.ui.jface.ItemExtendedLabelProviderFactory;
-import org.eclipse.jpt.common.ui.jface.ItemLabelProvider;
import org.eclipse.jpt.common.ui.jface.ItemTreeContentProvider;
import org.eclipse.jpt.common.ui.jface.ItemTreeContentProviderFactory;
import org.eclipse.jpt.common.ui.jface.TreeStateProvider;
@@ -37,8 +38,8 @@ import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter
import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
+import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
@@ -56,28 +57,29 @@ import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
@SuppressWarnings("nls")
-public class DelegatingLabelProviderUiTest extends ApplicationWindow
+public class DelegatingLabelProviderUiTest
+ extends ApplicationWindow
{
private TreeViewer tree;
-
- private ModifiablePropertyValueModel<Vehicle> selectedVehicle;
-
-
+
+ /* CU private */ ModifiablePropertyValueModel<Vehicle> selectedVehicleModel = new SimplePropertyValueModel<Vehicle>();
+
+
public static void main(String[] args) {
- Window window = new DelegatingLabelProviderUiTest(args);
+ Window window = new DelegatingLabelProviderUiTest();
window.setBlockOnOpen(true);
window.open();
+
Display.getCurrent().dispose();
System.exit(0);
}
-
-
- private DelegatingLabelProviderUiTest(String[] args) {
+
+
+ private DelegatingLabelProviderUiTest() {
super(null);
- this.selectedVehicle = new SimplePropertyValueModel<Vehicle>();
}
-
-
+
+
@Override
protected Control createContents(Composite parent) {
((Shell) parent).setText(this.getClass().getSimpleName());
@@ -86,56 +88,57 @@ public class DelegatingLabelProviderUiTest extends ApplicationWindow
Composite mainPanel = new Composite(parent, SWT.NONE);
mainPanel.setLayoutData(new GridData(GridData.FILL_BOTH));
mainPanel.setLayout(new GridLayout());
- buildTreePanel(mainPanel);
- buildControlPanel(mainPanel);
+ this.buildTreePanel(mainPanel);
+ this.buildControlPanel(mainPanel);
return mainPanel;
}
-
+
private void buildTreePanel(Composite parent) {
Composite panel = new Composite(parent, SWT.NONE);
panel.setLayoutData(new GridData(GridData.FILL_BOTH));
panel.setLayout(new GridLayout());
-
+
Label label = new Label(panel, SWT.NONE);
label.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false));
label.setText("My Vehicles");
-
- tree = new TreeViewer(panel, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
- tree.getTree().setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
- TreeStateProvider contentAndLabelProvider =
+
+ this.tree = new TreeViewer(panel, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
+ this.tree.getTree().setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
+ TreeStateProvider contentAndLabelProvider =
new ItemTreeStateProviderManager(
new VehicleContentProviderFactory(),
- new VehicleLabelProviderFactory());
- tree.setContentProvider(contentAndLabelProvider);
- tree.setLabelProvider(contentAndLabelProvider);
- tree.setInput(new Root());
- tree.addSelectionChangedListener(buildTreeSelectionChangedListener());
+ new VehicleLabelProviderFactory(),
+ JFaceResources.getResources());
+ this.tree.setContentProvider(contentAndLabelProvider);
+ this.tree.setLabelProvider(contentAndLabelProvider);
+ this.tree.setInput(new Root());
+ this.tree.addSelectionChangedListener(this.buildTreeSelectionChangedListener());
}
-
+
private ISelectionChangedListener buildTreeSelectionChangedListener() {
return new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
- selectedVehicle.setValue((Vehicle) ((IStructuredSelection) event.getSelection()).getFirstElement());
+ DelegatingLabelProviderUiTest.this.selectedVehicleModel.setValue((Vehicle) ((IStructuredSelection) event.getSelection()).getFirstElement());
}
};
}
-
+
private void buildControlPanel(Composite parent) {
Composite panel = new Composite(parent, SWT.NONE);
panel.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
panel.setLayout(new GridLayout());
- buildUpperControlPanel(panel);
- buildLowerControlPanel(panel);
+ this.buildUpperControlPanel(panel);
+ this.buildLowerControlPanel(panel);
}
-
+
private void buildUpperControlPanel(Composite parent) {
Composite panel = new Composite(parent, SWT.NONE);
panel.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
panel.setLayout(new GridLayout(2, true));
- buildVehicleCombo(panel);
- buildColorCombo(panel);
+ this.buildVehicleCombo(panel);
+ this.buildColorCombo(panel);
}
-
+
private void buildVehicleCombo(Composite parent) {
final ComboViewer combo = new ComboViewer(parent, SWT.READ_ONLY);
combo.getCombo().setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
@@ -143,89 +146,89 @@ public class DelegatingLabelProviderUiTest extends ApplicationWindow
combo.setLabelProvider(new VehicleTypeLabelProvider());
combo.setInput(
new VehicleType[] {
- VehicleType.BICYCLE, VehicleType.CAR,
+ VehicleType.BICYCLE, VehicleType.CAR,
VehicleType.TRUCK, VehicleType.BOAT
});
combo.getCombo().setEnabled(false);
combo.addSelectionChangedListener(
new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
- selectedVehicle().setVehicleType((VehicleType) ((StructuredSelection) event.getSelection()).getFirstElement());
+ DelegatingLabelProviderUiTest.this.getSelectedVehicle().setVehicleType((VehicleType) ((StructuredSelection) event.getSelection()).getFirstElement());
}
});
- selectedVehicle.addPropertyChangeListener(
- PropertyValueModel.VALUE,
+ this.selectedVehicleModel.addPropertyChangeListener(
+ PropertyValueModel.VALUE,
new PropertyChangeListener() {
public void propertyChanged(PropertyChangeEvent event) {
- Vehicle vehicle = selectedVehicle();
+ Vehicle vehicle = DelegatingLabelProviderUiTest.this.getSelectedVehicle();
combo.getCombo().setEnabled(vehicle != null);
- combo.setSelection(new StructuredSelection((vehicle == null) ? null : vehicle.vehicleType()));
+ combo.setSelection(new StructuredSelection((vehicle == null) ? null : vehicle.getVehicleType()));
}
});
}
-
+
private void buildColorCombo(Composite parent) {
final ComboViewer combo = new ComboViewer(parent, SWT.READ_ONLY);
combo.getCombo().setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
combo.setContentProvider(new ArrayContentProvider());
combo.setLabelProvider(new ColorLabelProvider());
- combo.setInput(new Color[] {Color.RED, Color.BLUE, Color.YELLOW, Color.GREEN});
+ combo.setInput(new VehicleColor[] {VehicleColor.RED, VehicleColor.BLUE, VehicleColor.YELLOW, VehicleColor.GREEN});
combo.addSelectionChangedListener(
new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
- selectedVehicle().setColor((Color) ((StructuredSelection) event.getSelection()).getFirstElement());
+ DelegatingLabelProviderUiTest.this.getSelectedVehicle().setColor((VehicleColor) ((StructuredSelection) event.getSelection()).getFirstElement());
}
});
- selectedVehicle.addPropertyChangeListener(
- PropertyValueModel.VALUE,
+ this.selectedVehicleModel.addPropertyChangeListener(
+ PropertyValueModel.VALUE,
new PropertyChangeListener() {
public void propertyChanged(PropertyChangeEvent event) {
- Vehicle vehicle = selectedVehicle();
+ Vehicle vehicle = DelegatingLabelProviderUiTest.this.getSelectedVehicle();
combo.getCombo().setEnabled(vehicle != null);
- combo.setSelection(new StructuredSelection((vehicle == null) ? null : vehicle.color()));
+ combo.setSelection(new StructuredSelection((vehicle == null) ? null : vehicle.getColor()));
}
});
}
-
+
private void buildLowerControlPanel(Composite parent) {
Composite panel = new Composite(parent, SWT.NONE);
panel.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
panel.setLayout(new GridLayout(3, false));
- buildEffectsLabel(panel);
- buildGreyedCheckBox(panel);
- buildTranslucentCheckBox(panel);
- buildActionPanel(panel);
+ this.buildEffectsLabel(panel);
+ this.buildGrayedCheckBox(panel);
+ this.buildTranslucentCheckBox(panel);
+ this.buildActionPanel(panel);
}
-
+
private void buildEffectsLabel(Composite parent) {
Label label = new Label(parent, SWT.LEFT);
label.setText("Color effects: ");
label.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 3, 1));
}
-
- private void buildGreyedCheckBox(Composite parent) {
+
+ private void buildGrayedCheckBox(Composite parent) {
final Button button = new Button(parent, SWT.CHECK);
button.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false));
- button.setText("greyed");
+ button.setText("grayed");
button.setEnabled(false);
button.addSelectionListener(
new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
- selectedVehicle().setGreyed(button.getSelection());
+ DelegatingLabelProviderUiTest.this.getSelectedVehicle().setGrayed(button.getSelection());
}
});
- selectedVehicle.addPropertyChangeListener(
- PropertyValueModel.VALUE,
+ this.selectedVehicleModel.addPropertyChangeListener(
+ PropertyValueModel.VALUE,
new PropertyChangeListener() {
public void propertyChanged(PropertyChangeEvent event) {
- Vehicle vehicle = selectedVehicle();
+ Vehicle vehicle = DelegatingLabelProviderUiTest.this.getSelectedVehicle();
button.setEnabled(vehicle != null);
- button.setSelection(vehicle != null && vehicle.isGreyed());
+ button.setSelection((vehicle != null) && vehicle.isGrayed());
}
});
}
-
+
private void buildTranslucentCheckBox(Composite parent) {
final Button button = new Button(parent, SWT.CHECK);
button.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, true, false));
@@ -235,74 +238,76 @@ public class DelegatingLabelProviderUiTest extends ApplicationWindow
new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
- selectedVehicle().setTranslucent(button.getSelection());
+ DelegatingLabelProviderUiTest.this.getSelectedVehicle().setTranslucent(button.getSelection());
}
});
- selectedVehicle.addPropertyChangeListener(
- PropertyValueModel.VALUE,
+ this.selectedVehicleModel.addPropertyChangeListener(
+ PropertyValueModel.VALUE,
new PropertyChangeListener() {
public void propertyChanged(PropertyChangeEvent event) {
- Vehicle vehicle = selectedVehicle();
+ Vehicle vehicle = DelegatingLabelProviderUiTest.this.getSelectedVehicle();
button.setEnabled(vehicle != null);
- button.setSelection(vehicle != null && vehicle.isTranslucent());
+ button.setSelection((vehicle != null) && vehicle.isTranslucent());
}
});
}
-
+
private void buildActionPanel(Composite parent) {
Composite panel = new Composite(parent, SWT.NONE);
panel.setLayoutData(new GridData(GridData.END, GridData.FILL, false, false));
panel.setLayout(new GridLayout());
- buildRefreshTreeACI().fill(panel);
+ this.buildRefreshTreeACI().fill(panel);
}
-
+
private ActionContributionItem buildRefreshTreeACI() {
Action action = new Action("Refresh tree", IAction.AS_PUSH_BUTTON) {
@Override
public void run() {
- refreshTree();
+ DelegatingLabelProviderUiTest.this.refreshTree();
}
};
action.setToolTipText("Refresh the tree's labels");
return new ActionContributionItem(action);
}
-
+
void refreshTree() {
- tree.refresh();
+ this.tree.refresh();
}
-
- private Vehicle selectedVehicle() {
- return selectedVehicle.getValue();
+
+ Vehicle getSelectedVehicle() {
+ return this.selectedVehicleModel.getValue();
}
-
-
- private static class VehicleTypeLabelProvider extends BaseLabelProvider
+
+
+ /* CU private */ static class VehicleTypeLabelProvider
+ extends BaseLabelProvider
implements ILabelProvider
{
public Image getImage(Object element) {
return null;
}
-
+
public String getText(Object element) {
- return ((VehicleType) element).description();
+ return ((VehicleType) element).getDescription();
}
}
-
-
- private static class ColorLabelProvider extends BaseLabelProvider
+
+
+ /* CU private */ static class ColorLabelProvider
+ extends BaseLabelProvider
implements ILabelProvider
{
public Image getImage(Object element) {
return null;
}
-
+
public String getText(Object element) {
- return ((Color) element).description();
+ return ((VehicleColor) element).getDescription();
}
}
-
-
- private static class VehicleContentProviderFactory
+
+
+ /* CU private */ static class VehicleContentProviderFactory
implements ItemTreeContentProviderFactory
{
public ItemTreeContentProvider buildProvider(Object item, ItemTreeContentProvider.Manager manager) {
@@ -312,52 +317,52 @@ public class DelegatingLabelProviderUiTest extends ApplicationWindow
return this.buildVehicleProvider((Vehicle) item);
}
protected ItemTreeContentProvider buildRootProvider(Root item) {
- return new StaticItemTreeContentProvider(null, item.vehicles());
+ return new StaticItemTreeContentProvider(null, item.getVehicles());
}
protected ItemTreeContentProvider buildVehicleProvider(Vehicle item) {
return new StaticItemTreeContentProvider(item.parent());
}
}
-
-
- private static class VehicleLabelProviderFactory
+
+
+ /* CU private */ static class VehicleLabelProviderFactory
implements ItemExtendedLabelProviderFactory
{
public ItemExtendedLabelProvider buildProvider(Object item, ItemExtendedLabelProvider.Manager manager) {
return new VehicleLabelProvider((Vehicle) item, manager);
}
}
-
-
- private static class VehicleLabelProvider
+
+
+ /* CU private */ static class VehicleLabelProvider
extends AbstractItemExtendedLabelProvider<Vehicle>
{
- public VehicleLabelProvider(Vehicle vehicle, ItemLabelProvider.Manager manager) {
+ public VehicleLabelProvider(Vehicle vehicle, ItemExtendedLabelProvider.Manager manager) {
super(vehicle, manager);
}
-
+
@Override
- protected PropertyValueModel<Image> buildImageModel() {
- return new PropertyAspectAdapter<Vehicle, Image>(IMAGE_ASPECT_NAMES, this.item) {
+ protected PropertyValueModel<ImageDescriptor> buildImageDescriptorModel() {
+ return new PropertyAspectAdapter<Vehicle, ImageDescriptor>(IMAGE_ASPECT_NAMES, this.item) {
@Override
- protected Image buildValue_() {
- return subject.image();
+ protected ImageDescriptor buildValue_() {
+ return this.subject.getImageDescriptor();
}
};
}
private static final String[] IMAGE_ASPECT_NAMES =
new String[] {
Vehicle.COLOR_PROPERTY,
- Vehicle.GREYED_PROPERTY,
+ Vehicle.GRAYED_PROPERTY,
Vehicle.TRANSLUCENT_PROPERTY
};
-
+
@Override
protected PropertyValueModel<String> buildTextModel() {
return new PropertyAspectAdapter<Vehicle, String>(TEXT_ASPECT_NAMES, this.item) {
@Override
protected String buildValue_() {
- return subject.color().description() + ' ' + subject.vehicleType().description();
+ return this.subject.getColor().getDescription() + ' ' + this.subject.getVehicleType().getDescription();
}
};
}
@@ -366,201 +371,198 @@ public class DelegatingLabelProviderUiTest extends ApplicationWindow
Vehicle.VEHICLE_TYPE_PROPERTY,
Vehicle.COLOR_PROPERTY
};
-
+
@Override
protected PropertyValueModel<String> buildDescriptionModel() {
- return buildTextModel();
+ return this.buildTextModel();
}
}
-
-
- private static abstract class TreeNode extends AbstractModel
+
+
+ private static abstract class TreeNode
+ extends AbstractModel
{
private TreeNode parent;
-
-
+
public TreeNode(TreeNode parent) {
this.parent = parent;
}
-
-
+
public TreeNode parent() {
- return parent;
+ return this.parent;
}
}
-
-
- private static class Root extends TreeNode
+
+
+ private static class Root
+ extends TreeNode
{
protected final Vehicle[] vehicles;
-
-
+
public Root() {
super(null);
- vehicles = new Vehicle[] {
- new Vehicle(this, VehicleType.BICYCLE, Color.BLUE),
- new Vehicle(this, VehicleType.CAR, Color.YELLOW),
- new Vehicle(this, VehicleType.TRUCK, Color.RED),
- new Vehicle(this, VehicleType.BOAT, Color.GREEN)};
+ this.vehicles = this.buildVehicles();
+ }
+
+ private Vehicle[] buildVehicles() {
+ return new Vehicle[] {
+ new Vehicle(this, VehicleType.BICYCLE, VehicleColor.BLUE),
+ new Vehicle(this, VehicleType.CAR, VehicleColor.YELLOW),
+ new Vehicle(this, VehicleType.TRUCK, VehicleColor.RED),
+ new Vehicle(this, VehicleType.BOAT, VehicleColor.GREEN)
+ };
}
-
- public Vehicle[] vehicles() {
- return vehicles;
+
+ public Vehicle[] getVehicles() {
+ return this.vehicles;
}
}
-
-
- private static class Vehicle extends TreeNode
+
+
+ /* CU private */ static class Vehicle
+ extends TreeNode
{
private VehicleType vehicleType;
public final static String VEHICLE_TYPE_PROPERTY = "vehicleType";
-
- private Color color;
+
+ private VehicleColor color;
public final static String COLOR_PROPERTY = "color";
-
- private boolean greyed = false;
- public final static String GREYED_PROPERTY = "greyed";
-
+
+ private boolean grayed = false;
+ public final static String GRAYED_PROPERTY = "grayed";
+
private boolean translucent = false;
public final static String TRANSLUCENT_PROPERTY = "translucent";
-
- private Image image;
-
-
- public Vehicle(TreeNode parent, VehicleType vehicleType, Color color) {
+
+
+ Vehicle(TreeNode parent, VehicleType vehicleType, VehicleColor color) {
super(parent);
this.vehicleType = vehicleType;
this.color = color;
}
-
- public VehicleType vehicleType() {
- return vehicleType;
- }
-
- public void setVehicleType(VehicleType newVehicleType) {
- VehicleType oldVehicleType = vehicleType;
- vehicleType = newVehicleType;
- firePropertyChanged(VEHICLE_TYPE_PROPERTY, oldVehicleType, newVehicleType);
- }
-
- public Color color() {
- return color;
- }
-
- public void setColor(Color newColor) {
- Color oldColor = color;
- color = newColor;
- firePropertyChanged(COLOR_PROPERTY, oldColor, newColor);
- }
-
- public boolean isGreyed() {
- return greyed;
- }
-
- public void setGreyed(boolean newGreyed) {
- boolean oldGreyed = greyed;
- greyed = newGreyed;
- firePropertyChanged(GREYED_PROPERTY, oldGreyed, newGreyed);
- }
-
+
+ public VehicleType getVehicleType() {
+ return this.vehicleType;
+ }
+
+ public void setVehicleType(VehicleType vehicleType) {
+ VehicleType old = this.vehicleType;
+ this.vehicleType = vehicleType;
+ this.firePropertyChanged(VEHICLE_TYPE_PROPERTY, old, vehicleType);
+ }
+
+ public VehicleColor getColor() {
+ return this.color;
+ }
+
+ public void setColor(VehicleColor color) {
+ VehicleColor old = this.color;
+ this.color = color;
+ this.firePropertyChanged(COLOR_PROPERTY, old, color);
+ }
+
+ public boolean isGrayed() {
+ return this.grayed;
+ }
+
+ public void setGrayed(boolean grayed) {
+ boolean old = this.grayed;
+ this.grayed = grayed;
+ this.firePropertyChanged(GRAYED_PROPERTY, old, grayed);
+ }
+
public boolean isTranslucent() {
- return translucent;
- }
-
- public void setTranslucent(boolean newTranslucent) {
- boolean oldTranslucent = translucent;
- translucent = newTranslucent;
- firePropertyChanged(TRANSLUCENT_PROPERTY, oldTranslucent, newTranslucent);
- }
-
- public Image image() {
- if (image != null) {
- image.dispose();
- }
-
- return ImageFactory.image(color(), greyed, translucent);
+ return this.translucent;
+ }
+
+ public void setTranslucent(boolean translucent) {
+ boolean old = this.translucent;
+ this.translucent = translucent;
+ this.firePropertyChanged(TRANSLUCENT_PROPERTY, old, translucent);
+ }
+
+ public ImageDescriptor getImageDescriptor() {
+ return VehicleImageDescriptorFactory.buildImageDescriptor(this.color, this.grayed, this.translucent);
}
}
-
-
- private static enum VehicleType
- {
+
+
+ /* CU private */ static enum VehicleType {
BICYCLE("bicycle"),
CAR("car"),
TRUCK("truck"),
BOAT("boat");
-
+
private final String description;
-
+
private VehicleType(String description) {
this.description = description;
}
-
- public String description() {
- return description;
+
+ public String getDescription() {
+ return this.description;
}
-
+
@Override
public String toString() {
- return description();
+ return this.description;
}
}
-
-
- private static enum Color
- {
+
+
+ /* CU private */ static enum VehicleColor {
RED("red", new RGB(255, 0, 0)),
BLUE("blue", new RGB(0, 0, 255)),
YELLOW("yellow", new RGB(255, 255, 0)),
GREEN("green", new RGB(0, 255, 0));
-
+
private final String description;
-
+
private final RGB rgb;
-
- private Color(String description, RGB rgb) {
+
+ private VehicleColor(String description, RGB rgb) {
this.description = description;
this.rgb = rgb;
}
-
- public String description() {
- return description;
+
+ public String getDescription() {
+ return this.description;
}
-
+
public RGB rgb() {
- return rgb;
+ return this.rgb;
}
-
+
@Override
public String toString() {
- return description();
+ return this.description;
}
}
-
-
- private static class ImageFactory
- {
- private static RGB rgb(Color color, boolean greyed, boolean translucent) {
- RGB rgb = (greyed) ? new RGB(127, 127, 127) : color.rgb();
+
+
+ /* CU private */ static class VehicleImageDescriptorFactory {
+ static ImageDescriptor buildImageDescriptor(VehicleColor color, boolean grayed, boolean translucent) {
+ PaletteData pd = new PaletteData(new RGB[] { buildRGB(color, grayed, translucent) });
+ ImageData imageData = new ImageData(20, 20, 1, pd);
+ for (int x = 0; x < 20; x ++) {
+ for (int y = 0; y < 20; y ++) {
+ imageData.setPixel(x, y, 0);
+ }
+ }
+ return ImageDescriptor.createFromImageData(imageData);
+ }
+
+ private static RGB buildRGB(VehicleColor color, boolean grayed, boolean translucent) {
+ RGB rgb = (grayed) ? GRAY : color.rgb();
if (translucent) {
rgb = new RGB(translucify(rgb.red), translucify(rgb.green), translucify(rgb.blue));
}
return rgb;
}
-
- private static int translucify(int color) {
- return 255 - (int) ((255 - color) * 0.3);
- }
-
- public static Image image(Color color, boolean greyed, boolean translucent) {
- PaletteData pd = new PaletteData(new RGB[] {rgb(color, greyed, translucent)});
- ImageData id = new ImageData(20, 20, 1, pd);
- for (int x = 0; x < 20; x ++) {
- for (int y = 0; y < 20; y ++) {
- id.setPixel(x, y, 0);
- }
- }
- return new Image(Display.getCurrent(), id);
+ private static final RGB GRAY = new RGB(127, 127, 127);
+
+ private static int translucify(int colorComponent) {
+ return 255 - (int) ((255 - colorComponent) * 0.3);
}
}
}
diff --git a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/jface/DelegatingTreeContentProviderUiTest.java b/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/jface/DelegatingTreeContentProviderUiTest.java
index 347ff9aff2..a5832fc4e8 100644
--- a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/jface/DelegatingTreeContentProviderUiTest.java
+++ b/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/jface/DelegatingTreeContentProviderUiTest.java
@@ -3,19 +3,17 @@
* 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.common.ui.tests.internal.jface;
import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.viewers.BaseLabelProvider;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ISelectionChangedListener;
@@ -31,10 +29,8 @@ import org.eclipse.jpt.common.ui.internal.jface.ItemTreeStateProviderManager;
import org.eclipse.jpt.common.ui.jface.ItemTreeContentProvider;
import org.eclipse.jpt.common.ui.jface.ItemTreeContentProviderFactory;
import org.eclipse.jpt.common.utility.internal.collection.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.filter.NotNullFilter;
-import org.eclipse.jpt.common.utility.internal.iterator.FilteringIterator;
-import org.eclipse.jpt.common.utility.internal.iterator.ReadOnlyListIterator;
-import org.eclipse.jpt.common.utility.internal.iterator.TransformationIterator;
+import org.eclipse.jpt.common.utility.internal.iterable.LiveCloneListIterable;
+import org.eclipse.jpt.common.utility.internal.iterable.TransformationIterable;
import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
import org.eclipse.jpt.common.utility.internal.model.value.CompositeCollectionValueModel;
import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
@@ -42,11 +38,13 @@ import org.eclipse.jpt.common.utility.internal.model.value.ListCollectionValueMo
import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
import org.eclipse.jpt.common.utility.internal.model.value.StaticCollectionValueModel;
import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
+import org.eclipse.jpt.common.utility.iterable.ListIterable;
import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
+import org.eclipse.jpt.common.utility.transformer.Transformer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
@@ -59,13 +57,14 @@ import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
@SuppressWarnings("nls")
-public class DelegatingTreeContentProviderUiTest extends ApplicationWindow
+public class DelegatingTreeContentProviderUiTest
+ extends ApplicationWindow
{
- private final Root root;
+ /* CU private */ final Root root;
- private ModifiablePropertyValueModel<TreeNode> selectedNode;
+ /* CU private */ ModifiablePropertyValueModel<TreeNode> selectedNodeModel;
- private TreeViewer controlTree;
+ /* CU private */ TreeViewer controlTree;
private TreeViewer viewTree;
@@ -73,18 +72,19 @@ public class DelegatingTreeContentProviderUiTest extends ApplicationWindow
public static void main(String[] args) {
- Window window = new DelegatingTreeContentProviderUiTest(args);
+ Window window = new DelegatingTreeContentProviderUiTest();
window.setBlockOnOpen(true);
window.open();
+
Display.getCurrent().dispose();
System.exit(0);
}
- private DelegatingTreeContentProviderUiTest(String[] args) {
+ private DelegatingTreeContentProviderUiTest() {
super(null);
this.root = new Root();
this.root.addChild("Parent_1");
- this.selectedNode = new SimplePropertyValueModel<TreeNode>(this.root);
+ this.selectedNodeModel = new SimplePropertyValueModel<TreeNode>(this.root);
}
@Override
@@ -95,8 +95,8 @@ public class DelegatingTreeContentProviderUiTest extends ApplicationWindow
Composite mainPanel = new Composite(parent, SWT.NONE);
mainPanel.setLayoutData(new GridData(GridData.FILL_BOTH));
mainPanel.setLayout(new GridLayout());
- buildTreePanel(mainPanel);
- buildControlPanel(mainPanel);
+ this.buildTreePanel(mainPanel);
+ this.buildControlPanel(mainPanel);
return mainPanel;
}
@@ -104,30 +104,30 @@ public class DelegatingTreeContentProviderUiTest extends ApplicationWindow
Composite panel = new Composite(parent, SWT.NONE);
panel.setLayoutData(new GridData(GridData.FILL_BOTH));
panel.setLayout(new GridLayout(2, true));
- buildControlTreePanel(panel);
- buildViewTreePanel(panel);
+ this.buildControlTreePanel(panel);
+ this.buildViewTreePanel(panel);
}
private void buildControlTreePanel(Composite parent) {
- controlTree = buildTreePanel(
+ this.controlTree = this.buildTreePanel(
parent, "Control tree",
- new ItemTreeStateProviderManager(new ControlTreeItemContentProviderFactory()),
+ new ItemTreeStateProviderManager(new ControlTreeItemContentProviderFactory(), JFaceResources.getResources()),
new LabelProvider());
- controlTree.addSelectionChangedListener(buildTreeSelectionChangedListener());
- selectedNode.addPropertyChangeListener(
+ this.controlTree.addSelectionChangedListener(this.buildTreeSelectionChangedListener());
+ this.selectedNodeModel.addPropertyChangeListener(
PropertyValueModel.VALUE,
new PropertyChangeListener() {
public void propertyChanged(PropertyChangeEvent event) {
- controlTree.setSelection(new StructuredSelection(event.getNewValue()));
+ DelegatingTreeContentProviderUiTest.this.controlTree.setSelection(new StructuredSelection(event.getNewValue()));
}
}
);
}
private void buildViewTreePanel(Composite parent) {
- viewTree = buildTreePanel(
+ this.viewTree = this.buildTreePanel(
parent, "View tree",
- new ItemTreeStateProviderManager(new ViewItemTreeContentProviderFactory()),
+ new ItemTreeStateProviderManager(new ViewItemTreeContentProviderFactory(), JFaceResources.getResources()),
new LabelProvider());
}
@@ -144,7 +144,7 @@ public class DelegatingTreeContentProviderUiTest extends ApplicationWindow
tree.getTree().setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
tree.setContentProvider(contentProvider);
tree.setLabelProvider(labelProvider);
- tree.setInput(root);
+ tree.setInput(this.root);
return tree;
}
@@ -153,7 +153,7 @@ public class DelegatingTreeContentProviderUiTest extends ApplicationWindow
return new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
TreeNode selection = (TreeNode) ((IStructuredSelection) event.getSelection()).getFirstElement();
- selectedNode.setValue((selection == null) ? root : selection);
+ DelegatingTreeContentProviderUiTest.this.selectedNodeModel.setValue((selection == null) ? DelegatingTreeContentProviderUiTest.this.root : selection);
}
};
}
@@ -162,28 +162,28 @@ public class DelegatingTreeContentProviderUiTest extends ApplicationWindow
Composite panel = new Composite(parent, SWT.NONE);
panel.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
panel.setLayout(new GridLayout(6, false));
- buildNodeNameText(panel);
- buildAddChildACI().fill(panel);
- buildAddNestedChildACI().fill(panel);
- buildRemoveACI().fill(panel);
- buildClearModelACI().fill(panel);
- buildRestoreModelACI().fill(panel);
+ this.buildNodeNameText(panel);
+ this.buildAddChildACI().fill(panel);
+ this.buildAddNestedChildACI().fill(panel);
+ this.buildRemoveACI().fill(panel);
+ this.buildClearModelACI().fill(panel);
+ this.buildRestoreModelACI().fill(panel);
}
private void buildNodeNameText(Composite parent) {
- nodeNameText = new Text(parent, SWT.SINGLE | SWT.BORDER);
- nodeNameText.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
+ this.nodeNameText = new Text(parent, SWT.SINGLE | SWT.BORDER);
+ this.nodeNameText.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
}
private ActionContributionItem buildAddChildACI() {
final Action action = new Action("Add child", IAction.AS_PUSH_BUTTON) {
@Override
public void run() {
- addChild();
+ DelegatingTreeContentProviderUiTest.this.addChild();
}
};
action.setToolTipText("Add a child with the given name");
- selectedNode.addPropertyChangeListener(
+ this.selectedNodeModel.addPropertyChangeListener(
PropertyValueModel.VALUE,
new PropertyChangeListener() {
public void propertyChanged(PropertyChangeEvent event) {
@@ -198,12 +198,12 @@ public class DelegatingTreeContentProviderUiTest extends ApplicationWindow
final Action action = new Action("Add nested child", IAction.AS_PUSH_BUTTON) {
@Override
public void run() {
- addNestedChild();
+ DelegatingTreeContentProviderUiTest.this.addNestedChild();
}
};
action.setToolTipText("Add a nested child with the given name");
action.setEnabled(false);
- selectedNode.addPropertyChangeListener(
+ this.selectedNodeModel.addPropertyChangeListener(
PropertyValueModel.VALUE,
new PropertyChangeListener() {
public void propertyChanged(PropertyChangeEvent event) {
@@ -218,16 +218,16 @@ public class DelegatingTreeContentProviderUiTest extends ApplicationWindow
final Action action = new Action("Remove", IAction.AS_PUSH_BUTTON) {
@Override
public void run() {
- remove();
+ DelegatingTreeContentProviderUiTest.this.remove();
}
};
action.setToolTipText("Remove the selected node");
action.setEnabled(false);
- selectedNode.addPropertyChangeListener(
+ this.selectedNodeModel.addPropertyChangeListener(
PropertyValueModel.VALUE,
new PropertyChangeListener() {
public void propertyChanged(PropertyChangeEvent event) {
- action.setEnabled(event.getNewValue() != root);
+ action.setEnabled(event.getNewValue() != DelegatingTreeContentProviderUiTest.this.root);
}
}
);
@@ -238,7 +238,7 @@ public class DelegatingTreeContentProviderUiTest extends ApplicationWindow
Action action = new Action("Clear model", IAction.AS_PUSH_BUTTON) {
@Override
public void run() {
- clearModel();
+ DelegatingTreeContentProviderUiTest.this.clearModel();
}
};
action.setToolTipText("Clear the model");
@@ -249,7 +249,7 @@ public class DelegatingTreeContentProviderUiTest extends ApplicationWindow
Action action = new Action("Restore model", IAction.AS_PUSH_BUTTON) {
@Override
public void run() {
- restoreModel();
+ DelegatingTreeContentProviderUiTest.this.restoreModel();
}
};
action.setToolTipText("Restore the model");
@@ -257,36 +257,36 @@ public class DelegatingTreeContentProviderUiTest extends ApplicationWindow
}
void addChild() {
- String nodeName = nodeNameText.getText();
+ String nodeName = this.nodeNameText.getText();
if (nodeName.length() != 0) {
- selectedNode.getValue().addChild(nodeName);
+ this.selectedNodeModel.getValue().addChild(nodeName);
}
}
void addNestedChild() {
- String nodeName = nodeNameText.getText();
+ String nodeName = this.nodeNameText.getText();
if (nodeName.length() != 0) {
- selectedNode.getValue().addNestedChild(nodeName);
+ this.selectedNodeModel.getValue().addNestedChild(nodeName);
}
}
void remove() {
- TreeNode node = selectedNode.getValue();
+ TreeNode node = this.selectedNodeModel.getValue();
node.parent().removeChild(node);
}
void clearModel() {
- controlTree.setInput(null);
- viewTree.setInput(null);
+ this.controlTree.setInput(null);
+ this.viewTree.setInput(null);
}
void restoreModel() {
- controlTree.setInput(root);
- viewTree.setInput(root);
+ this.controlTree.setInput(this.root);
+ this.viewTree.setInput(this.root);
}
- static abstract class AbstractTreeItemContentProviderFactory
+ /* CU private */ static abstract class AbstractTreeItemContentProviderFactory
implements ItemTreeContentProviderFactory
{
public ItemTreeContentProvider buildProvider(Object item, ItemTreeContentProvider.Manager manager) {
@@ -295,14 +295,14 @@ public class DelegatingTreeContentProviderUiTest extends ApplicationWindow
}
- static class ControlTreeItemContentProviderFactory
+ /* CU private */ static class ControlTreeItemContentProviderFactory
extends AbstractTreeItemContentProviderFactory
{
// nothing
}
- static class ViewItemTreeContentProviderFactory
+ /* CU private */ static class ViewItemTreeContentProviderFactory
extends AbstractTreeItemContentProviderFactory
{
@Override
@@ -315,10 +315,10 @@ public class DelegatingTreeContentProviderUiTest extends ApplicationWindow
}
- static class GenericItemTreeContentProvider
+ /* CU private */ static class GenericItemTreeContentProvider
extends AbstractItemTreeContentProvider<TreeNode, TreeNode>
{
- public GenericItemTreeContentProvider(TreeNode treeNode, ItemTreeContentProvider.Manager manager) {
+ GenericItemTreeContentProvider(TreeNode treeNode, ItemTreeContentProvider.Manager manager) {
super(treeNode, manager);
}
@@ -329,19 +329,20 @@ public class DelegatingTreeContentProviderUiTest extends ApplicationWindow
@Override
protected CollectionValueModel<TreeNode> buildChildrenModel() {
return new ListCollectionValueModelAdapter<TreeNode>(
- new ListAspectAdapter<TreeNode, TreeNode>(TreeNode.CHILDREN_LIST, this.item) {
- @Override
- protected ListIterator<TreeNode> listIterator_() {
- return this.subject.children();
- }
- });
+ new ListAspectAdapter<TreeNode, TreeNode>(TreeNode.CHILDREN_LIST, this.item) {
+ @Override
+ protected ListIterable<TreeNode> getListIterable() {
+ return this.subject.getChildren();
+ }
+ }
+ );
}
}
- static class ViewParentItemTreeContentProvider
+ /* CU private */ static class ViewParentItemTreeContentProvider
extends GenericItemTreeContentProvider
{
- public ViewParentItemTreeContentProvider(TreeNode treeNode, ItemTreeContentProvider.Manager manager) {
+ ViewParentItemTreeContentProvider(TreeNode treeNode, ItemTreeContentProvider.Manager manager) {
super(treeNode, manager);
}
@@ -356,32 +357,36 @@ public class DelegatingTreeContentProviderUiTest extends ApplicationWindow
@Override
protected CollectionValueModel<TreeNode> buildChildrenModel() {
- return new CompositeCollectionValueModel<TreeNode, TreeNode>(super.buildChildrenModel(), new TreeNodeTransformer());
+ return new CompositeCollectionValueModel<TreeNode, TreeNode>(super.buildChildrenModel(), TREE_NODE_TRANSFORMER);
}
}
- static class TreeNodeTransformer
+ /* CU private */ static Transformer<TreeNode, CollectionValueModel<TreeNode>> TREE_NODE_TRANSFORMER = new TreeNodeTransformer();
+ /* CU private */ static class TreeNodeTransformer
extends TransformerAdapter<TreeNode, CollectionValueModel<TreeNode>>
{
@Override
public CollectionValueModel<TreeNode> transform(TreeNode value) {
- if (value instanceof Nest) {
- final Nest nest = (Nest) value;
- return new ListCollectionValueModelAdapter<TreeNode>(
- new ListAspectAdapter<TreeNode, TreeNode>(TreeNode.CHILDREN_LIST, nest) {
- @Override
- protected ListIterator<TreeNode> listIterator_() {
- return nest.children();
- }
+ return (value instanceof Nest) ?
+ this.transform((Nest) value) :
+ new StaticCollectionValueModel<TreeNode>(CollectionTools.collection(value));
+ }
+
+ private CollectionValueModel<TreeNode> transform(final Nest nest) {
+ return new ListCollectionValueModelAdapter<TreeNode>(
+ new ListAspectAdapter<TreeNode, TreeNode>(TreeNode.CHILDREN_LIST, nest) {
+ @Override
+ protected ListIterable<TreeNode> getListIterable() {
+ return this.subject.getChildren();
}
- );
- }
- return new StaticCollectionValueModel<TreeNode>(CollectionTools.collection(value));
+ }
+ );
}
}
- static class LabelProvider extends BaseLabelProvider
+ /* CU private */ static class LabelProvider
+ extends BaseLabelProvider
implements ILabelProvider
{
public Image getImage(Object element) {
@@ -394,58 +399,58 @@ public class DelegatingTreeContentProviderUiTest extends ApplicationWindow
}
- static abstract class TreeNode extends AbstractModel
+ /* CU private */ static abstract class TreeNode
+ extends AbstractModel
{
private TreeNode parent;
- protected final List<TreeNode> children;
+ protected final ArrayList<TreeNode> children = new ArrayList<TreeNode>();
public final static String CHILDREN_LIST = "children";
protected String name;
public final static String NAME_PROPERTY = "name";
- public TreeNode(TreeNode parent, String name) {
+ TreeNode(TreeNode parent, String name) {
this.parent = parent;
- this.children = new ArrayList<TreeNode>();
this.name = name;
}
public TreeNode parent() {
- return parent;
+ return this.parent;
}
- public ListIterator<TreeNode> children() {
- return new ReadOnlyListIterator<TreeNode>(children);
+ public ListIterable<TreeNode> getChildren() {
+ return new LiveCloneListIterable<TreeNode>(this.children);
}
protected void addChild(TreeNode child) {
- addItemToList(child, children, CHILDREN_LIST);
+ this.addItemToList(child, this.children, CHILDREN_LIST);
}
public void removeChild(TreeNode child) {
- removeItemFromList(child, children, CHILDREN_LIST);
+ this.removeItemFromList(child, this.children, CHILDREN_LIST);
}
public void removeChild(int index) {
- removeItemFromList(index, children, CHILDREN_LIST);
+ this.removeItemFromList(index, this.children, CHILDREN_LIST);
}
public String getName() {
- return name;
+ return this.name;
}
- public void setName(String newName) {
- String oldName = name;
- name = newName;
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
+ public void setName(String name) {
+ String old = this.name;
+ this.name = name;
+ this.firePropertyChanged(NAME_PROPERTY, old, name);
}
public boolean canHaveChildren() {
return false;
}
- public void addChild(String name) {
+ public void addChild(@SuppressWarnings("unused") String childName) {
throw new UnsupportedOperationException();
}
@@ -453,20 +458,21 @@ public class DelegatingTreeContentProviderUiTest extends ApplicationWindow
return false;
}
- public void addNestedChild(String name) {
+ public void addNestedChild(@SuppressWarnings("unused") String childName) {
throw new UnsupportedOperationException();
}
@Override
public void toString(StringBuilder sb) {
- sb.append(getName());
+ sb.append(this.name);
}
}
- static class Root extends TreeNode
+ /* CU private */ static class Root
+ extends TreeNode
{
- public Root() {
+ Root() {
super(null, null);
}
@@ -476,15 +482,16 @@ public class DelegatingTreeContentProviderUiTest extends ApplicationWindow
}
@Override
- public void addChild(String name) {
- addChild(new Parent(this, name));
+ public void addChild(String childName) {
+ this.addChild(new Parent(this, childName));
}
}
- static class Parent extends TreeNode
+ /* CU private */ static class Parent
+ extends TreeNode
{
- public Parent(TreeNode parent, String name) {
+ Parent(TreeNode parent, String name) {
super(parent, name);
}
@@ -494,8 +501,8 @@ public class DelegatingTreeContentProviderUiTest extends ApplicationWindow
}
@Override
- public void addChild(String name) {
- addChild(new Child(this, name));
+ public void addChild(String childName) {
+ this.addChild(new Child(this, childName));
}
@Override
@@ -504,55 +511,54 @@ public class DelegatingTreeContentProviderUiTest extends ApplicationWindow
}
@Override
- public void addNestedChild(String name) {
+ public void addNestedChild(String childName) {
TreeNode nest = new Nest(this);
- addChild(nest);
- nest.addChild(name);
+ this.addChild(nest);
+ nest.addChild(childName);
}
- public Iterator<Child> nestlessChildren() {
- return new FilteringIterator<Child>(
- new TransformationIterator<TreeNode, Child>(children()) {
+ public Iterable<Child> getNestlessChildren() {
+ return new TransformationIterable<TreeNode, Child>(this.getChildren()) {
@Override
protected Child transform(TreeNode next) {
if (next instanceof Nest) {
- return ((Nest) next).child();
+ return ((Nest) next).getChild();
}
return (Child) next;
}
- },
- NotNullFilter.<Child>instance()
- );
+ };
}
}
- static class Nest extends TreeNode
+ /* CU private */ static class Nest
+ extends TreeNode
{
- public Nest(TreeNode parent) {
+ Nest(TreeNode parent) {
super(parent, "nest");
}
@Override
public boolean canHaveChildren() {
- return children.size() == 0;
+ return this.children.size() == 0;
}
@Override
- public void addChild(String name) {
- addChild(new Child(this, name));
+ public void addChild(String childName) {
+ this.addChild(new Child(this, childName));
}
/* can only have one child */
- public Child child() {
- return (children.isEmpty()) ? null : (Child) children.get(0);
+ public Child getChild() {
+ return (this.children.isEmpty()) ? null : (Child) this.children.get(0);
}
}
- static class Child extends TreeNode
+ /* CU private */ static class Child
+ extends TreeNode
{
- public Child(TreeNode parent, String name) {
+ Child(TreeNode parent, String name) {
super(parent, name);
}
}
diff --git a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/PaneVisibilityEnablerTest.java b/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/PaneVisibilityEnablerTest.java
index 8c984913c9..76be47818f 100644
--- a/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/PaneVisibilityEnablerTest.java
+++ b/common/tests/org.eclipse.jpt.common.ui.tests/src/org/eclipse/jpt/common/ui/tests/internal/util/PaneVisibilityEnablerTest.java
@@ -11,6 +11,7 @@ package org.eclipse.jpt.common.ui.tests.internal.util;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
+import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jpt.common.ui.internal.util.PaneVisibilityEnabler;
import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
import org.eclipse.jpt.common.ui.internal.widgets.DialogPane;
@@ -29,29 +30,30 @@ public final class PaneVisibilityEnablerTest {
@Before
public void setUp() {
- parent = new Composite(SWTUtil.getShell(), SWT.NONE);
- parent.setLayout(new GridLayout());
+ this.parent = new Composite(SWTUtil.getShell(), SWT.NONE);
+ this.parent.setLayout(new GridLayout());
}
@After
public void tearDown() {
- if (parent != null) {
- parent.dispose();
+ if (this.parent != null) {
+ this.parent.dispose();
}
}
@Test
public void testSwitchState() {
- SimplePropertyValueModel<Boolean> booleanHolder =
- new SimplePropertyValueModel<Boolean>(true);
+ SimplePropertyValueModel<Boolean> booleanHolder = new SimplePropertyValueModel<Boolean>(Boolean.TRUE);
DialogPane<Node> pane = new DialogPane<Node>(
new SimplePropertyValueModel<Node>(),
- parent)
- {
+ this.parent,
+ JFaceResources.getResources()
+ ) {
@Override
protected void initializeLayout(Composite container) {
+ // NOP
}
};
@@ -71,7 +73,7 @@ public final class PaneVisibilityEnablerTest {
);
// Change state (true)
- booleanHolder.setValue(true);
+ booleanHolder.setValue(Boolean.TRUE);
assertTrue(
"The pane should be visible",
@@ -79,7 +81,7 @@ public final class PaneVisibilityEnablerTest {
);
// Change state (false)
- booleanHolder.setValue(false);
+ booleanHolder.setValue(Boolean.FALSE);
assertFalse(
"The pane should not be visible",
@@ -87,6 +89,6 @@ public final class PaneVisibilityEnablerTest {
);
// Dispose
- booleanHolder.setValue(true);
+ booleanHolder.setValue(Boolean.TRUE);
}
}
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/prefs/PreferencePropertyValueModelTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/prefs/PreferencePropertyValueModelTests.java
index f3252a2be7..120bf50816 100644
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/prefs/PreferencePropertyValueModelTests.java
+++ b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/model/value/prefs/PreferencePropertyValueModelTests.java
@@ -390,7 +390,7 @@ public class PreferencePropertyValueModelTests extends PreferencesTestCase {
preferencesModel,
key,
defaultValue,
- Transformer.Null.<String>instance()
+ Transformer.Non.<String>instance()
);
}
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/META-INF/MANIFEST.MF b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/META-INF/MANIFEST.MF
index ce3523fb16..59063a4ed6 100644
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/META-INF/MANIFEST.MF
+++ b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/META-INF/MANIFEST.MF
@@ -24,6 +24,7 @@ Require-Bundle: org.eclipse.debug.core;bundle-version="[3.4.0,4.0.0)",
org.eclipse.wst.common.uriresolver;bundle-version="[1.1.401,2.0.0)",
org.eclipse.wst.xml.core;bundle-version="[1.1.500,2.0.0)"
Export-Package: org.eclipse.jpt.dbws.eclipselink.core.internal.gen;x-internal:=true,
+ org.eclipse.jpt.dbws.eclipselink.ui,
org.eclipse.jpt.dbws.eclipselink.ui.internal;x-internal:=true,
org.eclipse.jpt.dbws.eclipselink.ui.internal.actions;x-internal:=true,
org.eclipse.jpt.dbws.eclipselink.ui.internal.wizards.gen;x-internal:=true
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/build.properties b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/build.properties
index b7b9c1420e..8d02a56abd 100644
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/build.properties
+++ b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/build.properties
@@ -1,5 +1,5 @@
################################################################################
-# Copyright (c) 2010, 2011 Oracle. All rights reserved.
+# Copyright (c) 2010, 2012 Oracle. All rights reserved.
# 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.
@@ -13,7 +13,7 @@ output.. = bin/
bin.includes = .,\
META-INF/,\
about.html,\
- icons/,\
+ images/,\
plugin.xml,\
plugin.properties
jars.compile.order = .
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/obj16/text.gif b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/obj16/text.gif
deleted file mode 100644
index efa7a38014..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/obj16/text.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/ovr16/error_ovr.gif b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/ovr16/error_ovr.gif
deleted file mode 100644
index 119dcccd5a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/ovr16/error_ovr.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/etool16/newclient_webserv_wiz.gif b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/images/buttons/new-web-services-client.gif
index 1ee05fa2e5..1ee05fa2e5 100644
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/etool16/newclient_webserv_wiz.gif
+++ b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/images/buttons/new-web-services-client.gif
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/obj16/dtdfile.gif b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/images/objects/dtd-file.gif
index 3c0acadd2d..3c0acadd2d 100644
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/obj16/dtdfile.gif
+++ b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/images/objects/dtd-file.gif
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/obj16/XSDFile.gif b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/images/objects/xsd-file.gif
index cc0eeb7196..cc0eeb7196 100644
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/obj16/XSDFile.gif
+++ b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/images/objects/xsd-file.gif
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/wizban/webservicesclient_wiz.gif b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/images/wizards/new-web-services-client.gif
index 77c16a0f87..77c16a0f87 100644
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/icons/full/wizban/webservicesclient_wiz.gif
+++ b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/images/wizards/new-web-services-client.gif
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/plugin.xml b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/plugin.xml
index 5c52d864fe..462d1ad6cc 100644
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/plugin.xml
+++ b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/plugin.xml
@@ -40,7 +40,7 @@
name="%generateDbwsFromXmlName"
category="org.eclipse.jpt.dbws"
class="org.eclipse.jpt.dbws.eclipselink.ui.internal.wizards.gen.DbwsGeneratorWizard"
- icon="icons/full/etool16/newclient_webserv_wiz.gif">
+ icon="$nl$/images/buttons/new-web-services-client.gif">
<description>%generateDbwsFromXmlDesc</description>
</wizard>
@@ -52,7 +52,7 @@
<!-- contributions to the "Generate" submenu -->
<objectContribution
- id="org.eclipse.jpt.ui.xsdFileActions"
+ id="org.eclipse.jpt.dbws.eclipelink.ui.xsdFileActions"
objectClass="org.eclipse.core.resources.IFile"
nameFilter="*builder.xml">
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/JptDbwsEclipseLinkUiImages.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/JptDbwsEclipseLinkUiImages.java
new file mode 100644
index 0000000000..773cc697e3
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/JptDbwsEclipseLinkUiImages.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2011, 2012 Oracle. All rights reserved.
+ * 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.dbws.eclipselink.ui;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jpt.common.ui.JptCommonUiImages;
+import org.eclipse.jpt.dbws.eclipselink.ui.internal.plugin.JptDbwsEclipseLinkUiPlugin;
+
+/**
+ * Actually, just the image descriptors....
+ * <p>
+ * Code should use these constants to acquire (and release) the images provided
+ * by Dali. The images should be managed by a
+ * {@link org.eclipse.jface.resource.ResourceManager "local" resource manager}.
+ * <p>
+ * Also, the {@link org.eclipse.ui.IWorkbench Eclipse workbench} supplies more
+ * general purpose {@link org.eclipse.ui.ISharedImages images}.
+ *
+ * @see JptCommonUiImages
+ */
+// TODO add corresponding ImageDescriptorTest...
+@SuppressWarnings("nls")
+public final class JptDbwsEclipseLinkUiImages {
+
+ // ********** directories **********
+
+ private static final String BUTTONS_ = JptCommonUiImages.BUTTONS_;
+ private static final String OBJECTS_ = JptCommonUiImages.OBJECTS_;
+ private static final String WIZARDS_ = JptCommonUiImages.WIZARDS_;
+
+
+ // ********** buttons **********
+
+ public static final ImageDescriptor NEW_WEB_SERVICES_CLIENT = buildImageDescriptor(BUTTONS_ + "new-web-services-client.gif");
+
+
+ // ********** objects **********
+
+ public static final ImageDescriptor DTD_FILE = buildImageDescriptor(OBJECTS_ + "dtd-file.gif");
+ public static final ImageDescriptor XSD_FILE = buildImageDescriptor(OBJECTS_ + "xsd-file.gif");
+
+
+ // ********** wizard banners **********
+
+ public static final ImageDescriptor NEW_WEB_SERVICES_CLIENT_BANNER = buildImageDescriptor(WIZARDS_ + "new-web-services-client.gif");
+
+
+ // ********** misc **********
+
+ private static ImageDescriptor buildImageDescriptor(String path) {
+ return JptDbwsEclipseLinkUiPlugin.instance().buildImageDescriptor(path);
+ }
+
+ private JptDbwsEclipseLinkUiImages() {
+ throw new UnsupportedOperationException();
+ }
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/JptDbwsUiIcons.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/JptDbwsUiIcons.java
deleted file mode 100644
index 38beda8da7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/JptDbwsUiIcons.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2011 Oracle. All rights reserved.
-* 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.dbws.eclipselink.ui.internal;
-
-@SuppressWarnings("nls")
-public class JptDbwsUiIcons
-{
- // **************** Wizard icons *******************************************
-
- public static final String DBWS_GEN_WIZ_BANNER = "full/wizban/webservicesclient_wiz";
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/BuilderXmlWizardPage.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/BuilderXmlWizardPage.java
index 5eb23fc72e..cd5b9dbfa9 100644
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/BuilderXmlWizardPage.java
+++ b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/BuilderXmlWizardPage.java
@@ -14,6 +14,7 @@ import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.resource.ResourceManager;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.wizard.IWizardPage;
@@ -32,6 +33,7 @@ import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
public class BuilderXmlWizardPage extends WizardPage {
private final IStructuredSelection initialSelection;
+ private final ResourceManager resourceManager;
private IProject targetProject;
protected SelectFileOrXMLCatalogIdPanel selectSourcePanel;
@@ -55,10 +57,11 @@ public class BuilderXmlWizardPage extends WizardPage {
// ********** constructor **********
- BuilderXmlWizardPage(IStructuredSelection selection) {
+ BuilderXmlWizardPage(IStructuredSelection selection, ResourceManager resourceManager) {
super("BuilderXmlWizardPage"); //$NON-NLS-1$
this.initialSelection = selection;
+ this.resourceManager = resourceManager;
}
// ********** IDialogPage implementation **********
@@ -70,7 +73,7 @@ public class BuilderXmlWizardPage extends WizardPage {
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
this.setControl(composite);
- this.selectSourcePanel = new SelectFileOrXMLCatalogIdPanel(composite, this.initialSelection);
+ this.selectSourcePanel = new SelectFileOrXMLCatalogIdPanel(composite, this.initialSelection, this.resourceManager);
this.selectSourcePanel.setLayoutData(new GridData(GridData.FILL_BOTH));
SelectFileOrXMLCatalogIdPanel.PanelListener listener = new SelectFileOrXMLCatalogIdPanel.PanelListener() {
@@ -178,7 +181,7 @@ public class BuilderXmlWizardPage extends WizardPage {
return errorMessage;
}
- private void selectFileOrXMLCatalogIdPanelChanged() {
+ void selectFileOrXMLCatalogIdPanelChanged() {
String errorMessage = this.computeErrorMessage();
this.setErrorMessage(errorMessage);
this.setPageComplete(this.isPageComplete());
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/DbwsGeneratorWizard.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/DbwsGeneratorWizard.java
index 34d678a020..bb1499c84c 100644
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/DbwsGeneratorWizard.java
+++ b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/DbwsGeneratorWizard.java
@@ -16,11 +16,14 @@ import org.eclipse.core.resources.WorkspaceJob;
import org.eclipse.core.runtime.IPath;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.resource.LocalResourceManager;
+import org.eclipse.jface.resource.ResourceManager;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.jpt.dbws.eclipselink.ui.JptDbwsEclipseLinkUiImages;
import org.eclipse.jpt.dbws.eclipselink.ui.internal.DbwsGeneratorUi;
-import org.eclipse.jpt.dbws.eclipselink.ui.internal.JptDbwsUiIcons;
import org.eclipse.jpt.dbws.eclipselink.ui.internal.JptDbwsUiMessages;
import org.eclipse.jpt.dbws.eclipselink.ui.internal.plugin.JptDbwsEclipseLinkUiPlugin;
import org.eclipse.ui.IWorkbench;
@@ -33,6 +36,7 @@ public class DbwsGeneratorWizard extends Wizard implements IWorkbenchWizard {
private IJavaProject javaProject;
private String builderXmlFile;
+ private ResourceManager resourceManager;
private IStructuredSelection selection;
private WebDynamicProjectWizardPage projectWizardPage;
@@ -69,12 +73,13 @@ public class DbwsGeneratorWizard extends Wizard implements IWorkbenchWizard {
// ********** IWorkbenchWizard implementation **********
- public void init(IWorkbench workbench, IStructuredSelection selection) {
- this.selection = selection;
+ public void init(IWorkbench workbench, IStructuredSelection sel) {
+ this.resourceManager = new LocalResourceManager(JFaceResources.getResources(workbench.getDisplay()));
+ this.selection = sel;
this.setWindowTitle(JptDbwsUiMessages.DbwsGeneratorWizard_title);
- this.setDefaultPageImageDescriptor(JptDbwsEclipseLinkUiPlugin.instance().buildImageDescriptor(JptDbwsUiIcons.DBWS_GEN_WIZ_BANNER));
+ this.setDefaultPageImageDescriptor(JptDbwsEclipseLinkUiImages.NEW_WEB_SERVICES_CLIENT_BANNER);
this.setNeedsProgressMonitor(true);
}
@@ -86,15 +91,15 @@ public class DbwsGeneratorWizard extends Wizard implements IWorkbenchWizard {
if(this.selection != null) {
// WebDynamicProjectWizardPage
- this.javaProject = this.getJavaProjectFromSelection(this.selection);
+ this.javaProject = this.getJavaProjectFromSelection();
- this.projectWizardPage = this.buildWebDynamicProjectPage(this.javaProject);
+ this.projectWizardPage = this.buildWebDynamicProjectPage();
this.addPage(this.projectWizardPage);
// BuilderXmlWizardPage
IFile builderXmlSelected = BuilderXmlWizardPage.getBuilderXmlFromSelection(this.selection);
if(builderXmlSelected == null) {
- this.builderXmlWizardPage = this.buildBuilderXmlPage(this.selection);
+ this.builderXmlWizardPage = this.buildBuilderXmlPage();
this.addPage(this.builderXmlWizardPage);
}
else {
@@ -140,27 +145,25 @@ public class DbwsGeneratorWizard extends Wizard implements IWorkbenchWizard {
if(xmlFile != null) {
return this.makeRelativeToProjectPath(xmlFile.getFullPath());
}
- else {
- return this.builderXmlWizardPage.getSourceURI();
- }
+ return this.builderXmlWizardPage.getSourceURI();
}
return this.builderXmlFile;
}
// ********** internal methods **********
- private WebDynamicProjectWizardPage buildWebDynamicProjectPage(IJavaProject javaProject) {
+ private WebDynamicProjectWizardPage buildWebDynamicProjectPage() {
- WebDynamicProjectWizardPage projectWizardPage = new WebDynamicProjectWizardPage(javaProject);
- projectWizardPage.setTitle(JptDbwsUiMessages.WebDynamicProjectWizardPage_title);
- projectWizardPage.setDescription(JptDbwsUiMessages.WebDynamicProjectWizardPage_desc);
- projectWizardPage.setDestinationLabel(JptDbwsUiMessages.WebDynamicProjectWizardPage_destinationProject);
+ WebDynamicProjectWizardPage page = new WebDynamicProjectWizardPage(this.javaProject);
+ page.setTitle(JptDbwsUiMessages.WebDynamicProjectWizardPage_title);
+ page.setDescription(JptDbwsUiMessages.WebDynamicProjectWizardPage_desc);
+ page.setDestinationLabel(JptDbwsUiMessages.WebDynamicProjectWizardPage_destinationProject);
- return projectWizardPage;
+ return page;
}
- private BuilderXmlWizardPage buildBuilderXmlPage(IStructuredSelection selection) {
- return new BuilderXmlWizardPage(selection);
+ private BuilderXmlWizardPage buildBuilderXmlPage() {
+ return new BuilderXmlWizardPage(this.selection, this.resourceManager);
}
private JdbcDriverWizardPage buildJdbcDriversPage() {
@@ -185,11 +188,11 @@ public class DbwsGeneratorWizard extends Wizard implements IWorkbenchWizard {
generateJob.schedule();
}
- private IJavaProject getJavaProjectFromSelection(IStructuredSelection selection) {
- if(selection == null) {
+ private IJavaProject getJavaProjectFromSelection() {
+ if(this.selection == null) {
return null;
}
- Object firstElement = selection.getFirstElement();
+ Object firstElement = this.selection.getFirstElement();
if(firstElement instanceof IJavaProject) {
return (IJavaProject)firstElement;
}
@@ -206,4 +209,10 @@ public class DbwsGeneratorWizard extends Wizard implements IWorkbenchWizard {
private IJavaProject getJavaProjectFrom(IProject project) {
return ((IJavaElement) project.getAdapter(IJavaElement.class)).getJavaProject();
}
+
+ @Override
+ public void dispose() {
+ this.resourceManager.dispose();
+ super.dispose();
+ }
}
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/JdbcDriverWizardPage.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/JdbcDriverWizardPage.java
index 2a9306f24a..21e0b6c623 100644
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/JdbcDriverWizardPage.java
+++ b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/JdbcDriverWizardPage.java
@@ -12,7 +12,6 @@ package org.eclipse.jpt.dbws.eclipselink.ui.internal.wizards.gen;
import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
-
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.viewers.ColumnWeightData;
@@ -30,9 +29,8 @@ import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
import org.eclipse.jpt.common.ui.internal.util.TableLayoutComposite;
import org.eclipse.jpt.common.utility.internal.StringTools;
import org.eclipse.jpt.common.utility.internal.collection.CollectionTools;
-import org.eclipse.jpt.dbws.eclipselink.ui.internal.JptDbwsUiIcons;
+import org.eclipse.jpt.dbws.eclipselink.ui.JptDbwsEclipseLinkUiImages;
import org.eclipse.jpt.dbws.eclipselink.ui.internal.JptDbwsUiMessages;
-import org.eclipse.jpt.dbws.eclipselink.ui.internal.plugin.JptDbwsEclipseLinkUiPlugin;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
@@ -74,7 +72,7 @@ public class JdbcDriverWizardPage extends WizardPage
protected void initialize() {
this.setTitle(JptDbwsUiMessages.JdbcDriverWizardPage_title);
this.setDescription(JptDbwsUiMessages.JdbcDriverWizardPage_desc);
- this.setImageDescriptor(JptDbwsEclipseLinkUiPlugin.instance().buildImageDescriptor(JptDbwsUiIcons.DBWS_GEN_WIZ_BANNER));
+ this.setImageDescriptor(JptDbwsEclipseLinkUiImages.NEW_WEB_SERVICES_CLIENT_BANNER);
}
// ********** intra-wizard methods **********
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectFileOrXMLCatalogIdPanel.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectFileOrXMLCatalogIdPanel.java
index f848ea46b5..5fc55a44ec 100644
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectFileOrXMLCatalogIdPanel.java
+++ b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectFileOrXMLCatalogIdPanel.java
@@ -13,11 +13,11 @@ package org.eclipse.jpt.dbws.eclipselink.ui.internal.wizards.gen;
import org.eclipse.core.resources.IFile;
import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.resource.ResourceManager;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jpt.dbws.eclipselink.ui.internal.plugin.JptDbwsEclipseLinkUiPlugin;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
@@ -44,7 +44,7 @@ public class SelectFileOrXMLCatalogIdPanel extends Composite implements Selectio
// ********** constructor **********
- public SelectFileOrXMLCatalogIdPanel(Composite parent, IStructuredSelection selection) {
+ public SelectFileOrXMLCatalogIdPanel(Composite parent, IStructuredSelection selection, ResourceManager resourceManager) {
super(parent, SWT.NONE);
// container group
@@ -62,7 +62,7 @@ public class SelectFileOrXMLCatalogIdPanel extends Composite implements Selectio
// Catalog
ICatalog xmlCatalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog();
- selectXMLCatalogIdPanel = new SelectXMLCatalogIdPanel(pageBook, xmlCatalog);
+ selectXMLCatalogIdPanel = new SelectXMLCatalogIdPanel(pageBook, xmlCatalog, resourceManager);
selectXMLCatalogIdPanel.getTableViewer().addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
updateCompletionStateChange();
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectXMLCatalogIdPanel.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectXMLCatalogIdPanel.java
index 536c1bcf52..eee4d3fcd8 100644
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectXMLCatalogIdPanel.java
+++ b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/SelectXMLCatalogIdPanel.java
@@ -14,10 +14,10 @@ package org.eclipse.jpt.dbws.eclipselink.ui.internal.wizards.gen;
import java.util.Collection;
import java.util.List;
import java.util.Vector;
+import org.eclipse.jface.resource.ResourceManager;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jpt.dbws.eclipselink.ui.internal.JptDbwsUiMessages;
-import org.eclipse.jpt.dbws.eclipselink.ui.internal.plugin.JptDbwsEclipseLinkUiPlugin;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
@@ -36,7 +36,7 @@ public class SelectXMLCatalogIdPanel extends Composite {
protected XMLCatalogTableViewer tableViewer;
protected ICatalog fXmlCatalog;
- public SelectXMLCatalogIdPanel(Composite parent, ICatalog xmlCatalog) {
+ public SelectXMLCatalogIdPanel(Composite parent, ICatalog xmlCatalog, ResourceManager resourceManager) {
super(parent, SWT.NONE);
this.fXmlCatalog = xmlCatalog;
@@ -50,17 +50,17 @@ public class SelectXMLCatalogIdPanel extends Composite {
Label label = new Label(this, SWT.NONE);
label.setText(JptDbwsUiMessages.BuilderXmlWizardPage_xmlCatalogTableTitle);
- tableViewer = createTableViewer(this);
+ tableViewer = createTableViewer(this, resourceManager);
tableViewer.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
tableViewer.setInput("dummy"); //$NON-NLS-1$
}
- protected XMLCatalogTableViewer createTableViewer(Composite parent) {
+ protected XMLCatalogTableViewer createTableViewer(Composite parent, ResourceManager resourceManager) {
String headings[] = new String[2];
headings[0] = JptDbwsUiMessages.BuilderXmlWizardPage_xmlCatalogKeyColumn;
headings[1] = JptDbwsUiMessages.BuilderXmlWizardPage_xmlCatalogUriColumn;
- XMLCatalogTableViewer theTableViewer = new XMLCatalogTableViewer(parent, headings) {
+ XMLCatalogTableViewer theTableViewer = new XMLCatalogTableViewer(parent, headings, resourceManager) {
protected void addXMLCatalogEntries(List list, ICatalogEntry[] entries) {
for (int i = 0; i < entries.length; i++) {
diff --git a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/XMLCatalogTableViewer.java b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/XMLCatalogTableViewer.java
index 7947401523..65963285e7 100644
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/XMLCatalogTableViewer.java
+++ b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/ui/internal/wizards/gen/XMLCatalogTableViewer.java
@@ -14,40 +14,37 @@ package org.eclipse.jpt.dbws.eclipselink.ui.internal.wizards.gen;
import java.util.Arrays;
import java.util.Collection;
import java.util.Comparator;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ResourceManager;
import org.eclipse.jface.viewers.ColumnWeightData;
+import org.eclipse.jface.viewers.IBaseLabelProvider;
+import org.eclipse.jface.viewers.IDecoration;
import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.TableLayout;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jpt.dbws.eclipselink.ui.internal.plugin.JptDbwsEclipseLinkUiPlugin;
+import org.eclipse.jpt.common.ui.JptCommonUiImages;
+import org.eclipse.jpt.common.ui.internal.jface.OverlayImageDescriptor;
+import org.eclipse.jpt.common.ui.internal.jface.PluggableTextTableLabelProvider;
+import org.eclipse.jpt.common.ui.internal.jface.ResourceManagerTableLabelProvider;
+import org.eclipse.jpt.common.utility.internal.ObjectTools;
+import org.eclipse.jpt.dbws.eclipselink.ui.JptDbwsEclipseLinkUiImages;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
-
import com.ibm.icu.text.Collator;
-public class XMLCatalogTableViewer extends TableViewer {
-
+public abstract class XMLCatalogTableViewer
+ extends TableViewer
+{
protected static String ERROR_STATE_KEY = "errorstatekey"; //$NON-NLS-1$
- protected static Image dtdFileImage = JptDbwsEclipseLinkUiPlugin.instance().getImage("full/obj16/dtdfile"); //$NON-NLS-1$
- protected static Image unknownFileImage = JptDbwsEclipseLinkUiPlugin.instance().getImage("full/obj16/text"); //$NON-NLS-1$
- protected static Image xsdFileImage = JptDbwsEclipseLinkUiPlugin.instance().getImage("full/obj16/XSDFile"); //$NON-NLS-1$
- protected static Image errorImage = JptDbwsEclipseLinkUiPlugin.instance().getImage("full/ovr16/error_ovr"); //$NON-NLS-1$
- // ********** constructor **********
-
- public XMLCatalogTableViewer(Composite parent, String[] columnProperties) {
+ protected XMLCatalogTableViewer(Composite parent, String[] columnProperties, ResourceManager resourceManager) {
super(parent, SWT.FULL_SELECTION);
Table table = getTable();
@@ -68,34 +65,30 @@ public class XMLCatalogTableViewer extends TableViewer {
setColumnProperties(columnProperties);
setContentProvider(new CatalogEntryContentProvider());
- setLabelProvider(new CatalogEntryLabelProvider());
+ setLabelProvider(this.buildLabelProvider(resourceManager));
}
- public Collection getXMLCatalogEntries() {
- return null;
+ protected IBaseLabelProvider buildLabelProvider(ResourceManager resourceManager) {
+ return new ResourceManagerTableLabelProvider<Object>(
+ CATALOG_ENTRY_LABEL_IMAGE_DESCRIPTOR_TRANSFORMER,
+ CATALOG_ENTRY_LABEL_TEXT_TRANSFORMER,
+ resourceManager
+ );
}
- public void menuAboutToShow(IMenuManager menuManager) {
- Action action = new Action("hello") { //$NON-NLS-1$
- public void run() {
- System.out.println("run!"); //$NON-NLS-1$
- }
- };
- menuManager.add(action);
- }
+ protected abstract Collection getXMLCatalogEntries();
public void setFilterExtensions(String[] extensions) {
resetFilters();
addFilter(new XMLCatalogTableViewerFilter(extensions));
}
- // ********** inner class **********
-
- public class CatalogEntryContentProvider implements IStructuredContentProvider {
- public void dispose() {
- }
+ // ********** content provider **********
+ public class CatalogEntryContentProvider
+ implements IStructuredContentProvider
+ {
public Object[] getElements(Object element) {
Object[] array = getXMLCatalogEntries().toArray();
Comparator comparator = new Comparator() {
@@ -114,56 +107,80 @@ public class XMLCatalogTableViewer extends TableViewer {
}
public void inputChanged(Viewer viewer, Object old, Object newobj) {
+ // NOP
}
public boolean isDeleted(Object object) {
return false;
}
+
+ public void dispose() {
+ // NOP
+ }
}
- public class CatalogEntryLabelProvider extends LabelProvider implements ITableLabelProvider {
-
- public Image getColumnImage(Object object, int columnIndex) {
- Image result = null;
- if (columnIndex == 0) {
- Image base = null;
- if (object instanceof ICatalogEntry) {
- ICatalogEntry catalogEntry = (ICatalogEntry) object;
- String uri = catalogEntry.getURI();
- if (uri.endsWith("dtd")) { //$NON-NLS-1$
- base = dtdFileImage;
- }
- else if (uri.endsWith("xsd")) { //$NON-NLS-1$
- base = xsdFileImage;
- }
- else {
- base = unknownFileImage;
- }
- if (base != null) {
- if (URIHelper.isReadableURI(uri, false)) {
- result = base;
- }
- else {
- // TODO... SSE port
- result = base;// imageFactory.createCompositeImage(base,
- // errorImage,
- // ImageFactory.BOTTOM_LEFT);
- }
- }
- }
+ // ********** label provider **********
+
+ protected static final PluggableTextTableLabelProvider.TextTransformer<Object> CATALOG_ENTRY_LABEL_TEXT_TRANSFORMER = new CatalogEntryLabelTextTransformer();
+ protected static class CatalogEntryLabelTextTransformer
+ implements PluggableTextTableLabelProvider.TextTransformer<Object>
+ {
+ public String transform(Object element, int columnIndex) {
+ return (element instanceof ICatalogEntry) ? this.transform((ICatalogEntry) element, columnIndex) : null;
+ }
+
+ protected String transform(ICatalogEntry catalogEntry, int columnIndex) {
+ return (columnIndex == 0) ?
+ catalogEntry.getKey() :
+ URIHelper.removePlatformResourceProtocol(catalogEntry.getURI());
+ }
+
+ @Override
+ public String toString() {
+ return ObjectTools.toString(this);
+ }
+ }
+
+ protected static final ResourceManagerTableLabelProvider.ImageDescriptorTransformer<Object> CATALOG_ENTRY_LABEL_IMAGE_DESCRIPTOR_TRANSFORMER = new CatalogEntryLabelImageDescriptorTransformer();
+ protected static class CatalogEntryLabelImageDescriptorTransformer
+ implements ResourceManagerTableLabelProvider.ImageDescriptorTransformer<Object>
+ {
+ public ImageDescriptor transform(Object element, int columnIndex) {
+ return (element instanceof ICatalogEntry) ? this.transform((ICatalogEntry) element, columnIndex) : null;
+ }
+
+ protected ImageDescriptor transform(ICatalogEntry catalogEntry, int columnIndex) {
+ return (columnIndex == 0) ? this.transform(catalogEntry) : null;
+ }
+
+ protected ImageDescriptor transform(ICatalogEntry catalogEntry) {
+ String uri = catalogEntry.getURI();
+ if (uri == null) {
+ return null;
}
- return result;
+ ImageDescriptor base = this.getBaseColumnImageDescriptor(uri);
+ return URIHelper.isReadableURI(uri, false) ? base : this.buildErrorImageDescriptor(base);
}
- public String getColumnText(Object object, int columnIndex) {
- String result = null;
- if (object instanceof ICatalogEntry) {
- ICatalogEntry catalogEntry = (ICatalogEntry) object;
- result = columnIndex == 0 ? catalogEntry.getKey() : catalogEntry.getURI();
- result = URIHelper.removePlatformResourceProtocol(result);
+ protected ImageDescriptor getBaseColumnImageDescriptor(String uri) {
+ uri = uri.toLowerCase();
+ if (uri.endsWith("dtd")) { //$NON-NLS-1$
+ return JptDbwsEclipseLinkUiImages.DTD_FILE;
+ }
+ if (uri.endsWith("xsd")) { //$NON-NLS-1$
+ return JptDbwsEclipseLinkUiImages.XSD_FILE;
}
- return result != null ? result : ""; //$NON-NLS-1$
+ return JptCommonUiImages.FILE;
+ }
+
+ protected ImageDescriptor buildErrorImageDescriptor(ImageDescriptor imageDescriptor) {
+ return new OverlayImageDescriptor(imageDescriptor, JptCommonUiImages.ERROR_OVERLAY, IDecoration.BOTTOM_LEFT);
+ }
+
+ @Override
+ public String toString() {
+ return ObjectTools.toString(this);
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/META-INF/MANIFEST.MF b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/META-INF/MANIFEST.MF
index 5b1ba72838..1e74f18a6e 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/META-INF/MANIFEST.MF
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/META-INF/MANIFEST.MF
@@ -33,14 +33,13 @@ Export-Package: org.eclipse.jpt.jaxb.eclipselink.core,
org.eclipse.jpt.jaxb.eclipselink.core.internal;x-internal:=true,
org.eclipse.jpt.jaxb.eclipselink.core.internal.context;x-internal:=true,
org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java;x-internal:=true,
- org.eclipse.jpt.jaxb.eclipselink.core.internal.context.oxm,
+ org.eclipse.jpt.jaxb.eclipselink.core.internal.context.oxm;x-internal:=true,
org.eclipse.jpt.jaxb.eclipselink.core.internal.context.xpath.java;x-internal:=true,
org.eclipse.jpt.jaxb.eclipselink.core.internal.libval;x-internal:=true,
- org.eclipse.jpt.jaxb.eclipselink.core.internal.plugin,
org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java;x-internal:=true,
org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.binary;x-internal:=true,
org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.source;x-internal:=true,
- org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.oxm,
+ org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.oxm;x-internal:=true,
org.eclipse.jpt.jaxb.eclipselink.core.internal.v2_1;x-internal:=true,
org.eclipse.jpt.jaxb.eclipselink.core.internal.v2_2;x-internal:=true,
org.eclipse.jpt.jaxb.eclipselink.core.internal.v2_3;x-internal:=true,
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/META-INF/MANIFEST.MF b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/META-INF/MANIFEST.MF
index 7b3edc94da..bd7bdab724 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/META-INF/MANIFEST.MF
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/META-INF/MANIFEST.MF
@@ -22,8 +22,10 @@ Require-Bundle: org.eclipse.core.resources;bundle-version="[3.5.2,4.0.0)",
org.eclipse.swt;bundle-version="[3.7.0,4.0.0)",
org.eclipse.ui.ide;bundle-version="[3.8.0,4.0.0)",
org.eclipse.ui.workbench;bundle-version="[3.7.0,4.0.0)"
-Export-Package: org.eclipse.jpt.jaxb.eclipselink.ui.internal;x-internal:=true,
+Export-Package: org.eclipse.jpt.jaxb.eclipselink.ui,
+ org.eclipse.jpt.jaxb.eclipselink.ui.internal;x-internal:=true,
org.eclipse.jpt.jaxb.eclipselink.ui.internal.commands;x-internal:=true,
+ org.eclipse.jpt.jaxb.eclipselink.ui.internal.navigator;x-internal:=true,
org.eclipse.jpt.jaxb.eclipselink.ui.internal.v2_1;x-internal:=true,
org.eclipse.jpt.jaxb.eclipselink.ui.internal.v2_2;x-internal:=true,
org.eclipse.jpt.jaxb.eclipselink.ui.internal.v2_3;x-internal:=true,
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/build.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/build.properties
index 08bc038360..8aada68f96 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/build.properties
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/build.properties
@@ -1,5 +1,5 @@
################################################################################
-# Copyright (c) 2011 Oracle. All rights reserved.
+# Copyright (c) 2011, 2012 Oracle. All rights reserved.
# 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.
@@ -12,7 +12,7 @@ output.. = bin/
bin.includes = .,\
META-INF/,\
about.html,\
- icons/,\
+ images/,\
plugin.xml,\
plugin.properties
jars.compile.order = .
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/icons/full/obj16/oxm-file.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/images/objects/oxm-file.gif
index 1fb940df94..1fb940df94 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/icons/full/obj16/oxm-file.gif
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/images/objects/oxm-file.gif
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/icons/full/obj16/oxm-file.ico b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/images/objects/oxm-file.ico
index 2d08f4b3fd..2d08f4b3fd 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/icons/full/obj16/oxm-file.ico
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/images/objects/oxm-file.ico
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/icons/full/obj16/xml-inverse-reference.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/images/objects/xml-inverse-reference.gif
index ce55b84284..ce55b84284 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/icons/full/obj16/xml-inverse-reference.gif
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/images/objects/xml-inverse-reference.gif
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/icons/full/obj16/xml-join-nodes.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/images/objects/xml-join-nodes.gif
index 578ec36aa3..578ec36aa3 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/icons/full/obj16/xml-join-nodes.gif
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/images/objects/xml-join-nodes.gif
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/icons/full/obj16/xml-transformation.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/images/objects/xml-transformation.gif
index fecf9e54c3..fecf9e54c3 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/icons/full/obj16/xml-transformation.gif
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/images/objects/xml-transformation.gif
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/JptJaxbEclipseLinkUiImages.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/JptJaxbEclipseLinkUiImages.java
new file mode 100644
index 0000000000..5452b695d8
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/JptJaxbEclipseLinkUiImages.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2011, 2012 Oracle. All rights reserved.
+ * 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.jaxb.eclipselink.ui;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jpt.common.ui.JptCommonUiImages;
+import org.eclipse.jpt.jaxb.eclipselink.ui.internal.plugin.JptJaxbEclipseLinkUiPlugin;
+
+/**
+ * Actually, just the image descriptors....
+ * <p>
+ * Code should use these constants to acquire (and release) the images provided
+ * by Dali. The images should be managed by a
+ * {@link org.eclipse.jface.resource.ResourceManager "local" resource manager}.
+ * <p>
+ * Also, the {@link org.eclipse.ui.IWorkbench Eclipse workbench} supplies more
+ * general purpose {@link org.eclipse.ui.ISharedImages images}.
+ *
+ * @see org.eclipse.jpt.jaxb.ui.JptJaxbUiImages
+ * @see JptCommonUiImages
+ */
+// TODO add corresponding ImageDescriptorTest...
+@SuppressWarnings("nls")
+public final class JptJaxbEclipseLinkUiImages {
+
+ // ********** directories **********
+
+ private static final String OBJECTS_ = JptCommonUiImages.OBJECTS_;
+
+
+ // ********** oxm **********
+
+ public static final ImageDescriptor OXM_FILE = buildImageDescriptor(OBJECTS_ + "oxm-file.gif");
+
+
+ // ********** mappings **********
+
+ public static final ImageDescriptor XML_INVERSE_REFERENCE = buildImageDescriptor(OBJECTS_ + "xml-inverse-reference.gif");
+ public static final ImageDescriptor XML_JOIN_NODES = buildImageDescriptor(OBJECTS_ + "xml-join-nodes.gif");
+ public static final ImageDescriptor XML_TRANSFORMATION = buildImageDescriptor(OBJECTS_ + "xml-transformation.gif");
+
+
+ // ********** misc **********
+
+ private static ImageDescriptor buildImageDescriptor(String path) {
+ return JptJaxbEclipseLinkUiPlugin.instance().buildImageDescriptor(path);
+ }
+
+ private JptJaxbEclipseLinkUiImages() {
+ throw new UnsupportedOperationException();
+ }
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbMappingImageHelper.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbMappingImageHelper.java
index 337814d4d7..ddb51cff33 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbMappingImageHelper.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbMappingImageHelper.java
@@ -9,32 +9,25 @@
******************************************************************************/
package org.eclipse.jpt.jaxb.eclipselink.ui.internal;
+import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jpt.jaxb.eclipselink.core.ELJaxbMappingKeys;
-import org.eclipse.jpt.jaxb.eclipselink.ui.internal.plugin.JptJaxbEclipseLinkUiPlugin;
+import org.eclipse.jpt.jaxb.eclipselink.ui.JptJaxbEclipseLinkUiImages;
import org.eclipse.jpt.jaxb.ui.internal.JaxbMappingImageHelper;
-import org.eclipse.swt.graphics.Image;
public class ELJaxbMappingImageHelper {
- public static Image imageForAttributeMapping(String mappingKey) {
- String iconKey = iconKeyForAttributeMapping(mappingKey);
- return (iconKey == null) ?
- JaxbMappingImageHelper.imageForAttributeMapping(mappingKey)
- : JptJaxbEclipseLinkUiPlugin.instance().getImage(iconKey);
- }
-
- public static String iconKeyForAttributeMapping(String mappingKey) {
- if (ELJaxbMappingKeys.XML_INVERSE_REFERENCE_ATTRIBUTE_MAPPING_KEY == mappingKey) {
- return JptJaxbEclipseLinkUiIcons.XML_INVERSE_REFERENCE;
+ public static ImageDescriptor imageDescriptorForAttributeMapping(String mappingKey) {
+ if (ELJaxbMappingKeys.XML_INVERSE_REFERENCE_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
+ return JptJaxbEclipseLinkUiImages.XML_INVERSE_REFERENCE;
}
- else if (ELJaxbMappingKeys.XML_JOIN_NODES_ATTRIBUTE_MAPPING_KEY == mappingKey) {
- return JptJaxbEclipseLinkUiIcons.XML_JOIN_NODES;
+ if (ELJaxbMappingKeys.XML_JOIN_NODES_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
+ return JptJaxbEclipseLinkUiImages.XML_JOIN_NODES;
}
- else if (ELJaxbMappingKeys.XML_TRANSFORMATION_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptJaxbEclipseLinkUiIcons.XML_TRANSFORMATION;
+ if (ELJaxbMappingKeys.XML_TRANSFORMATION_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
+ return JptJaxbEclipseLinkUiImages.XML_TRANSFORMATION;
}
- return null;
+ return JaxbMappingImageHelper.imageDescriptorForAttributeMapping(mappingKey);
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/JptJaxbEclipseLinkUiIcons.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/JptJaxbEclipseLinkUiIcons.java
deleted file mode 100644
index db18d7220b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/JptJaxbEclipseLinkUiIcons.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * 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.jaxb.eclipselink.ui.internal;
-
-
-public class JptJaxbEclipseLinkUiIcons {
-
- public static final String OXM_FILE = "full/obj16/oxm-file"; //$NON-NLS-1$
- public static final String XML_INVERSE_REFERENCE = "full/obj16/xml-inverse-reference"; //$NON-NLS-1$
- public static final String XML_JOIN_NODES = "full/obj16/xml-join-nodes"; //$NON-NLS-1$
- public static final String XML_TRANSFORMATION = "full/obj16/xml-transformation"; //$NON-NLS-1$
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/navigator/ELJaxbNavigatorItemLabelProviderFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/navigator/ELJaxbNavigatorItemLabelProviderFactory.java
index 25ed11804b..dd2f147da9 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/navigator/ELJaxbNavigatorItemLabelProviderFactory.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/navigator/ELJaxbNavigatorItemLabelProviderFactory.java
@@ -15,7 +15,7 @@ import org.eclipse.jpt.common.ui.jface.ItemExtendedLabelProvider;
import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
import org.eclipse.jpt.jaxb.eclipselink.core.context.oxm.OxmFile;
import org.eclipse.jpt.jaxb.eclipselink.core.context.oxm.OxmJavaType;
-import org.eclipse.jpt.jaxb.eclipselink.ui.internal.JptJaxbEclipseLinkUiIcons;
+import org.eclipse.jpt.jaxb.eclipselink.ui.JptJaxbEclipseLinkUiImages;
import org.eclipse.jpt.jaxb.eclipselink.ui.internal.plugin.JptJaxbEclipseLinkUiPlugin;
import org.eclipse.jpt.jaxb.ui.internal.jaxb21.GenericJaxb_2_1_NavigatorItemLabelProviderFactory;
@@ -54,9 +54,10 @@ public class ELJaxbNavigatorItemLabelProviderFactory
protected ItemExtendedLabelProvider buildOxmFileLabelProvider(OxmFile file, ItemExtendedLabelProvider.Manager manager) {
return new StaticItemExtendedLabelProvider(
- JptJaxbEclipseLinkUiPlugin.instance().getImage(JptJaxbEclipseLinkUiIcons.OXM_FILE),
+ JptJaxbEclipseLinkUiImages.OXM_FILE,
buildOxmFileText(file),
- buildOxmFileDescription(file)
+ buildOxmFileDescription(file),
+ manager
);
}
@@ -64,7 +65,7 @@ public class ELJaxbNavigatorItemLabelProviderFactory
StringBuffer text = new StringBuffer();
IPath path = file.getOxmResource().getFile().getRawLocation();
text.append(path.lastSegment());
- text.append(" - ");
+ text.append(" - "); //$NON-NLS-1$
text.append(path.removeLastSegments(1).toOSString());
return text.toString();
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/navigator/ELJaxbPersistentAttributeItemLabelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/navigator/ELJaxbPersistentAttributeItemLabelProvider.java
index c316fe9bf3..8dbcb74f0c 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/navigator/ELJaxbPersistentAttributeItemLabelProvider.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/navigator/ELJaxbPersistentAttributeItemLabelProvider.java
@@ -9,23 +9,23 @@
******************************************************************************/
package org.eclipse.jpt.jaxb.eclipselink.ui.internal.navigator;
-import org.eclipse.jpt.common.ui.jface.ItemLabelProvider;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jpt.common.ui.jface.ItemExtendedLabelProvider;
import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
import org.eclipse.jpt.jaxb.eclipselink.ui.internal.ELJaxbMappingImageHelper;
import org.eclipse.jpt.jaxb.ui.internal.jaxb21.JaxbPersistentAttributeItemLabelProvider;
-import org.eclipse.swt.graphics.Image;
public class ELJaxbPersistentAttributeItemLabelProvider
extends JaxbPersistentAttributeItemLabelProvider
{
- public ELJaxbPersistentAttributeItemLabelProvider(JaxbPersistentAttribute attribute, ItemLabelProvider.Manager manager) {
+ public ELJaxbPersistentAttributeItemLabelProvider(JaxbPersistentAttribute attribute, ItemExtendedLabelProvider.Manager manager) {
super(attribute, manager);
}
@Override
- protected Image buildImage(String mappingKey) {
- return ELJaxbMappingImageHelper.imageForAttributeMapping(mappingKey);
+ protected ImageDescriptor buildImageDescriptor(String mappingKey) {
+ return ELJaxbMappingImageHelper.imageDescriptorForAttributeMapping(mappingKey);
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/navigator/OxmJavaTypeItemLabelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/navigator/OxmJavaTypeItemLabelProvider.java
index 94928d3612..a3e47f9373 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/navigator/OxmJavaTypeItemLabelProvider.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/navigator/OxmJavaTypeItemLabelProvider.java
@@ -9,25 +9,24 @@
******************************************************************************/
package org.eclipse.jpt.jaxb.eclipselink.ui.internal.navigator;
+import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jpt.common.ui.internal.jface.AbstractItemExtendedLabelProvider;
-import org.eclipse.jpt.common.ui.jface.ItemLabelProvider;
+import org.eclipse.jpt.common.ui.jface.ItemExtendedLabelProvider;
import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.jaxb.eclipselink.core.context.oxm.OxmJavaType;
-import org.eclipse.jpt.jaxb.eclipselink.ui.internal.plugin.JptJaxbEclipseLinkUiPlugin;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiIcons;
-import org.eclipse.swt.graphics.Image;
+import org.eclipse.jpt.jaxb.ui.JptJaxbUiImages;
public class OxmJavaTypeItemLabelProvider
- extends AbstractItemExtendedLabelProvider<OxmJavaType> {
-
- public OxmJavaTypeItemLabelProvider(OxmJavaType oxmJavaType, ItemLabelProvider.Manager manager) {
+ extends AbstractItemExtendedLabelProvider<OxmJavaType>
+{
+ public OxmJavaTypeItemLabelProvider(OxmJavaType oxmJavaType, ItemExtendedLabelProvider.Manager manager) {
super(oxmJavaType, manager);
}
-
+
@Override
- public Image getImage() {
- return JptJaxbEclipseLinkUiPlugin.instance().getImage(JptJaxbUiIcons.JAXB_CLASS);
+ protected ImageDescriptor getImageDescriptor() {
+ return JptJaxbUiImages.JAXB_CLASS;
}
@Override
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/build.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/build.properties
index 0a95eca8b7..f31d33b992 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/build.properties
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/build.properties
@@ -1,5 +1,5 @@
################################################################################
-# Copyright (c) 2010, 2011 Oracle. All rights reserved.
+# Copyright (c) 2010, 2012 Oracle. All rights reserved.
# 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.
@@ -13,7 +13,7 @@ output.. = bin/
bin.includes = .,\
META-INF/,\
about.html,\
- icons/,\
+ images/,\
plugin.xml,\
plugin.properties
jars.compile.order = .
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/text.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/text.gif
deleted file mode 100644
index efa7a38014..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/text.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/ovr16/error_ovr.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/ovr16/error_ovr.gif
deleted file mode 100644
index 119dcccd5a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/ovr16/error_ovr.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/newclass_wiz.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/buttons/new-class.gif
index a1c6545cd6..a1c6545cd6 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/newclass_wiz.gif
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/buttons/new-class.gif
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/new_jaxb_project_wiz.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/buttons/new-jaxb-project.gif
index b547717598..b547717598 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/new_jaxb_project_wiz.gif
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/buttons/new-jaxb-project.gif
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/NewXSD.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/buttons/new-xsd.gif
index b6efdd3d86..b6efdd3d86 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/NewXSD.gif
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/buttons/new-xsd.gif
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/jaxb_facet.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/jaxb-facet.gif
index e75a17c2d0..e75a17c2d0 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/jaxb_facet.gif
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/jaxb-facet.gif
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/dtdfile.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/dtd-file.gif
index 3c0acadd2d..3c0acadd2d 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/dtdfile.gif
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/dtd-file.gif
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/enum_constant.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/enum-constant.gif
index d4cb4254d9..d4cb4254d9 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/enum_constant.gif
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/enum-constant.gif
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_class.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/jaxb-class.gif
index baac236770..baac236770 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_class.gif
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/jaxb-class.gif
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_content.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/jaxb-content.gif
index e75a17c2d0..e75a17c2d0 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_content.gif
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/jaxb-content.gif
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_enum.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/jaxb-enum.gif
index c73ed28e70..c73ed28e70 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_enum.gif
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/jaxb-enum.gif
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/package.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/jaxb-package.gif
index 6989b8df73..6989b8df73 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/package.gif
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/jaxb-package.gif
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_registry.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/jaxb-registry.gif
index 719e6057b3..719e6057b3 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_registry.gif
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/jaxb-registry.gif
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_class.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/jaxb-transient-class.gif
index 066461be61..066461be61 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_class.gif
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/jaxb-transient-class.gif
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_class.ico b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/jaxb-transient-class.ico
index 126f3e5c81..126f3e5c81 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_class.ico
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/jaxb-transient-class.ico
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_enum.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/jaxb-transient-enum.gif
index b634fb535f..b634fb535f 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_enum.gif
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/jaxb-transient-enum.gif
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_enum.ico b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/jaxb-transient-enum.ico
index 6c3cceb0c4..6c3cceb0c4 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_enum.ico
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/jaxb-transient-enum.ico
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/null-attribute-mapping.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/null-attribute-mapping.gif
index 70a9c23541..70a9c23541 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/null-attribute-mapping.gif
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/null-attribute-mapping.gif
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/persistent_field.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/persistent-field.gif
index d4cb4254d9..d4cb4254d9 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/persistent_field.gif
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/persistent-field.gif
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/persistent_property.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/persistent-property.gif
index 7d24707ee8..7d24707ee8 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/persistent_property.gif
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/persistent-property.gif
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-any-attribute.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/xml-any-attribute.gif
index a5d9fb0dd6..a5d9fb0dd6 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-any-attribute.gif
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/xml-any-attribute.gif
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-any-element.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/xml-any-element.gif
index f73d02bf43..f73d02bf43 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-any-element.gif
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/xml-any-element.gif
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-attribute.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/xml-attribute.gif
index 851ee72391..851ee72391 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-attribute.gif
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/xml-attribute.gif
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-element-ref.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/xml-element-ref.gif
index 3220052c41..3220052c41 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-element-ref.gif
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/xml-element-ref.gif
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-element-refs.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/xml-element-refs.gif
index 77e4d6a8bd..77e4d6a8bd 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-element-refs.gif
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/xml-element-refs.gif
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-element.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/xml-element.gif
index 8c953dc928..8c953dc928 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-element.gif
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/xml-element.gif
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-elements.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/xml-elements.gif
index cb6aad6b16..cb6aad6b16 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-elements.gif
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/xml-elements.gif
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-transient.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/xml-transient.gif
index 3fd90cf828..3fd90cf828 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-transient.gif
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/xml-transient.gif
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-value.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/xml-value.gif
index 7145d6de8e..7145d6de8e 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-value.gif
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/xml-value.gif
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/XSDFile.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/xsd-file.gif
index cc0eeb7196..cc0eeb7196 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/XSDFile.gif
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/objects/xsd-file.gif
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/newclass_wiz.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/wizards/classes-gen-banner.gif
index 0ac0ee8635..0ac0ee8635 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/newclass_wiz.gif
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/wizards/classes-gen-banner.gif
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/new_jaxb_prj_wiz.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/wizards/jaxb-project-banner.gif
index d1873a1a51..d1873a1a51 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/new_jaxb_prj_wiz.gif
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/wizards/jaxb-project-banner.gif
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/new_jaxb_prj_wiz.png b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/wizards/jaxb-project-banner.png
index 95eb79dbb0..95eb79dbb0 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/new_jaxb_prj_wiz.png
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/wizards/jaxb-project-banner.png
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/NewXSD.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/wizards/schema-gen-banner.gif
index 390f48216a..390f48216a 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/NewXSD.gif
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/images/wizards/schema-gen-banner.gif
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/plugin.xml b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/plugin.xml
index 75660d2549..b12082d60b 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/plugin.xml
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/plugin.xml
@@ -49,7 +49,7 @@
name="%generateSchemaFromClassesName"
category="org.eclipse.jpt.jaxb"
class="org.eclipse.jpt.jaxb.ui.internal.wizards.schemagen.SchemaGeneratorWizard"
- icon="icons/full/etool16/NewXSD.gif">
+ icon="$nl$/images/buttons/new-xsd.gif">
<description>%generateSchemaFromClassesDesc</description>
<selection class="org.eclipse.core.resources.IResource"/>
</wizard>
@@ -59,7 +59,7 @@
name="%generateClassesFromSchemaName"
category="org.eclipse.jpt.jaxb"
class="org.eclipse.jpt.jaxb.ui.internal.wizards.classesgen.ClassesGeneratorWizard"
- icon="icons/full/etool16/newclass_wiz.gif">
+ icon="$nl$/images/buttons/new-class.gif">
<description>%generateClassesFromSchemaDesc</description>
</wizard>
@@ -67,7 +67,7 @@
<wizard
id="org.eclipse.jpt.jaxb.ui.wizard.newJaxbProject"
name="%newJaxbProjectWizardName"
- icon="icons/full/etool16/new_jaxb_project_wiz.gif"
+ icon="$nl$/images/buttons/new-jaxb-project.gif"
category="org.eclipse.jpt.jaxb"
project="true">
<description>%newJaxbProjectWizardDesc</description>
@@ -84,7 +84,8 @@
id="jaxbCompletionProposals"
name="%jaxbCompletionProposals">
- <proposalCategory icon="icons/full/etool16/jaxb_facet.gif">
+ <proposalCategory
+ icon="$nl$/images/jaxb-facet.gif">
<enablement>
<with variable="project">
<adapt type="org.eclipse.core.resources.IProject">
@@ -236,7 +237,7 @@
name="%jaxbNavigatorContent"
priority="higher"
appearsBefore="org.eclipse.jst.servlet.ui.EnhancedJavaRendering"
- icon="icons/full/obj16/jaxb_content.gif"
+ icon="$nl$/images/objects/jaxb-content.gif"
activeByDefault="true"
contentProvider="org.eclipse.jpt.jaxb.ui.internal.navigator.JaxbNavigatorContentProvider"
labelProvider="org.eclipse.jpt.common.ui.internal.jface.NavigatorLabelProvider">
@@ -381,7 +382,7 @@
<extension
point="org.eclipse.wst.common.project.facet.ui.images">
- <image facet="jpt.jaxb" path="icons/full/etool16/jaxb_facet.gif"/>
+ <image facet="jpt.jaxb" path="$nl$/images/jaxb-facet.gif"/>
</extension>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/JptJaxbUiImages.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/JptJaxbUiImages.java
new file mode 100644
index 0000000000..dec7afa977
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/JptJaxbUiImages.java
@@ -0,0 +1,99 @@
+/*******************************************************************************
+ * Copyright (c) 2010, 2012 Oracle. All rights reserved.
+ * 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.jaxb.ui;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jpt.common.ui.JptCommonUiImages;
+import org.eclipse.jpt.jaxb.ui.internal.plugin.JptJaxbUiPlugin;
+
+/**
+ * Actually, just the image descriptors....
+ * <p>
+ * Code should use these constants to acquire (and release) the images provided
+ * by Dali. The images should be managed by a
+ * {@link org.eclipse.jface.resource.ResourceManager "local" resource manager}.
+ * <p>
+ * Also, the {@link org.eclipse.ui.IWorkbench Eclipse workbench} supplies more
+ * general purpose {@link org.eclipse.ui.ISharedImages images}.
+ *
+ * @see JptCommonUiImages
+ */
+// TODO add corresponding ImageDescriptorTest...
+@SuppressWarnings("nls")
+public final class JptJaxbUiImages {
+
+ // ********** directories **********
+
+ private static final String IMAGES_ = JptCommonUiImages.IMAGES_;
+ private static final String BUTTONS_ = JptCommonUiImages.BUTTONS_;
+ private static final String OBJECTS_ = JptCommonUiImages.OBJECTS_;
+ private static final String WIZARDS_ = JptCommonUiImages.WIZARDS_;
+
+
+ // ********** general **********
+
+ public static final ImageDescriptor JAXB_FACET = buildImageDescriptor(IMAGES_ + "jaxb-facet.gif");
+ public static final ImageDescriptor JAXB_CONTENT = buildImageDescriptor(OBJECTS_ + "jaxb-content.gif");
+
+ public static final ImageDescriptor DTD_FILE = buildImageDescriptor(OBJECTS_ + "dtd-file.gif");
+ public static final ImageDescriptor XSD_FILE = buildImageDescriptor(OBJECTS_ + "xsd-file.gif");
+
+
+ // ********** buttons **********
+
+ public static final ImageDescriptor NEW_CLASS = buildImageDescriptor(BUTTONS_ + "new-class.gif");
+ public static final ImageDescriptor NEW_JAXB_PROJECT = buildImageDescriptor(BUTTONS_ + "new-jaxb-project.gif");
+ public static final ImageDescriptor NEW_XSD = buildImageDescriptor(BUTTONS_ + "new-xsd.gif");
+
+
+ // ********** Java **********
+
+ public static final ImageDescriptor JAXB_PACKAGE = buildImageDescriptor(OBJECTS_ + "jaxb-package.gif");
+ public static final ImageDescriptor JAXB_CLASS = buildImageDescriptor(OBJECTS_ + "jaxb-class.gif");
+ public static final ImageDescriptor JAXB_ENUM = buildImageDescriptor(OBJECTS_ + "jaxb-enum.gif");
+ public static final ImageDescriptor JAXB_TRANSIENT_CLASS = buildImageDescriptor(OBJECTS_ + "jaxb-transient-class.gif");
+ public static final ImageDescriptor JAXB_TRANSIENT_ENUM = buildImageDescriptor(OBJECTS_ + "jaxb-transient-enum.gif");
+ public static final ImageDescriptor PERSISTENT_FIELD = buildImageDescriptor(OBJECTS_ + "persistent-field.gif");
+ public static final ImageDescriptor PERSISTENT_PROPERTY = buildImageDescriptor(OBJECTS_ + "persistent-property.gif");
+ public static final ImageDescriptor ENUM_CONSTANT = buildImageDescriptor(OBJECTS_ + "enum-constant.gif");
+
+
+ // ********** mappings **********
+
+ public static final ImageDescriptor JAXB_REGISTRY = buildImageDescriptor(OBJECTS_ + "jaxb-registry.gif");
+ public static final ImageDescriptor XML_ANY_ATTRIBUTE = buildImageDescriptor(OBJECTS_ + "xml-any-attribute.gif");
+ public static final ImageDescriptor XML_ANY_ELEMENT = buildImageDescriptor(OBJECTS_ + "xml-any-element.gif");
+ public static final ImageDescriptor XML_ATTRIBUTE = buildImageDescriptor(OBJECTS_ + "xml-attribute.gif");
+ public static final ImageDescriptor XML_ELEMENT = buildImageDescriptor(OBJECTS_ + "xml-element.gif");
+ public static final ImageDescriptor XML_ELEMENT_REF = buildImageDescriptor(OBJECTS_ + "xml-element-ref.gif");
+ public static final ImageDescriptor XML_ELEMENT_REFS = buildImageDescriptor(OBJECTS_ + "xml-element-refs.gif");
+ public static final ImageDescriptor XML_ELEMENTS = buildImageDescriptor(OBJECTS_ + "xml-elements.gif");
+ public static final ImageDescriptor XML_TRANSIENT = buildImageDescriptor(OBJECTS_ + "xml-transient.gif");
+ public static final ImageDescriptor XML_VALUE = buildImageDescriptor(OBJECTS_ + "xml-value.gif");
+ public static final ImageDescriptor NULL_ATTRIBUTE_MAPPING = buildImageDescriptor(OBJECTS_ + "null-attribute-mapping.gif");
+
+
+ // ********** wizard banners **********
+
+ public static final ImageDescriptor JAXB_PROJECT_BANNER = buildImageDescriptor(WIZARDS_ + "jaxb-project-banner.gif");
+ public static final ImageDescriptor SCHEMA_GEN_BANNER = buildImageDescriptor(WIZARDS_ + "schema-gen-banner.gif");
+ public static final ImageDescriptor CLASSES_GEN_BANNER = buildImageDescriptor(WIZARDS_ + "classes-gen-banner.gif");
+
+
+ // ********** misc **********
+
+ private static ImageDescriptor buildImageDescriptor(String path) {
+ return JptJaxbUiPlugin.instance().buildImageDescriptor(path);
+ }
+
+ private JptJaxbUiImages() {
+ throw new UnsupportedOperationException();
+ }
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbMappingImageHelper.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbMappingImageHelper.java
index b6836f5061..7e9866962b 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbMappingImageHelper.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbMappingImageHelper.java
@@ -9,70 +9,45 @@
******************************************************************************/
package org.eclipse.jpt.jaxb.ui.internal;
+import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.ui.internal.plugin.JptJaxbUiPlugin;
-import org.eclipse.swt.graphics.Image;
+import org.eclipse.jpt.jaxb.ui.JptJaxbUiImages;
-public class JaxbMappingImageHelper
-{
-//
-// public static Image imageForTypeMapping(String mappingKey) {
-// return JptUiPlugin.getImage(iconKeyForTypeMapping(mappingKey));
-// }
-//
-// public static String iconKeyForTypeMapping(String mappingKey) {
-// if (MappingKeys.NULL_TYPE_MAPPING_KEY == mappingKey) {
-// return JptUiIcons.NULL_TYPE_MAPPING;
-// }
-// else if (MappingKeys.ENTITY_TYPE_MAPPING_KEY.equals(mappingKey)) {
-// return JptUiIcons.ENTITY;
-// }
-// else if (MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY.equals(mappingKey)) {
-// return JptUiIcons.EMBEDDABLE;
-// }
-// else if (MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY.equals(mappingKey)) {
-// return JptUiIcons.MAPPED_SUPERCLASS;
-// }
-// return null;
-// }
+public class JaxbMappingImageHelper {
- public static Image imageForAttributeMapping(String mappingKey) {
- return JptJaxbUiPlugin.instance().getImage(iconKeyForAttributeMapping(mappingKey));
- }
-
- public static String iconKeyForAttributeMapping(String mappingKey) {
+ public static ImageDescriptor imageDescriptorForAttributeMapping(String mappingKey) {
if (MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY == mappingKey) {
- return JptJaxbUiIcons.NULL_ATTRIBUTE_MAPPING;
+ return JptJaxbUiImages.NULL_ATTRIBUTE_MAPPING;
}
- else if (MappingKeys.XML_ANY_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptJaxbUiIcons.XML_ANY_ATTRIBUTE;
+ if (MappingKeys.XML_ANY_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
+ return JptJaxbUiImages.XML_ANY_ATTRIBUTE;
}
- else if (MappingKeys.XML_ANY_ELEMENT_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptJaxbUiIcons.XML_ANY_ELEMENT;
+ if (MappingKeys.XML_ANY_ELEMENT_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
+ return JptJaxbUiImages.XML_ANY_ELEMENT;
}
- else if (MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptJaxbUiIcons.XML_ATTRIBUTE;
+ if (MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
+ return JptJaxbUiImages.XML_ATTRIBUTE;
}
- else if (MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptJaxbUiIcons.XML_ELEMENT;
+ if (MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
+ return JptJaxbUiImages.XML_ELEMENT;
}
- else if (MappingKeys.XML_ELEMENT_REF_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptJaxbUiIcons.XML_ELEMENT_REF;
+ if (MappingKeys.XML_ELEMENT_REF_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
+ return JptJaxbUiImages.XML_ELEMENT_REF;
}
- else if (MappingKeys.XML_ELEMENT_REFS_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptJaxbUiIcons.XML_ELEMENT_REFS;
+ if (MappingKeys.XML_ELEMENT_REFS_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
+ return JptJaxbUiImages.XML_ELEMENT_REFS;
}
- else if (MappingKeys.XML_ELEMENTS_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptJaxbUiIcons.XML_ELEMENTS;
+ if (MappingKeys.XML_ELEMENTS_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
+ return JptJaxbUiImages.XML_ELEMENTS;
}
- else if (MappingKeys.XML_TRANSIENT_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptJaxbUiIcons.XML_TRANSIENT;
+ if (MappingKeys.XML_TRANSIENT_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
+ return JptJaxbUiImages.XML_TRANSIENT;
}
- else if (MappingKeys.XML_VALUE_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptJaxbUiIcons.XML_VALUE;
+ if (MappingKeys.XML_VALUE_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
+ return JptJaxbUiImages.XML_VALUE;
}
//return the JAXB_CONTENT icon instead of null, might as well have an icon if one is not defined
- return JptJaxbUiIcons.JAXB_CONTENT;
+ return JptJaxbUiImages.JAXB_CONTENT;
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JptJaxbUiIcons.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JptJaxbUiIcons.java
deleted file mode 100644
index 693c3ec187..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JptJaxbUiIcons.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2011 Oracle. All rights reserved.
-* 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.jaxb.ui.internal;
-
-@SuppressWarnings("nls")
-public class JptJaxbUiIcons {
-
- // **************** General icons **************************************
-
- public static final String JAXB_CONTENT = "full/obj16/jaxb_content";
- public static final String PACKAGE = "full/obj16/package";
-
- public static final String JAXB_CLASS = "full/obj16/jaxb_class";
- public static final String JAXB_ENUM = "full/obj16/jaxb_enum";
- public static final String JAXB_TRANSIENT_CLASS = "full/obj16/jaxb_transient_class";
- public static final String JAXB_TRANSIENT_ENUM = "full/obj16/jaxb_transient_enum";
- public static final String JAXB_REGISTRY = "full/obj16/jaxb_registry";
-
- public static final String XML_ANY_ATTRIBUTE = "full/obj16/xml-any-attribute";
- public static final String XML_ANY_ELEMENT = "full/obj16/xml-any-element";
- public static final String XML_ATTRIBUTE = "full/obj16/xml-attribute";
- public static final String XML_ELEMENT = "full/obj16/xml-element";
- public static final String XML_ELEMENT_REF = "full/obj16/xml-element-ref";
- public static final String XML_ELEMENT_REFS = "full/obj16/xml-element-refs";
- public static final String XML_ELEMENTS = "full/obj16/xml-elements";
-
- public static final String XML_TRANSIENT = "full/obj16/xml-transient";
- public static final String XML_VALUE = "full/obj16/xml-value";
- public static final String NULL_ATTRIBUTE_MAPPING = "full/obj16/null-attribute-mapping";
-
- public static final String PERSISTENT_FIELD = "full/obj16/persistent_field";
- public static final String PERSISTENT_PROPERTY = "full/obj16/persistent_property";
- public static final String ENUM_CONSTANT = "full/obj16/enum_constant";
-
-
- // **************** Wizard icons *******************************************
-
- public static final String SCHEMA_GEN = "full/wizban/NewXSD";
-
- public static final String SCHEMA_GEN_WIZ_BANNER = "full/wizban/NewXSD";
- public static final String CLASSES_GEN_WIZ_BANNER = "full/wizban/newclass_wiz";
- public static final String JAXB_WIZ_BANNER = "full/wizban/new_jaxb_prj_wiz";
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorItemLabelProviderFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorItemLabelProviderFactory.java
index 33cb0dea08..82da87aa75 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorItemLabelProviderFactory.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorItemLabelProviderFactory.java
@@ -18,9 +18,8 @@ import org.eclipse.jpt.jaxb.core.context.JaxbEnum;
import org.eclipse.jpt.jaxb.core.context.JaxbEnumConstant;
import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiIcons;
+import org.eclipse.jpt.jaxb.ui.JptJaxbUiImages;
import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
-import org.eclipse.jpt.jaxb.ui.internal.plugin.JptJaxbUiPlugin;
public class GenericJaxb_2_1_NavigatorItemLabelProviderFactory
@@ -65,11 +64,12 @@ public class GenericJaxb_2_1_NavigatorItemLabelProviderFactory
return null;
}
- protected ItemExtendedLabelProvider buildJaxbContextRootProvider(JaxbContextRoot root, @SuppressWarnings("unused") ItemExtendedLabelProvider.Manager manager) {
+ protected ItemExtendedLabelProvider buildJaxbContextRootProvider(JaxbContextRoot root, ItemExtendedLabelProvider.Manager manager) {
return new StaticItemExtendedLabelProvider(
- JptJaxbUiPlugin.instance().getImage(JptJaxbUiIcons.JAXB_CONTENT),
+ JptJaxbUiImages.JAXB_CONTENT,
JptJaxbUiMessages.JaxbContent_label,
- this.buildJaxbContextRootDescription(root)
+ this.buildJaxbContextRootDescription(root),
+ manager
);
}
@@ -81,18 +81,20 @@ public class GenericJaxb_2_1_NavigatorItemLabelProviderFactory
return sb.toString();
}
- protected ItemExtendedLabelProvider buildJaxbEnumConstantProvider(JaxbEnumConstant enumConstant, @SuppressWarnings("unused") ItemExtendedLabelProvider.Manager manager) {
+ protected ItemExtendedLabelProvider buildJaxbEnumConstantProvider(JaxbEnumConstant enumConstant, ItemExtendedLabelProvider.Manager manager) {
return new StaticItemExtendedLabelProvider(
- JptJaxbUiPlugin.instance().getImage(JptJaxbUiIcons.ENUM_CONSTANT),
- enumConstant.getName()
+ JptJaxbUiImages.ENUM_CONSTANT,
+ enumConstant.getName(),
+ manager
);
}
- protected ItemExtendedLabelProvider buildJaxbPackageProvider(JaxbPackage pkg, @SuppressWarnings("unused") ItemExtendedLabelProvider.Manager manager) {
+ protected ItemExtendedLabelProvider buildJaxbPackageProvider(JaxbPackage pkg, ItemExtendedLabelProvider.Manager manager) {
return new StaticItemExtendedLabelProvider(
- JptJaxbUiPlugin.instance().getImage(JptJaxbUiIcons.PACKAGE),
+ JptJaxbUiImages.JAXB_PACKAGE,
pkg.getName(),
- this.buildJaxbPackageDescription(pkg)
+ this.buildJaxbPackageDescription(pkg),
+ manager
);
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbClassItemLabelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbClassItemLabelProvider.java
index 6215510d1d..6570d9a396 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbClassItemLabelProvider.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbClassItemLabelProvider.java
@@ -9,7 +9,8 @@
******************************************************************************/
package org.eclipse.jpt.jaxb.ui.internal.jaxb21;
-import org.eclipse.jpt.common.ui.jface.ItemLabelProvider;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jpt.common.ui.jface.ItemExtendedLabelProvider;
import org.eclipse.jpt.common.utility.internal.model.value.AspectPropertyValueModelAdapter;
import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
import org.eclipse.jpt.common.utility.internal.model.value.StaticPropertyValueModel;
@@ -20,27 +21,25 @@ import org.eclipse.jpt.jaxb.core.context.JaxbClass;
import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
import org.eclipse.jpt.jaxb.core.context.JaxbType;
import org.eclipse.jpt.jaxb.core.context.JaxbTypeMapping;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiIcons;
-import org.eclipse.jpt.jaxb.ui.internal.plugin.JptJaxbUiPlugin;
-import org.eclipse.swt.graphics.Image;
+import org.eclipse.jpt.jaxb.ui.JptJaxbUiImages;
public class JaxbClassItemLabelProvider
extends JaxbTypeItemLabelProvider<JaxbClass>
{
- public JaxbClassItemLabelProvider(JaxbClass jaxbPersistentClass, ItemLabelProvider.Manager manager) {
+ public JaxbClassItemLabelProvider(JaxbClass jaxbPersistentClass, ItemExtendedLabelProvider.Manager manager) {
super(jaxbPersistentClass, manager);
}
@Override
- protected PropertyValueModel<Image> buildImageModel() {
- return new JaxbClassImageModel(this.item);
+ protected PropertyValueModel<ImageDescriptor> buildImageDescriptorModel() {
+ return new JaxbClassImageDescriptorModel(this.item);
}
- protected class JaxbClassImageModel
- extends AspectPropertyValueModelAdapter<JaxbClass, Image> {
+ protected class JaxbClassImageDescriptorModel
+ extends AspectPropertyValueModelAdapter<JaxbClass, ImageDescriptor> {
protected final PropertyValueModel<Boolean> isXmlRegistryModel;
@@ -51,7 +50,7 @@ public class JaxbClassItemLabelProvider
protected final PropertyChangeListener propertyChangeListener;
- public JaxbClassImageModel(JaxbClass subject) {
+ public JaxbClassImageDescriptorModel(JaxbClass subject) {
super(new StaticPropertyValueModel<JaxbClass>(subject));
this.isXmlRegistryModel = buildIsXmlRegistryModel();
this.mappingModel = buildMappingModel();
@@ -91,22 +90,20 @@ public class JaxbClassItemLabelProvider
// transform the subject's property change events into VALUE property change events
return new PropertyChangeListener() {
public void propertyChanged(PropertyChangeEvent event) {
- JaxbClassImageModel.this.aspectChanged();
+ JaxbClassImageDescriptorModel.this.aspectChanged();
}
};
}
@Override
- protected Image buildValue_() {
- if (this.mappingModel.getValue() != null) {
- if (this.isXmlTransientModel.getValue() == Boolean.TRUE) {
- return JptJaxbUiPlugin.instance().getImage(JptJaxbUiIcons.JAXB_TRANSIENT_CLASS);
- }
+ protected ImageDescriptor buildValue_() {
+ if ((this.mappingModel.getValue() != null) && (this.isXmlTransientModel.getValue() == Boolean.TRUE)) {
+ return JptJaxbUiImages.JAXB_TRANSIENT_CLASS;
}
- else if (this.isXmlRegistryModel.getValue() == Boolean.TRUE) {
- return JptJaxbUiPlugin.instance().getImage(JptJaxbUiIcons.JAXB_REGISTRY);
+ if (this.isXmlRegistryModel.getValue() == Boolean.TRUE) {
+ return JptJaxbUiImages.JAXB_REGISTRY;
}
- return JptJaxbUiPlugin.instance().getImage(JptJaxbUiIcons.JAXB_CLASS);
+ return JptJaxbUiImages.JAXB_CLASS;
}
@Override
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbEnumItemLabelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbEnumItemLabelProvider.java
index bdef1b1d44..8eb8e7011b 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbEnumItemLabelProvider.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbEnumItemLabelProvider.java
@@ -9,7 +9,8 @@
******************************************************************************/
package org.eclipse.jpt.jaxb.ui.internal.jaxb21;
-import org.eclipse.jpt.common.ui.jface.ItemLabelProvider;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jpt.common.ui.jface.ItemExtendedLabelProvider;
import org.eclipse.jpt.common.utility.internal.model.value.AspectPropertyValueModelAdapter;
import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
import org.eclipse.jpt.common.utility.internal.model.value.StaticPropertyValueModel;
@@ -19,27 +20,25 @@ import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.jaxb.core.context.JaxbEnum;
import org.eclipse.jpt.jaxb.core.context.JaxbEnumMapping;
import org.eclipse.jpt.jaxb.core.context.JaxbType;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiIcons;
-import org.eclipse.jpt.jaxb.ui.internal.plugin.JptJaxbUiPlugin;
-import org.eclipse.swt.graphics.Image;
+import org.eclipse.jpt.jaxb.ui.JptJaxbUiImages;
public class JaxbEnumItemLabelProvider
extends JaxbTypeItemLabelProvider<JaxbEnum>
{
- public JaxbEnumItemLabelProvider(JaxbEnum jaxbEnum, ItemLabelProvider.Manager manager) {
+ public JaxbEnumItemLabelProvider(JaxbEnum jaxbEnum, ItemExtendedLabelProvider.Manager manager) {
super(jaxbEnum, manager);
}
@Override
- protected PropertyValueModel<Image> buildImageModel() {
- return new JaxbEnumImageModel(this.item);
+ protected PropertyValueModel<ImageDescriptor> buildImageDescriptorModel() {
+ return new JaxbEnumImageDescriptorModel(this.item);
}
- protected class JaxbEnumImageModel
- extends AspectPropertyValueModelAdapter<JaxbEnum, Image> {
+ protected class JaxbEnumImageDescriptorModel
+ extends AspectPropertyValueModelAdapter<JaxbEnum, ImageDescriptor> {
protected final PropertyValueModel<JaxbEnumMapping> mappingModel;
@@ -48,7 +47,7 @@ public class JaxbEnumItemLabelProvider
protected final PropertyChangeListener propertyChangeListener;
- public JaxbEnumImageModel(JaxbEnum subject) {
+ public JaxbEnumImageDescriptorModel(JaxbEnum subject) {
super(new StaticPropertyValueModel<JaxbEnum>(subject));
this.mappingModel = buildMappingModel();
this.isXmlTransientModel = buildIsXmlTransientModel();
@@ -78,19 +77,17 @@ public class JaxbEnumItemLabelProvider
// transform the subject's property change events into VALUE property change events
return new PropertyChangeListener() {
public void propertyChanged(PropertyChangeEvent event) {
- JaxbEnumImageModel.this.aspectChanged();
+ JaxbEnumImageDescriptorModel.this.aspectChanged();
}
};
}
@Override
- protected Image buildValue_() {
- if (this.mappingModel.getValue() != null) {
- if (this.isXmlTransientModel.getValue() == Boolean.TRUE) {
- return JptJaxbUiPlugin.instance().getImage(JptJaxbUiIcons.JAXB_TRANSIENT_ENUM);
- }
+ protected ImageDescriptor buildValue_() {
+ if ((this.mappingModel.getValue() != null) && (this.isXmlTransientModel.getValue() == Boolean.TRUE)) {
+ return JptJaxbUiImages.JAXB_TRANSIENT_ENUM;
}
- return JptJaxbUiPlugin.instance().getImage(JptJaxbUiIcons.JAXB_ENUM);
+ return JptJaxbUiImages.JAXB_ENUM;
}
@Override
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentAttributeItemLabelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentAttributeItemLabelProvider.java
index 0c1ee41d75..9064b8febd 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentAttributeItemLabelProvider.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentAttributeItemLabelProvider.java
@@ -9,13 +9,13 @@
******************************************************************************/
package org.eclipse.jpt.jaxb.ui.internal.jaxb21;
+import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jpt.common.ui.internal.jface.AbstractItemExtendedLabelProvider;
-import org.eclipse.jpt.common.ui.jface.ItemLabelProvider;
+import org.eclipse.jpt.common.ui.jface.ItemExtendedLabelProvider;
import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
import org.eclipse.jpt.jaxb.ui.internal.JaxbMappingImageHelper;
-import org.eclipse.swt.graphics.Image;
public class JaxbPersistentAttributeItemLabelProvider
@@ -24,24 +24,24 @@ public class JaxbPersistentAttributeItemLabelProvider
protected final String text;
protected final String description;
- public JaxbPersistentAttributeItemLabelProvider(JaxbPersistentAttribute attribute, ItemLabelProvider.Manager manager) {
+ public JaxbPersistentAttributeItemLabelProvider(JaxbPersistentAttribute attribute, ItemExtendedLabelProvider.Manager manager) {
super(attribute, manager);
this.text = this.buildText();
this.description = this.buildDescription();
}
@Override
- protected PropertyValueModel<Image> buildImageModel() {
- return new PropertyAspectAdapter<JaxbPersistentAttribute, Image>(IMAGE_ASPECT_NAMES, this.item) {
+ protected PropertyValueModel<ImageDescriptor> buildImageDescriptorModel() {
+ return new PropertyAspectAdapter<JaxbPersistentAttribute, ImageDescriptor>(IMAGE_ASPECT_NAMES, this.item) {
@Override
- protected Image buildValue_() {
- return JaxbPersistentAttributeItemLabelProvider.this.buildImage(this.subject.getMappingKey());
+ protected ImageDescriptor buildValue_() {
+ return JaxbPersistentAttributeItemLabelProvider.this.buildImageDescriptor(this.subject.getMappingKey());
}
};
}
- protected Image buildImage(String mappingKey) {
- return JaxbMappingImageHelper.imageForAttributeMapping(mappingKey);
+ protected ImageDescriptor buildImageDescriptor(String mappingKey) {
+ return JaxbMappingImageHelper.imageDescriptorForAttributeMapping(mappingKey);
}
protected static final String[] IMAGE_ASPECT_NAMES = new String[] {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbTypeItemLabelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbTypeItemLabelProvider.java
index e08db985c7..254717e202 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbTypeItemLabelProvider.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbTypeItemLabelProvider.java
@@ -10,7 +10,7 @@
package org.eclipse.jpt.jaxb.ui.internal.jaxb21;
import org.eclipse.jpt.common.ui.internal.jface.AbstractItemExtendedLabelProvider;
-import org.eclipse.jpt.common.ui.jface.ItemLabelProvider;
+import org.eclipse.jpt.common.ui.jface.ItemExtendedLabelProvider;
import org.eclipse.jpt.jaxb.core.context.JaxbType;
@@ -20,7 +20,7 @@ public abstract class JaxbTypeItemLabelProvider<I extends JaxbType>
protected final String text;
protected final String description;
- protected JaxbTypeItemLabelProvider(I jaxbType, ItemLabelProvider.Manager manager) {
+ protected JaxbTypeItemLabelProvider(I jaxbType, ItemExtendedLabelProvider.Manager manager) {
super(jaxbType, manager);
this.text = this.buildText();
this.description = this.buildDescription();
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorContentProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorContentProvider.java
index efa396858a..e2dbcdb06e 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorContentProvider.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorContentProvider.java
@@ -16,6 +16,9 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.resource.LocalResourceManager;
+import org.eclipse.jface.resource.ResourceManager;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jpt.common.ui.internal.jface.NavigatorContentProvider;
@@ -70,6 +73,15 @@ public class JaxbNavigatorContentProvider
}
@Override
+ protected ResourceManager buildResourceManager() {
+ return new LocalResourceManager(this.getParentResourceManager());
+ }
+
+ protected ResourceManager getParentResourceManager() {
+ return JFaceResources.getResources();
+ }
+
+ @Override
public void inputChanged(Viewer v, Object oldInput, Object newInput) {
super.inputChanged(v, oldInput, newInput);
this.viewer = (StructuredViewer) v;
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbSchemasPropertiesPage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbSchemasPropertiesPage.java
index cbd7f4b5bf..c84c2f3cb8 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbSchemasPropertiesPage.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbSchemasPropertiesPage.java
@@ -35,6 +35,7 @@ import org.eclipse.jface.dialogs.TrayDialog;
import org.eclipse.jface.layout.TableColumnLayout;
import org.eclipse.jface.operation.IRunnableContext;
import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.resource.ResourceManager;
import org.eclipse.jface.viewers.ColumnViewerToolTipSupport;
import org.eclipse.jface.viewers.ColumnWeightData;
import org.eclipse.jface.viewers.ITableLabelProvider;
@@ -97,6 +98,7 @@ public class JaxbSchemasPropertiesPage
private static final int SIZING_SELECTION_PANE_WIDTH = 450;
+ private final ResourceManager resourceManager;
protected final ModifiablePropertyValueModel<IProject> projectModel;
@@ -109,8 +111,9 @@ public class JaxbSchemasPropertiesPage
private final ModifiableCollectionValueModel<Schema> schemasSelectionModel;
- public JaxbSchemasPropertiesPage() {
+ public JaxbSchemasPropertiesPage(ResourceManager resourceManager) {
super();
+ this.resourceManager = resourceManager;
this.projectModel = new SimplePropertyValueModel<IProject>();
this.jaxbProjectModel = new JaxbProjectModel(this.projectModel);
this.trigger = new BufferedModifiablePropertyValueModel.Trigger();
@@ -266,7 +269,8 @@ public class JaxbSchemasPropertiesPage
new AddEditSchemaDialog(
getShell(),
null,
- this.schemasModel.getAspectValue());
+ this.schemasModel.getAspectValue(),
+ this.resourceManager);
// opens the dialog - just returns if the user cancels it
if (dialog.open() == Window.CANCEL) {
@@ -296,7 +300,8 @@ public class JaxbSchemasPropertiesPage
new AddEditSchemaDialog(
getShell(),
schema,
- this.schemasModel.getAspectValue());
+ this.schemasModel.getAspectValue(),
+ this.resourceManager);
// opens the dialog - just returns if the user cancels it
if (dialog.open() == Window.CANCEL) {
@@ -412,12 +417,6 @@ public class JaxbSchemasPropertiesPage
this.trigger.reset();
}
- @Override
- public void dispose() {
-
- super.dispose();
- }
-
static class SchemasModel
extends AspectAdapter<JaxbProject, Collection<Schema>>
@@ -712,7 +711,9 @@ public class JaxbSchemasPropertiesPage
static class AddEditSchemaDialog
extends TitleAreaDialog {
- private Schema currentSchema;
+ private final ResourceManager resourceManager;
+
+ private final Schema currentSchema;
private String defaultMessage;
@@ -724,11 +725,12 @@ public class JaxbSchemasPropertiesPage
private final Mode mode;
- private Iterable<Schema> allSchemas;
+ private final Iterable<Schema> allSchemas;
- public AddEditSchemaDialog(Shell shell, Schema currentSchema, Iterable<Schema> allSchemas) {
+ public AddEditSchemaDialog(Shell shell, Schema currentSchema, Iterable<Schema> allSchemas, ResourceManager resourceManager) {
super(shell);
+ this.resourceManager = resourceManager;
this.currentSchema = currentSchema;
this.allSchemas = allSchemas;
this.location = new SimplePropertyValueModel<String>();
@@ -840,7 +842,7 @@ public class JaxbSchemasPropertiesPage
}
private void browseForSchemaLocation() {
- SchemaLocationDialog dialog = new SchemaLocationDialog(getShell());
+ SchemaLocationDialog dialog = new SchemaLocationDialog(getShell(), this.resourceManager);
// opens the dialog - just returns if the user cancels it
if (dialog.open() == Window.CANCEL) {
@@ -918,13 +920,16 @@ public class JaxbSchemasPropertiesPage
static class SchemaLocationDialog
extends TrayDialog {
+ private final ResourceManager resourceManager;
+
private SelectFileOrXMLCatalogIdPanel locationPanel;
private String location;
- public SchemaLocationDialog(Shell shell) {
+ public SchemaLocationDialog(Shell shell, ResourceManager resourceManager) {
super(shell);
+ this.resourceManager = resourceManager;
}
@@ -938,7 +943,7 @@ public class JaxbSchemasPropertiesPage
protected Control createDialogArea(Composite parent) {
Composite composite = (Composite) super.createDialogArea(parent);
- this.locationPanel = new SelectFileOrXMLCatalogIdPanel(composite, StructuredSelection.EMPTY);
+ this.locationPanel = new SelectFileOrXMLCatalogIdPanel(composite, StructuredSelection.EMPTY, this.resourceManager);
this.locationPanel.setFilterExtensions(new String[] {".xsd"}); //$NON-NLS-1$
this.locationPanel.update();
this.locationPanel.setVisibleHelper(true);
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizard.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizard.java
index 6bfdc368ab..11a23559c4 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizard.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizard.java
@@ -23,6 +23,9 @@ import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.resource.LocalResourceManager;