Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2014-08-21 11:43:07 +0000
committerCamille Letavernier2014-08-21 13:50:25 +0000
commitdbc038b44bcbb890ae256d15eb09eb285512f020 (patch)
tree757e736583eea3ae352ad9ac91a81df7e59b79ff /plugins/customization
parentea48a20561464c3cbb7895d430583669a9f82fcc (diff)
downloadorg.eclipse.papyrus-dbc038b44bcbb890ae256d15eb09eb285512f020.tar.gz
org.eclipse.papyrus-dbc038b44bcbb890ae256d15eb09eb285512f020.tar.xz
org.eclipse.papyrus-dbc038b44bcbb890ae256d15eb09eb285512f020.zip
[Code style] Apply clean-up and formatter on Main plug-ins
Diffstat (limited to 'plugins/customization')
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/Messages.java2
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/AspectActionsInformationComposite.java120
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/BundleExplorerDialog.java32
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/BundleIconExplorerDialog.java89
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/ConfigurationInformationComposite.java45
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/DrawerInformationPage.java61
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/ExtendedPaletteContentPage.java1008
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/ExtendedPaletteInformationPage.java84
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/LocalPaletteContentPage.java659
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/LocalPaletteInformationPage.java94
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/NewDrawerWizard.java6
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/NewLocalPaletteWizard.java6
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/PaletteAspectToolEntryProxy.java40
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/PaletteContainerProxy.java22
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/PaletteEntryProxy.java94
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/PaletteEntryProxyInformationComposite.java47
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/PaletteLocalDrawerProxy.java32
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/PaletteLocalSeparatorProxy.java2
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/PaletteLocalStackProxy.java2
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/PapyrusPaletteCustomizerDialog.java195
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/UpdateExtendedPaletteWizard.java14
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/UpdateLocalDrawerWizard.java6
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/UpdateLocalPaletteWizard.java8
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/handler/AbstractDeployPaletteConfigurationHandler.java188
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/handler/AbstractUndeployPaletteConfigurationHandler.java58
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/handler/DeployExtendedPaletteConfigurationHandler.java6
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/handler/DeployPaletteConfigurationHandler.java4
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/handler/UndeployExtendedPaletteConfigurationHandler.java6
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/handler/UndeployPaletteConfigurationHandler.java2
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/proxies/XMLPaletteDefinitionProxyFactory.java27
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/Activator.java2
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/queries/GetDrawerLabelQuery.java2
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/queries/GetIconQuery.java4
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/queries/GetToolLabelQuery.java4
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/queries/HasIconQuery.java5
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/ContextElement.java13
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/FieldSelection.java6
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/FieldSelectionFactory.java8
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/FieldSelectionPackage.java48
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/PropertyDefinition.java21
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/impl/ContextElementImpl.java103
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/impl/FieldSelectionFactoryImpl.java53
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/impl/FieldSelectionImpl.java69
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/impl/FieldSelectionPackageImpl.java93
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/impl/PropertyDefinitionImpl.java104
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/util/FieldSelectionAdapterFactory.java56
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/util/FieldSelectionSwitch.java66
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/Activator.java22
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/extensionpoint/GeneratorExtensionPoint.java10
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/extensionpoint/LayoutExtensionPoint.java12
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/AbstractQVTGenerator.java48
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/EcoreGenerator.java92
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/EditContextGenerator.java6
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/IGenerator.java6
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/ProfileGenerator.java92
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/layout/ILayoutGenerator.java18
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/layout/ProfileWithDatatypes.java66
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/layout/StandardLayoutGenerator.java50
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/messages/Messages.java2
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/providers/DataContextPropertiesContentProvider.java4
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/providers/DataContextPropertiesLabelProvider.java72
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/validators/AbstractValidator.java6
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/validators/SourceValidator.java14
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/validators/TargetValidator.java19
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/AbstractCreateContextPage.java22
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/CreateContextMainPage.java14
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/CreateContextWizard.java83
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/GeneratorPage.java44
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/SelectFieldsPage.java138
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/SelectOutputPage.java32
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/widget/ExtensionFilter.java20
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/widget/FileChooser.java46
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/widget/TernaryButton.java58
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src-gen/org/eclipse/papyrus/customization/properties/model/xwt/xwtxml/Attribute.java14
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src-gen/org/eclipse/papyrus/customization/properties/model/xwt/xwtxml/CDATA.java4
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src-gen/org/eclipse/papyrus/customization/properties/model/xwt/xwtxml/Comment.java4
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src-gen/org/eclipse/papyrus/customization/properties/model/xwt/xwtxml/DocumentTypeDeclaration.java24
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src-gen/org/eclipse/papyrus/customization/properties/model/xwt/xwtxml/Element.java10
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src-gen/org/eclipse/papyrus/customization/properties/model/xwt/xwtxml/Namespace.java4
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src-gen/org/eclipse/papyrus/customization/properties/model/xwt/xwtxml/Node.java24
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src-gen/org/eclipse/papyrus/customization/properties/model/xwt/xwtxml/ProcessingInstruction.java14
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src-gen/org/eclipse/papyrus/customization/properties/model/xwt/xwtxml/Root.java26
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src-gen/org/eclipse/papyrus/customization/properties/model/xwt/xwtxml/Text.java4
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src-gen/org/eclipse/papyrus/customization/properties/model/xwt/xwtxml/XwtxmlFactory.java18
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src-gen/org/eclipse/papyrus/customization/properties/model/xwt/xwtxml/XwtxmlPackage.java133
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src-gen/org/eclipse/papyrus/customization/properties/model/xwt/xwtxml/impl/AttributeImpl.java48
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src-gen/org/eclipse/papyrus/customization/properties/model/xwt/xwtxml/impl/CDATAImpl.java8
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src-gen/org/eclipse/papyrus/customization/properties/model/xwt/xwtxml/impl/CommentImpl.java8
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src-gen/org/eclipse/papyrus/customization/properties/model/xwt/xwtxml/impl/DocumentTypeDeclarationImpl.java79
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src-gen/org/eclipse/papyrus/customization/properties/model/xwt/xwtxml/impl/ElementImpl.java49
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src-gen/org/eclipse/papyrus/customization/properties/model/xwt/xwtxml/impl/NamespaceImpl.java8
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src-gen/org/eclipse/papyrus/customization/properties/model/xwt/xwtxml/impl/NodeImpl.java121
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src-gen/org/eclipse/papyrus/customization/properties/model/xwt/xwtxml/impl/ProcessingInstructionImpl.java48
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src-gen/org/eclipse/papyrus/customization/properties/model/xwt/xwtxml/impl/RootImpl.java130
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src-gen/org/eclipse/papyrus/customization/properties/model/xwt/xwtxml/impl/TextImpl.java8
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src-gen/org/eclipse/papyrus/customization/properties/model/xwt/xwtxml/impl/XwtxmlFactoryImpl.java69
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src-gen/org/eclipse/papyrus/customization/properties/model/xwt/xwtxml/impl/XwtxmlPackageImpl.java125
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src-gen/org/eclipse/papyrus/customization/properties/model/xwt/xwtxml/util/XwtxmlAdapterFactory.java132
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src-gen/org/eclipse/papyrus/customization/properties/model/xwt/xwtxml/util/XwtxmlSwitch.java229
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src/org/eclipse/papyrus/customization/properties/model/xwt/Activator.java4
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src/org/eclipse/papyrus/customization/properties/model/xwt/format/XMLFormatter.java6
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src/org/eclipse/papyrus/customization/properties/model/xwt/modisco/GenericXMLHandler.java50
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src/org/eclipse/papyrus/customization/properties/model/xwt/modisco/GenericXMLResourceImpl.java12
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src/org/eclipse/papyrus/customization/properties/model/xwt/modisco/GenericXMLWriter.java60
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src/org/eclipse/papyrus/customization/properties/model/xwt/resource/XWTModelFactory.java5
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src/org/eclipse/papyrus/customization/properties/model/xwt/resource/XWTResource.java38
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/Activator.java68
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/editor/ContextEditorActionBarContributor.java144
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/editor/MoDiscoDropAdapter.java10
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/editor/ResourceEditorInput.java11
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/editor/UIEditor.java113
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/editor/ViewFilter.java40
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/editor/actions/CompoundCommandActionDelegate.java24
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/editor/actions/CreateResourceCommand.java25
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/editor/actions/CreateSectionAction.java52
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/editor/actions/CreateSectionWidgetAction.java24
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/editor/actions/MoDiscoCopyAction.java8
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/editor/actions/MoDiscoCutAction.java10
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/editor/actions/MoDiscoDeleteAction.java28
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/editor/actions/MoDiscoPasteAction.java10
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/editor/actions/StrictCompoundCommandActionDelegate.java24
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/editor/actions/ToggleDataContextAction.java13
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/editor/actions/ToggleDataContextState.java2
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/editor/actions/TogglePreviewAction.java23
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/editor/actions/TogglePreviewState.java109
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/editor/actions/ValidationAction.java6
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/editor/preview/Preview.java146
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/messages/Messages.java4
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/modelelement/CustomizationModelElement.java50
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/modelelement/CustomizationModelElementFactory.java12
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/modelelement/GenericAttributeModelElement.java37
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/modelelement/GenericAttributeModelElementFactory.java18
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/modelelement/GenericAttributeObservable.java55
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/modelelement/GenericPropertyModelElementFactory.java18
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/modelelement/SectionNameObservableValue.java32
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/perspective/CustomizationPerspectiveFactory.java5
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/preferences/CustomizationPreferencePage.java29
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/preferences/CustomizationPreferencesInitializer.java4
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/providers/AbstractContextualContentProvider.java12
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/providers/ConstraintDescriptorContentProvider.java26
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/providers/ContextContentProvider.java14
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/providers/ContextLabelProvider.java58
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/providers/DataContextElementContentProvider.java39
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/providers/DependencyContentProvider.java12
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/providers/EnvironmentContentProvider.java10
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/providers/PropertyContentProvider.java50
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/providers/PropertyEditorTypeContentProvider.java16
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/providers/TabContentProvider.java20
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/query/DataContextsImageQuery.java5
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/query/ShowContextQuery.java4
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/query/ViewsImageQuery.java5
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/storage/actions/AbstractContextStorageActionProvider.java11
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/storage/actions/ContextStorageActionRegistry.java19
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/storage/actions/ContextStorageActionUtil.java32
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/storage/actions/IContextCopyAction.java23
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/storage/actions/IContextDeleteAction.java17
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/storage/actions/IContextEditAction.java17
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/storage/actions/IContextStorageActionProvider.java17
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/storage/actions/workspace/WorkspaceContextCopyAction.java66
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/storage/actions/workspace/WorkspaceContextDeleteAction.java18
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/storage/actions/workspace/WorkspaceContextEditAction.java12
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/storage/actions/workspace/WorkspaceContextStorageActionProvider.java6
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/ui/CopyContextAction.java22
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/ui/CustomizationDialog.java107
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/ui/EditContextAction.java11
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/ui/OpenCustomization.java8
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/ui/RemoveContextAction.java10
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/util/ActionUtil.java12
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/util/ProjectUtil.java34
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src-gen/org/eclipse/papyrus/customization/model/customizationplugin/CustomizableElement.java6
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src-gen/org/eclipse/papyrus/customization/model/customizationplugin/CustomizationConfiguration.java18
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src-gen/org/eclipse/papyrus/customization/model/customizationplugin/CustomizationPluginFactory.java26
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src-gen/org/eclipse/papyrus/customization/model/customizationplugin/CustomizationPluginPackage.java127
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src-gen/org/eclipse/papyrus/customization/model/customizationplugin/FileBasedCustomizableElement.java12
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src-gen/org/eclipse/papyrus/customization/model/customizationplugin/ModelTemplate.java24
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src-gen/org/eclipse/papyrus/customization/model/customizationplugin/Palette.java2
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src-gen/org/eclipse/papyrus/customization/model/customizationplugin/Profile.java52
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src-gen/org/eclipse/papyrus/customization/model/customizationplugin/PropertyView.java2
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src-gen/org/eclipse/papyrus/customization/model/customizationplugin/UICustom.java12
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src-gen/org/eclipse/papyrus/customization/model/customizationplugin/UMLModel.java42
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src-gen/org/eclipse/papyrus/customization/model/customizationplugin/impl/ConstraintsEnvironmentImpl.java4
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src-gen/org/eclipse/papyrus/customization/model/customizationplugin/impl/CustomizableElementImpl.java4
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src-gen/org/eclipse/papyrus/customization/model/customizationplugin/impl/CustomizationConfigurationImpl.java73
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src-gen/org/eclipse/papyrus/customization/model/customizationplugin/impl/CustomizationPluginFactoryImpl.java55
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src-gen/org/eclipse/papyrus/customization/model/customizationplugin/impl/CustomizationPluginPackageImpl.java125
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src-gen/org/eclipse/papyrus/customization/model/customizationplugin/impl/FileBasedCustomizableElementImpl.java42
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src-gen/org/eclipse/papyrus/customization/model/customizationplugin/impl/ModelTemplateImpl.java100
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src-gen/org/eclipse/papyrus/customization/model/customizationplugin/impl/PaletteImpl.java4
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src-gen/org/eclipse/papyrus/customization/model/customizationplugin/impl/ProfileImpl.java158
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src-gen/org/eclipse/papyrus/customization/model/customizationplugin/impl/PropertyViewEnvironmentImpl.java4
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src-gen/org/eclipse/papyrus/customization/model/customizationplugin/impl/PropertyViewImpl.java4
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src-gen/org/eclipse/papyrus/customization/model/customizationplugin/impl/UICustomImpl.java42
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src-gen/org/eclipse/papyrus/customization/model/customizationplugin/impl/UMLModelImpl.java129
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src-gen/org/eclipse/papyrus/customization/model/customizationplugin/util/CustomizationPluginAdapterFactory.java120
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src-gen/org/eclipse/papyrus/customization/model/customizationplugin/util/CustomizationPluginSwitch.java221
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src/org/eclipse/papyrus/customization/Activator.java4
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src/org/eclipse/papyrus/customization/creation/CustomizationElementCreationFactory.java20
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src/org/eclipse/papyrus/customization/display/DisplayManager.java30
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src/org/eclipse/papyrus/customization/factory/ConstraintEnvironmentExtensionFactory.java2
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src/org/eclipse/papyrus/customization/factory/ExtensionFactory.java2
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src/org/eclipse/papyrus/customization/factory/ExtensionFactoryRegistry.java8
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src/org/eclipse/papyrus/customization/factory/FileBasedExtensionFactory.java22
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src/org/eclipse/papyrus/customization/factory/ModelTemplateExtensionFactory.java12
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src/org/eclipse/papyrus/customization/factory/ProfileExtensionFactory.java15
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src/org/eclipse/papyrus/customization/factory/PropertyViewEnvironmentExtensionFactory.java4
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src/org/eclipse/papyrus/customization/factory/PropertyViewExtensionFactory.java44
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src/org/eclipse/papyrus/customization/factory/UICustomExtensionFactory.java4
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src/org/eclipse/papyrus/customization/factory/UMLModelExtensionFactory.java12
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src/org/eclipse/papyrus/customization/generator/PluginGenerator.java12
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src/org/eclipse/papyrus/customization/messages/Messages.java2
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src/org/eclipse/papyrus/customization/modelelement/CustomizationModelElement.java6
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src/org/eclipse/papyrus/customization/modelelement/CustomizationModelElementFactory.java4
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src/org/eclipse/papyrus/customization/plugin/PluginEditor.java4
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src/org/eclipse/papyrus/customization/wizard/CreateNewCustomizationPluginWizard.java19
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization/src/org/eclipse/papyrus/customization/wizard/CustomizationPage.java10
215 files changed, 5416 insertions, 4223 deletions
diff --git a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/Messages.java b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/Messages.java
index 4e6c571964c..ade2f5a6bed 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/Messages.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/Messages.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2010 CEA LIST.
- *
+ *
* 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
diff --git a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/AspectActionsInformationComposite.java b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/AspectActionsInformationComposite.java
index d1d3ca29430..ca10c220bc8 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/AspectActionsInformationComposite.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/AspectActionsInformationComposite.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2010 CEA LIST.
- *
+ *
* 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
@@ -106,9 +106,9 @@ public class AspectActionsInformationComposite {
/**
* Creates the content for this composite
- *
+ *
* @param parent
- * the conainer of the created content
+ * the conainer of the created content
* @return the created composite
*/
public Composite createComposite(Composite parent, List<Profile> appliedProfiles) {
@@ -163,13 +163,13 @@ public class AspectActionsInformationComposite {
*/
public void mouseUp(MouseEvent e) {
// remove the selected aspect action(s)
- ITreeSelection selection = (ITreeSelection)viewer.getSelection();
- if(selection != null && selection.size() > 0) {
- for(Object selected : selection.toList()) {
- if(selected instanceof IPostAction && selectedEntryProxy instanceof IPaletteAspectToolEntryProxy) {
- ((IPaletteAspectToolEntryProxy)selectedEntryProxy).getPostActions().remove(selected);
- } else if(selected instanceof IPreAction && selectedEntryProxy instanceof IPaletteAspectToolEntryProxy) {
- ((IPaletteAspectToolEntryProxy)selectedEntryProxy).getPreActions().remove(selected);
+ ITreeSelection selection = (ITreeSelection) viewer.getSelection();
+ if (selection != null && selection.size() > 0) {
+ for (Object selected : selection.toList()) {
+ if (selected instanceof IPostAction && selectedEntryProxy instanceof IPaletteAspectToolEntryProxy) {
+ ((IPaletteAspectToolEntryProxy) selectedEntryProxy).getPostActions().remove(selected);
+ } else if (selected instanceof IPreAction && selectedEntryProxy instanceof IPaletteAspectToolEntryProxy) {
+ ((IPaletteAspectToolEntryProxy) selectedEntryProxy).getPreActions().remove(selected);
}
}
}
@@ -199,19 +199,19 @@ public class AspectActionsInformationComposite {
* @{inheritDoc
*/
public void mouseUp(MouseEvent e) {
- IStructuredSelection selection = (IStructuredSelection)viewer.getSelection();
- if(selection != null && selection.size() > 0 && selectedEntryProxy instanceof IPaletteAspectToolEntryProxy) {
- IAspectAction action = (IAspectAction)selection.getFirstElement();
- List<IPreAction> initialPreList = ((IPaletteAspectToolEntryProxy)selectedEntryProxy).getPreActions();
- List<IPostAction> initialPostList = ((IPaletteAspectToolEntryProxy)selectedEntryProxy).getPostActions();
+ IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
+ if (selection != null && selection.size() > 0 && selectedEntryProxy instanceof IPaletteAspectToolEntryProxy) {
+ IAspectAction action = (IAspectAction) selection.getFirstElement();
+ List<IPreAction> initialPreList = ((IPaletteAspectToolEntryProxy) selectedEntryProxy).getPreActions();
+ List<IPostAction> initialPostList = ((IPaletteAspectToolEntryProxy) selectedEntryProxy).getPostActions();
- if(action instanceof IPreAction) {
+ if (action instanceof IPreAction) {
// move from pre action list
- if(initialPreList.indexOf(action) > 0) {
+ if (initialPreList.indexOf(action) > 0) {
Collections.swap(initialPreList, initialPreList.indexOf(action), initialPreList.indexOf(action) - 1);
}
- } else if(action instanceof IPostAction) {
- if(initialPostList.indexOf(action) > 0) {
+ } else if (action instanceof IPostAction) {
+ if (initialPostList.indexOf(action) > 0) {
Collections.swap(initialPostList, initialPostList.indexOf(action), initialPostList.indexOf(action) - 1);
}
}
@@ -247,19 +247,19 @@ public class AspectActionsInformationComposite {
* @{inheritDoc
*/
public void mouseUp(MouseEvent e) {
- IStructuredSelection selection = (IStructuredSelection)viewer.getSelection();
- if(selection != null && selection.size() > 0 && selectedEntryProxy instanceof IPaletteAspectToolEntryProxy) {
- IAspectAction action = (IAspectAction)selection.getFirstElement();
- List<IPreAction> initialPreList = ((IPaletteAspectToolEntryProxy)selectedEntryProxy).getPreActions();
- List<IPostAction> initialPostList = ((IPaletteAspectToolEntryProxy)selectedEntryProxy).getPostActions();
+ IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
+ if (selection != null && selection.size() > 0 && selectedEntryProxy instanceof IPaletteAspectToolEntryProxy) {
+ IAspectAction action = (IAspectAction) selection.getFirstElement();
+ List<IPreAction> initialPreList = ((IPaletteAspectToolEntryProxy) selectedEntryProxy).getPreActions();
+ List<IPostAction> initialPostList = ((IPaletteAspectToolEntryProxy) selectedEntryProxy).getPostActions();
- if(action instanceof IPreAction) {
+ if (action instanceof IPreAction) {
// move from pre action list
- if(initialPreList.indexOf(action) < initialPreList.size() - 1) {
+ if (initialPreList.indexOf(action) < initialPreList.size() - 1) {
Collections.swap(initialPreList, initialPreList.indexOf(action), initialPreList.indexOf(action) + 1);
}
- } else if(action instanceof IPostAction) {
- if(initialPostList.indexOf(action) < initialPostList.size() - 1) {
+ } else if (action instanceof IPostAction) {
+ if (initialPostList.indexOf(action) < initialPostList.size() - 1) {
Collections.swap(initialPostList, initialPostList.indexOf(action), initialPostList.indexOf(action) + 1);
}
}
@@ -316,10 +316,10 @@ public class AspectActionsInformationComposite {
*/
protected void addButtonPressed() {
Menu menu = new Menu(addActionButton);
- for(IAspectActionProvider factory : AspectToolService.getInstance().getProviders()) {
+ for (IAspectActionProvider factory : AspectToolService.getInstance().getProviders()) {
// check if action can be added (not present if one instance allowed)
- if(factory.isEnable(selectedEntryProxy)) {
+ if (factory.isEnable(selectedEntryProxy)) {
MenuItem item = new MenuItem(menu, SWT.NONE);
item.setText(factory.getName());
item.setImage(factory.getImage());
@@ -330,13 +330,13 @@ public class AspectActionsInformationComposite {
* @{inheritDoc
*/
public void widgetSelected(SelectionEvent e) {
- IAspectActionProvider factory = (IAspectActionProvider)((MenuItem)e.getSource()).getData();
+ IAspectActionProvider factory = (IAspectActionProvider) ((MenuItem) e.getSource()).getData();
IAspectAction action = factory.createAction(null);
- if(selectedEntryProxy instanceof IPaletteAspectToolEntryProxy) {
- if(action instanceof IPostAction) {
- ((IPaletteAspectToolEntryProxy)selectedEntryProxy).getPostActions().add((IPostAction)action);
- } else if(action instanceof IPreAction) {
- ((IPaletteAspectToolEntryProxy)selectedEntryProxy).getPreActions().add((IPreAction)action);
+ if (selectedEntryProxy instanceof IPaletteAspectToolEntryProxy) {
+ if (action instanceof IPostAction) {
+ ((IPaletteAspectToolEntryProxy) selectedEntryProxy).getPostActions().add((IPostAction) action);
+ } else if (action instanceof IPreAction) {
+ ((IPaletteAspectToolEntryProxy) selectedEntryProxy).getPreActions().add((IPreAction) action);
}
setSelectedEntryProxy(selectedEntryProxy);
}
@@ -357,19 +357,19 @@ public class AspectActionsInformationComposite {
/**
* Handles the selection changed event in the tree viewer of actions
- *
+ *
* @param event
- * the event fired by the tree viewer or <code>null</code>
+ * the event fired by the tree viewer or <code>null</code>
*/
protected void handleActionListSelectionChanged(SelectionChangedEvent event) {
- if(event == null) {
+ if (event == null) {
actionDescriptionComposite.showPage(new Composite(actionDescriptionComposite, SWT.NONE));
removeActionButton.setEnabled(false);
} else {
- IStructuredSelection selection = (IStructuredSelection)event.getSelection();
- if(selection != null && selection.getFirstElement() instanceof IAspectAction) {
+ IStructuredSelection selection = (IStructuredSelection) event.getSelection();
+ if (selection != null && selection.getFirstElement() instanceof IAspectAction) {
// udpate the page book where parameters are handled
- actionDescriptionComposite.showPage(((IAspectAction)selection.getFirstElement()).createConfigurationComposite(actionDescriptionComposite, selectedEntryProxy, appliedProfiles));
+ actionDescriptionComposite.showPage(((IAspectAction) selection.getFirstElement()).createConfigurationComposite(actionDescriptionComposite, selectedEntryProxy, appliedProfiles));
removeActionButton.setEnabled(true);
} else {
actionDescriptionComposite.showPage(new Composite(actionDescriptionComposite, SWT.NONE));
@@ -380,27 +380,27 @@ public class AspectActionsInformationComposite {
/**
* Sets the new Selected entry
- *
+ *
* @param selectedConfiguration
- * the selectedConfiguration to set
+ * the selectedConfiguration to set
*/
public void setSelectedEntryProxy(PaletteEntryProxy selectedEntryProxy) {
// should save the content for the previous selected entry proxy...
this.selectedEntryProxy = selectedEntryProxy;
- if(viewer != null) {
+ if (viewer != null) {
viewer.setInput(selectedEntryProxy);
// select first action
handleActionListSelectionChanged(null);
// select first post action
- if(selectedEntryProxy instanceof IPaletteAspectToolEntryProxy && ((IPaletteAspectToolEntryProxy)selectedEntryProxy).getPostActions().size() > 0) {
- viewer.setSelection(new StructuredSelection(((IPaletteAspectToolEntryProxy)selectedEntryProxy).getPostActions().get(0)), true);
+ if (selectedEntryProxy instanceof IPaletteAspectToolEntryProxy && ((IPaletteAspectToolEntryProxy) selectedEntryProxy).getPostActions().size() > 0) {
+ viewer.setSelection(new StructuredSelection(((IPaletteAspectToolEntryProxy) selectedEntryProxy).getPostActions().get(0)), true);
}
- //select first pre action
- else if(selectedEntryProxy instanceof IPaletteAspectToolEntryProxy && ((IPaletteAspectToolEntryProxy)selectedEntryProxy).getPreActions().size() > 0) {
- viewer.setSelection(new StructuredSelection(((IPaletteAspectToolEntryProxy)selectedEntryProxy).getPreActions().get(0)), true);
+ // select first pre action
+ else if (selectedEntryProxy instanceof IPaletteAspectToolEntryProxy && ((IPaletteAspectToolEntryProxy) selectedEntryProxy).getPreActions().size() > 0) {
+ viewer.setSelection(new StructuredSelection(((IPaletteAspectToolEntryProxy) selectedEntryProxy).getPreActions().get(0)), true);
}
updateButtons();
@@ -411,9 +411,9 @@ public class AspectActionsInformationComposite {
* Call this method to update the buttons enablement.
*/
protected void updateButtons() {
- if(selectedEntryProxy instanceof IPaletteAspectToolEntryProxy) {
+ if (selectedEntryProxy instanceof IPaletteAspectToolEntryProxy) {
addActionButton.setEnabled(true);
- if(((IPaletteAspectToolEntryProxy)selectedEntryProxy).getPreActions().isEmpty() && !((IPaletteAspectToolEntryProxy)selectedEntryProxy).getPostActions().isEmpty()) {
+ if (((IPaletteAspectToolEntryProxy) selectedEntryProxy).getPreActions().isEmpty() && !((IPaletteAspectToolEntryProxy) selectedEntryProxy).getPostActions().isEmpty()) {
removeActionButton.setEnabled(true);
moveUpActionButton.setEnabled(true);
moveDownActionButton.setEnabled(true);
@@ -440,10 +440,10 @@ public class AspectActionsInformationComposite {
* @{inheritDoc
*/
public Object[] getChildren(Object parentElement) {
- if(parentElement instanceof IPaletteAspectToolEntryProxy) {
+ if (parentElement instanceof IPaletteAspectToolEntryProxy) {
List<IAspectAction> actions = new ArrayList<IAspectAction>();
- actions.addAll(((IPaletteAspectToolEntryProxy)parentElement).getPostActions());
- actions.addAll(((IPaletteAspectToolEntryProxy)parentElement).getPreActions());
+ actions.addAll(((IPaletteAspectToolEntryProxy) parentElement).getPostActions());
+ actions.addAll(((IPaletteAspectToolEntryProxy) parentElement).getPreActions());
return actions.toArray();
}
return new Object[0];
@@ -453,7 +453,7 @@ public class AspectActionsInformationComposite {
* @{inheritDoc
*/
public Object getParent(Object element) {
- if(element instanceof IAspectAction) {
+ if (element instanceof IAspectAction) {
return selectedEntryProxy;
}
return null;
@@ -498,8 +498,8 @@ public class AspectActionsInformationComposite {
* @{inheritDoc
*/
public Image getImage(Object element) {
- if(element instanceof IAspectAction) {
- return ((IAspectAction)element).getImage();
+ if (element instanceof IAspectAction) {
+ return ((IAspectAction) element).getImage();
}
return null;
}
@@ -508,8 +508,8 @@ public class AspectActionsInformationComposite {
* @{inheritDoc
*/
public String getText(Object element) {
- if(element instanceof IAspectAction) {
- return ((IAspectAction)element).getLabel();
+ if (element instanceof IAspectAction) {
+ return ((IAspectAction) element).getLabel();
}
return "notAnAction";
}
diff --git a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/BundleExplorerDialog.java b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/BundleExplorerDialog.java
index b30fa37b226..8ae2fc5e322 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/BundleExplorerDialog.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/BundleExplorerDialog.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2010 CEA LIST.
- *
+ *
* 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
@@ -39,11 +39,11 @@ public class BundleExplorerDialog extends FilteredItemsSelectionDialog {
/**
* Creates a new BundleExplorerDialog.
- *
+ *
* @param shell
- * the parent shell for the dialog
+ * the parent shell for the dialog
* @param multi
- * <code>true</code> if multi selection is allowed
+ * <code>true</code> if multi selection is allowed
*/
public BundleExplorerDialog(Shell shell, boolean multi, IPluginModelBase[] models) {
super(shell, multi);
@@ -75,7 +75,7 @@ public class BundleExplorerDialog extends FilteredItemsSelectionDialog {
*/
@Override
protected void fillContentProvider(AbstractContentProvider contentProvider, ItemsFilter itemsFilter, IProgressMonitor progressMonitor) throws CoreException {
- for(int i = 0; i < fModels.length; i++) {
+ for (int i = 0; i < fModels.length; i++) {
contentProvider.add(fModels[i], itemsFilter);
progressMonitor.worked(1);
}
@@ -89,7 +89,7 @@ public class BundleExplorerDialog extends FilteredItemsSelectionDialog {
protected IDialogSettings getDialogSettings() {
IDialogSettings settings = Activator.getDefault().getDialogSettings().getSection(DIALOG_SETTINGS);
- if(settings == null) {
+ if (settings == null) {
settings = Activator.getDefault().getDialogSettings().addNewSection(DIALOG_SETTINGS);
}
@@ -101,8 +101,8 @@ public class BundleExplorerDialog extends FilteredItemsSelectionDialog {
*/
@Override
public String getElementName(Object item) {
- if(item instanceof IPluginModelBase) {
- IPluginModelBase model = (IPluginModelBase)item;
+ if (item instanceof IPluginModelBase) {
+ IPluginModelBase model = (IPluginModelBase) item;
return model.getPluginBase().getId();
}
return null;
@@ -134,8 +134,8 @@ public class BundleExplorerDialog extends FilteredItemsSelectionDialog {
@Override
public boolean matchItem(Object item) {
String id = null;
- if(item instanceof IPluginModelBase) {
- IPluginModelBase model = (IPluginModelBase)item;
+ if (item instanceof IPluginModelBase) {
+ IPluginModelBase model = (IPluginModelBase) item;
id = model.getPluginBase().getId();
}
@@ -145,7 +145,7 @@ public class BundleExplorerDialog extends FilteredItemsSelectionDialog {
@Override
protected boolean matches(String text) {
String pattern = patternMatcher.getPattern();
- if(pattern.indexOf("*") != 0 & pattern.indexOf("?") != 0 & pattern.indexOf(".") != 0) {//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ if (pattern.indexOf("*") != 0 & pattern.indexOf("?") != 0 & pattern.indexOf(".") != 0) {//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
pattern = "*" + pattern; //$NON-NLS-1$
patternMatcher.setPattern(pattern);
}
@@ -159,23 +159,23 @@ public class BundleExplorerDialog extends FilteredItemsSelectionDialog {
int id1 = getId(o1);
int id2 = getId(o2);
- if(id1 != id2) {
+ if (id1 != id2) {
return id1 - id2;
}
return compareSimilarObjects(o1, o2);
}
private int getId(Object element) {
- if(element instanceof IPluginModelBase) {
+ if (element instanceof IPluginModelBase) {
return 100;
}
return 0;
}
private int compareSimilarObjects(Object o1, Object o2) {
- if(o1 instanceof IPluginModelBase && o2 instanceof IPluginModelBase) {
- IPluginModelBase ipmb1 = (IPluginModelBase)o1;
- IPluginModelBase ipmb2 = (IPluginModelBase)o2;
+ if (o1 instanceof IPluginModelBase && o2 instanceof IPluginModelBase) {
+ IPluginModelBase ipmb1 = (IPluginModelBase) o1;
+ IPluginModelBase ipmb2 = (IPluginModelBase) o2;
return comparePlugins(ipmb1.getPluginBase(), ipmb2.getPluginBase());
}
return 0;
diff --git a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/BundleIconExplorerDialog.java b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/BundleIconExplorerDialog.java
index e6a64ee1ae7..7d6a433b6af 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/BundleIconExplorerDialog.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/BundleIconExplorerDialog.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2010 CEA LIST.
- *
+ *
* 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
@@ -24,6 +24,7 @@ import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.window.Window;
import org.eclipse.papyrus.customization.palette.Messages;
import org.eclipse.papyrus.uml.diagram.common.Activator;
import org.eclipse.pde.core.plugin.IPluginModel;
@@ -85,9 +86,9 @@ public class BundleIconExplorerDialog extends SelectionStatusDialog {
/**
* Creates a new Icon Bundle Explorer Dialog
- *
+ *
* @param parentShell
- * the parent shell for the dialog
+ * the parent shell for the dialog
*/
public BundleIconExplorerDialog(Shell parentShell, boolean allowMultiple, String initialValue, String bundle) {
super(parentShell);
@@ -101,9 +102,9 @@ public class BundleIconExplorerDialog extends SelectionStatusDialog {
/**
* Creates a new Icon Bundle Explorer Dialog
- *
+ *
* @param parentShell
- * the parent shell for the dialog
+ * the parent shell for the dialog
*/
public BundleIconExplorerDialog(Shell parentShell, String initialValue) {
this(parentShell, false, initialValue, retrieveBundleId(initialValue));
@@ -111,13 +112,13 @@ public class BundleIconExplorerDialog extends SelectionStatusDialog {
/**
* Retrieves the bundle from which the
- *
+ *
* @param initialValue
- * the initial value from which the bundle has to be retrieved
+ * the initial value from which the bundle has to be retrieved
* @return the bundle id
*/
protected static String retrieveBundleId(String initialValue) {
- if(initialValue.startsWith(PLUGIN_PROTOCOL)) {
+ if (initialValue.startsWith(PLUGIN_PROTOCOL)) {
String tmp = initialValue.substring(PLUGIN_PROTOCOL.length());
int bundleIdEndIndex = tmp.indexOf("/");
return tmp.substring(0, bundleIdEndIndex);
@@ -130,7 +131,7 @@ public class BundleIconExplorerDialog extends SelectionStatusDialog {
*/
@Override
protected Control createDialogArea(Composite parent) {
- Composite composite = (Composite)super.createDialogArea(parent);
+ Composite composite = (Composite) super.createDialogArea(parent);
initializeDialogUnits(composite);
// creates the message area, as defined in the super class
@@ -152,22 +153,22 @@ public class BundleIconExplorerDialog extends SelectionStatusDialog {
// check selection
currentBundleName = text.getText().trim();
Bundle bundle = Platform.getBundle(currentBundleName);
- if(bundle == null) {
+ if (bundle == null) {
Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.ID, "impossible to find bundle with id: " + currentBundleName));
return;
}
Enumeration<URL> e = bundle.findEntries("", "*" + GIF_EXTENSION, true); //$NON-NLS-1$ //$NON-NLS-2$
List<ImageProxy> selectedProxy = new ArrayList<ImageProxy>();
List<ImageProxy> images = new ArrayList<ImageProxy>();
- if(e == null) {
+ if (e == null) {
return;
}
- while(e.hasMoreElements()) {
+ while (e.hasMoreElements()) {
ImageProxy proxy = new ImageProxy(e.nextElement());
- if(proxy.isDisplayed()) {
+ if (proxy.isDisplayed()) {
images.add(proxy);
// check if the proxy corresponds to the initialValue
- if(proxy.isInitial()) {
+ if (proxy.isInitial()) {
selectedProxy.add(proxy);
}
}
@@ -175,7 +176,7 @@ public class BundleIconExplorerDialog extends SelectionStatusDialog {
filteredList.setElements(images.toArray());
// select objects
- if(!selectedProxy.isEmpty()) {
+ if (!selectedProxy.isEmpty()) {
filteredList.setSelection(selectedProxy.toArray());
}
@@ -183,9 +184,9 @@ public class BundleIconExplorerDialog extends SelectionStatusDialog {
/**
* Creates an area where users can select bundles where icons should be selected
- *
+ *
* @param composite
- * the parent composite of the controls created in this area
+ * the parent composite of the controls created in this area
*/
protected void createComboArea(Composite composite) {
Composite parent = new Composite(composite, SWT.NONE);
@@ -246,8 +247,8 @@ public class BundleIconExplorerDialog extends SelectionStatusDialog {
protected void handleManageBundlesButtonPressed() {
// open a dialog
BundleExplorerDialog dialog = new BundleExplorerDialog(getParentShell(), false, PluginRegistry.getActiveModels(true));
- if(Dialog.OK == dialog.open()) {
- text.setText(((IPluginModel)dialog.getFirstResult()).getPlugin().getId());
+ if (Window.OK == dialog.open()) {
+ text.setText(((IPluginModel) dialog.getFirstResult()).getPlugin().getId());
refreshList();
}
}
@@ -259,8 +260,8 @@ public class BundleIconExplorerDialog extends SelectionStatusDialog {
protected void computeResult() {
List<Object> proxies = Arrays.asList(getSelectedElements());
List<String> results = new ArrayList<String>(proxies.size());
- for(Object proxy : proxies) {
- results.add(((ImageProxy)proxy).getPluginPath());
+ for (Object proxy : proxies) {
+ results.add(((ImageProxy) proxy).getPluginPath());
}
setResult(results);
}
@@ -268,7 +269,7 @@ public class BundleIconExplorerDialog extends SelectionStatusDialog {
/**
* Returns an array of the currently selected elements.
* To be called within or after open().
- *
+ *
* @return returns an array of the currently selected elements.
*/
protected Object[] getSelectedElements() {
@@ -278,9 +279,9 @@ public class BundleIconExplorerDialog extends SelectionStatusDialog {
/**
* Creates an area where a filter can be entered. This filter will restrict the list of available icons.
- *
+ *
* @param parent
- * the parent composite where to create the filter text
+ * the parent composite where to create the filter text
* @return the created text area
*/
protected Text createFilterText(Composite parent) {
@@ -307,7 +308,7 @@ public class BundleIconExplorerDialog extends SelectionStatusDialog {
text.addKeyListener(new KeyListener() {
public void keyPressed(KeyEvent e) {
- if(e.keyCode == SWT.ARROW_DOWN) {
+ if (e.keyCode == SWT.ARROW_DOWN) {
filteredList.setFocus();
}
}
@@ -323,9 +324,9 @@ public class BundleIconExplorerDialog extends SelectionStatusDialog {
/**
* Creates a filtered list.
- *
+ *
* @param parent
- * the parent composite.
+ * the parent composite.
* @return returns the filtered list widget.
*/
protected FilteredList createFilteredList(Composite parent) {
@@ -350,7 +351,7 @@ public class BundleIconExplorerDialog extends SelectionStatusDialog {
/**
* Returns the bundle identifier for the current image
- *
+ *
* @return the bundle identifier for the current image
*/
public String getCurrentBundleName() {
@@ -359,13 +360,13 @@ public class BundleIconExplorerDialog extends SelectionStatusDialog {
/**
* Returns the path to the icon in the bundle
- *
+ *
* @return the path to the icon in the bundle
*/
public String getIconPath() {
List<Object> proxies = Arrays.asList(getSelectedElements());
- if(proxies.size() == 1) {
- return ((ImageProxy)proxies.get(0)).getLocalPath();
+ if (proxies.size() == 1) {
+ return ((ImageProxy) proxies.get(0)).getLocalPath();
}
return "";
@@ -388,11 +389,11 @@ public class BundleIconExplorerDialog extends SelectionStatusDialog {
*/
@Override
public Image getImage(Object element) {
- if(element instanceof ImageProxy) {
+ if (element instanceof ImageProxy) {
// int index = ((String)element).indexOf(currentBundleName);
// String path = ((String)element).substring(index+currentBundleName.length());
// return Activator.getImage(currentBundleName, path);
- return ((ImageProxy)element).getImage();
+ return ((ImageProxy) element).getImage();
}
return super.getImage(element);
}
@@ -402,8 +403,8 @@ public class BundleIconExplorerDialog extends SelectionStatusDialog {
*/
@Override
public String getText(Object element) {
- if(element instanceof ImageProxy) {
- return ((ImageProxy)element).getText();
+ if (element instanceof ImageProxy) {
+ return ((ImageProxy) element).getText();
}
return super.getText(element);
}
@@ -428,16 +429,16 @@ public class BundleIconExplorerDialog extends SelectionStatusDialog {
/**
* Creates an Image Proxy
- *
+ *
* @param url
- * the url of the image to proxy
+ * the url of the image to proxy
*/
public ImageProxy(URL url) {
localPath = url.getPath();
path = PLUGIN_PROTOCOL + getCurrentBundleName() + localPath;
image = org.eclipse.papyrus.uml.diagram.common.Activator.getImage(path, ""); //$NON-NLS-1$
int index = localPath.lastIndexOf('/');
- if(index > 0 && index < localPath.length()) {
+ if (index > 0 && index < localPath.length()) {
fileName = localPath.substring(index + 1, localPath.length() - GIF_EXTENSION_LENGTH);
} else {
fileName = Messages.BundleIconExplorerDialog_UnknownFileName;
@@ -446,7 +447,7 @@ public class BundleIconExplorerDialog extends SelectionStatusDialog {
/**
* Checks if this proxy corresponds to the initial value
- *
+ *
* @return <code>true</code> if this is the initial value proxy
*/
public boolean isInitial() {
@@ -455,7 +456,7 @@ public class BundleIconExplorerDialog extends SelectionStatusDialog {
/**
* Returns the real image
- *
+ *
* @return the real image
*/
public Image getImage() {
@@ -464,12 +465,12 @@ public class BundleIconExplorerDialog extends SelectionStatusDialog {
/**
* Returns <code>true</code> if this image is correct
- *
+ *
* @return <code>true</code> if this image is correct
*/
public boolean isDisplayed() {
Rectangle bounds = image.getBounds();
- if(bounds.height == 16 && bounds.width == 16) {
+ if (bounds.height == 16 && bounds.width == 16) {
return true;
}
return false;
@@ -477,7 +478,7 @@ public class BundleIconExplorerDialog extends SelectionStatusDialog {
/**
* Returns the text to display
- *
+ *
* @return the text to display
*/
public String getText() {
@@ -491,7 +492,7 @@ public class BundleIconExplorerDialog extends SelectionStatusDialog {
/**
* Returns the path to the icon in the bundle
- *
+ *
* @return the path to the icon in the bundle
*/
public String getLocalPath() {
diff --git a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/ConfigurationInformationComposite.java b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/ConfigurationInformationComposite.java
index ba7484077fc..bdedc1abffd 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/ConfigurationInformationComposite.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/ConfigurationInformationComposite.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2010 CEA LIST.
- *
+ *
* 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
@@ -14,6 +14,7 @@ package org.eclipse.papyrus.customization.palette.dialog;
import java.util.List;
import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.window.Window;
import org.eclipse.papyrus.uml.diagram.common.Activator;
import org.eclipse.papyrus.uml.diagram.common.Messages;
import org.eclipse.papyrus.uml.diagram.paletteconfiguration.Configuration;
@@ -65,11 +66,11 @@ public class ConfigurationInformationComposite {
/**
* Creates the content of the information composite
- *
+ *
* @param parent
- * the composite where to add created controls
+ * the composite where to add created controls
* @param appliedProfiles
- * the list of applied profiles
+ * the list of applied profiles
* @return the newly created composite
*/
public Composite createComposite(final Composite parent, List<Profile> appliedProfiles) {
@@ -140,9 +141,9 @@ public class ConfigurationInformationComposite {
*/
public void mouseUp(MouseEvent e) {
BundleIconExplorerDialog dialog = new BundleIconExplorerDialog(parent.getShell(), iconText.getText());
- if(Dialog.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
Object[] values = dialog.getResult();
- if(values.length != 1) {
+ if (values.length != 1) {
Activator.log.error("Waiting one icon path, but found " + values.length, null);
} else {
iconText.setText(values[0].toString());
@@ -172,9 +173,9 @@ public class ConfigurationInformationComposite {
private void updateIconInConfiguration(String bundleId, String iconPath) {
- if(selectedConfiguration != null) {
+ if (selectedConfiguration != null) {
IconDescriptor descriptor = PaletteconfigurationFactory.eINSTANCE.createIconDescriptor();
- if(bundleId != null && iconPath != null) {
+ if (bundleId != null && iconPath != null) {
descriptor.setPluginID(bundleId);
descriptor.setIconPath(iconPath);
}
@@ -186,7 +187,7 @@ public class ConfigurationInformationComposite {
* Updates the name field in the information area
*/
protected void updateNameEntryField() {
- if(selectedConfiguration != null) {
+ if (selectedConfiguration != null) {
nameText.setText((selectedConfiguration.getLabel() != null) ? selectedConfiguration.getLabel() : "");
nameText.setEnabled(true);
} else {
@@ -200,8 +201,8 @@ public class ConfigurationInformationComposite {
* Updates the reference field in the information area
*/
protected void updateReferencedEntryField() {
- if(selectedConfiguration instanceof ToolConfiguration) {
- ToolConfiguration configuration = ((ToolConfiguration)selectedConfiguration);
+ if (selectedConfiguration instanceof ToolConfiguration) {
+ ToolConfiguration configuration = ((ToolConfiguration) selectedConfiguration);
} else {
referencedText.setText("");
referencedText.setEnabled(false);
@@ -212,7 +213,7 @@ public class ConfigurationInformationComposite {
* Updates the description field in the information area
*/
protected void updateDescriptionEntryField() {
- if(selectedConfiguration != null) {
+ if (selectedConfiguration != null) {
descriptionText.setText((selectedConfiguration.getDescription() != null) ? selectedConfiguration.getDescription() : "");
descriptionText.setEnabled(true);
} else {
@@ -225,12 +226,12 @@ public class ConfigurationInformationComposite {
* Updates the icon field in the information area
*/
protected void updateIconEntryField() {
- if(selectedConfiguration != null) {
+ if (selectedConfiguration != null) {
IconDescriptor descriptor = selectedConfiguration.getIcon();
- if(descriptor != null) {
+ if (descriptor != null) {
String iconPath = descriptor.getIconPath();
String bundleId = descriptor.getPluginID();
- if(iconPath != null && bundleId != null) {
+ if (iconPath != null && bundleId != null) {
iconText.setText(PLUGIN_PROTOCOL + bundleId + iconPath);
}
}
@@ -243,9 +244,9 @@ public class ConfigurationInformationComposite {
/**
* Sets the new Selected entry
- *
+ *
* @param configuration
- * the selectedConfiguration to set
+ * the selectedConfiguration to set
*/
public void setSelectedConfiguration(Configuration configuration) {
this.selectedConfiguration = configuration;
@@ -271,7 +272,7 @@ public class ConfigurationInformationComposite {
* @{inheritDoc
*/
public void focusLost(FocusEvent e) {
- if(selectedConfiguration != null) {
+ if (selectedConfiguration != null) {
selectedConfiguration.setLabel(nameText.getText().trim());
}
}
@@ -293,7 +294,7 @@ public class ConfigurationInformationComposite {
* @{inheritDoc
*/
public void focusLost(FocusEvent e) {
- if(selectedConfiguration != null) {
+ if (selectedConfiguration != null) {
selectedConfiguration.setDescription(descriptionText.getText().trim());
}
}
@@ -315,17 +316,17 @@ public class ConfigurationInformationComposite {
*/
public void focusLost(FocusEvent e) {
String text = iconText.getText();
- if(selectedConfiguration != null && text != null && !text.equals("")) {
+ if (selectedConfiguration != null && text != null && !text.equals("")) {
// parse the text....
- if(!text.startsWith(PLUGIN_PROTOCOL)) {
+ if (!text.startsWith(PLUGIN_PROTOCOL)) {
return;
}
text = text.substring(PLUGIN_PROTOCOL.length(), text.length());
int i = text.indexOf("/");
- if(i < 1) {
+ if (i < 1) {
return;
}
String bundlePath = text.substring(0, i);
diff --git a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/DrawerInformationPage.java b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/DrawerInformationPage.java
index 0d691fbc503..830640b2e5c 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/DrawerInformationPage.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/DrawerInformationPage.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2009 CEA LIST.
- *
+ *
* 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
@@ -14,6 +14,7 @@
package org.eclipse.papyrus.customization.palette.dialog;
import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.window.Window;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.papyrus.uml.diagram.common.Activator;
import org.eclipse.papyrus.uml.diagram.common.Messages;
@@ -69,9 +70,9 @@ public class DrawerInformationPage extends WizardPage implements Listener {
/**
* Creates a new wizard page with the given name, title, and image.
- *
+ *
* @param part
- * the editor part in which the wizard was created
+ * the editor part in which the wizard was created
*/
public DrawerInformationPage() {
super(Messages.Wizard_Drawer_Page_Name, Messages.Wizard_Drawer_Page_Title, Activator.getImageDescriptor(WIZARD_ICON));
@@ -80,9 +81,9 @@ public class DrawerInformationPage extends WizardPage implements Listener {
/**
* Creates a new wizard page with the given name, title, and image.
- *
+ *
* @param part
- * the editor part in which the wizard was created
+ * the editor part in which the wizard was created
*/
public DrawerInformationPage(PaletteLocalDrawerProxy drawerProxy) {
super(Messages.Wizard_Drawer_Page_Name, Messages.Wizard_Drawer_Page_Title, Activator.getImageDescriptor(WIZARD_ICON));
@@ -134,7 +135,7 @@ public class DrawerInformationPage extends WizardPage implements Listener {
/**
* Returns the current value of palette name
- *
+ *
* @return the current value of palette name
*/
public String getDrawerName() {
@@ -143,7 +144,7 @@ public class DrawerInformationPage extends WizardPage implements Listener {
/**
* Returns the current value of palette ID
- *
+ *
* @return the current value of palette ID
*/
public String getDrawerID() {
@@ -152,7 +153,7 @@ public class DrawerInformationPage extends WizardPage implements Listener {
/**
* Returns the current value of path for image descriptor
- *
+ *
* @return the current value of path for image descriptor
*/
public String getImageDescriptorPath() {
@@ -163,7 +164,7 @@ public class DrawerInformationPage extends WizardPage implements Listener {
* inits the name field value
*/
protected void initName() {
- if(drawerProxy == null) {
+ if (drawerProxy == null) {
name = "";
} else {
name = drawerProxy.getLabel();
@@ -175,7 +176,7 @@ public class DrawerInformationPage extends WizardPage implements Listener {
* inits the palette id value
*/
protected void initDrawerID() {
- if(drawerProxy == null) {
+ if (drawerProxy == null) {
drawerID = "drawer_" + System.currentTimeMillis();
} else {
drawerID = drawerProxy.getId();
@@ -187,7 +188,7 @@ public class DrawerInformationPage extends WizardPage implements Listener {
* Inits the image descriptor
*/
protected void initImageDescriptor() {
- if(drawerProxy == null) {
+ if (drawerProxy == null) {
imageDescriptorPath = "/icons/drawer.gif";
} else {
imageDescriptorPath = drawerProxy.getImagePath();
@@ -200,23 +201,23 @@ public class DrawerInformationPage extends WizardPage implements Listener {
*/
protected boolean validatePage() {
boolean valid = true;
- if(advancedComposite != null && !advancedComposite.isDisposed()) {
+ if (advancedComposite != null && !advancedComposite.isDisposed()) {
- if("".equals(getDrawerID())) {
+ if ("".equals(getDrawerID())) {
setErrorMessage(Messages.Wizard_Drawer_Error_Id);
valid = false;
- } else if("".equals(getImageDescriptorPath())) {
+ } else if ("".equals(getImageDescriptorPath())) {
setErrorMessage(Messages.Wizard_Drawer_Error_Icon);
valid = false;
}
}
- if("".equals(getDrawerName())) {
+ if ("".equals(getDrawerName())) {
setErrorMessage(Messages.Wizard_Drawer_Error_Name);
valid = false;
}
- if(valid) {
+ if (valid) {
setMessage(null);
setErrorMessage(null);
}
@@ -225,9 +226,9 @@ public class DrawerInformationPage extends WizardPage implements Listener {
/**
* Creates the widget for advanced options.
- *
+ *
* @param parent
- * the parent composite
+ * the parent composite
*/
protected void createAdvancedControls(Composite parent) {
advancedButton = new Button(parent, SWT.PUSH);
@@ -265,9 +266,9 @@ public class DrawerInformationPage extends WizardPage implements Listener {
/**
* creates the control area for the icon path definition
- *
+ *
* @param composite
- * the parent composite
+ * the parent composite
*/
protected void createIconControl(final Composite composite) {
final Label iconLabel = new Label(composite, SWT.NONE);
@@ -292,9 +293,9 @@ public class DrawerInformationPage extends WizardPage implements Listener {
*/
public void mouseUp(MouseEvent e) {
BundleIconExplorerDialog dialog = new BundleIconExplorerDialog(composite.getShell(), imageText.getText());
- if(Dialog.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
Object[] values = dialog.getResult();
- if(values.length != 1) {
+ if (values.length != 1) {
Activator.log.error("Waiting one icon path, but found " + values.length, null);
} else {
imageDescriptorPath = values[0].toString();
@@ -323,9 +324,9 @@ public class DrawerInformationPage extends WizardPage implements Listener {
* Shows/hides the advanced option widgets.
*/
protected void handleAdvancedButtonSelect() {
- Composite composite = (Composite)getControl();
+ Composite composite = (Composite) getControl();
- if(advancedComposite != null) {
+ if (advancedComposite != null) {
advancedComposite.dispose();
advancedComposite = null;
advancedButton.setText(Messages.Dialog_Advanced_Button_Closed);
@@ -337,9 +338,9 @@ public class DrawerInformationPage extends WizardPage implements Listener {
/**
* creates the control area for the id definition
- *
+ *
* @param control
- * the parent composite
+ * the parent composite
*/
protected void createIDControl(Composite control) {
final Label idLabel = new Label(control, SWT.NONE);
@@ -374,9 +375,9 @@ public class DrawerInformationPage extends WizardPage implements Listener {
/**
* creates the control area for the name definition
- *
+ *
* @param control
- * the parent composite
+ * the parent composite
*/
protected void createNameControl(Composite control) {
final Label nameLabel = new Label(control, SWT.NONE);
@@ -407,9 +408,9 @@ public class DrawerInformationPage extends WizardPage implements Listener {
*/
public void handleEvent(Event event) {
Widget widget = event.widget;
- if(widget.equals(nameText)) {
+ if (widget.equals(nameText)) {
name = nameText.getText();
- } else if(widget.equals(idText)) {
+ } else if (widget.equals(idText)) {
drawerID = idText.getText();
}
setPageComplete(validatePage());
diff --git a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/ExtendedPaletteContentPage.java b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/ExtendedPaletteContentPage.java
index bb9133685ca..886a77e2eec 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/ExtendedPaletteContentPage.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/ExtendedPaletteContentPage.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2009, 2014 CEA LIST 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
@@ -247,15 +247,15 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
private Resource resourceToEdit;
/** customization manager for the content provider */
- //TODO: EMFFACET: pb of ResourceSET
- private ICustomizationManager manager = ICustomizationManagerFactory.DEFAULT.getOrCreateICustomizationManager(new ResourceSetImpl());
+ // TODO: EMFFACET: pb of ResourceSET
+ private ICustomizationManager manager = ICustomizationManagerFactory.DEFAULT.getOrCreateICustomizationManager(new ResourceSetImpl());
/**
* Creates a new wizard page with the given name, title, and image.
- *
+ *
* @param part
- * the editor part in which the wizard was created
+ * the editor part in which the wizard was created
*/
public ExtendedPaletteContentPage(IEditorPart part, PaletteCustomizer customizer) {
super(Messages.Local_Palette_ContentPage_Name, Messages.Local_Palette_ContentPage_Title, Activator.getImageDescriptor(WIZARD_ICON));
@@ -267,20 +267,20 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
public void dispose() {
super.dispose();
- if(resourceSet != null) {
+ if (resourceSet != null) {
EMFHelper.unload(resourceSet);
}
- if(manager != null) {
+ if (manager != null) {
EMFHelper.unload(manager.getResourceSet());
}
}
/**
* Sets the priority of the current edited palette
- *
+ *
* @param priority
- * the priority of the current edited palette
+ * the priority of the current edited palette
*/
public void setPriority(ProviderPriority priority) {
this.priority = priority;
@@ -302,7 +302,7 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
/**
* Returns the list of required profiles by this local palette definition
- *
+ *
* @return the profiles required by this palette
*/
public Set<String> getRequiredProfiles() {
@@ -372,14 +372,14 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
* Creates the composite group that presents information about ascpect actions for aspect tools
*/
protected void createAspectActionComposite() {
- aspectActionComposite.createComposite((Composite)getControl(), getAllAppliedProfiles());
+ aspectActionComposite.createComposite((Composite) getControl(), getAllAppliedProfiles());
}
/**
* Creates the composite group that presents information about current selected tool
*/
protected void createToolDescriptionGroup() {
- informationComposite.createComposite((Composite)getControl(), getAllAppliedProfiles());
+ informationComposite.createComposite((Composite) getControl(), getAllAppliedProfiles());
}
/**
@@ -390,7 +390,7 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
storedPreferences = PapyrusPalettePreferences.getHiddenPalettes(editorPart);
// remove all, but should only remove visible palettes
- for(String id : storedPreferences) {
+ for (String id : storedPreferences) {
PapyrusPalettePreferences.changePaletteVisibility(id, editorPart, true);
}
}
@@ -400,7 +400,7 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
*/
public void restorePreferences() {
// remove all, but should only remove visible palettes
- for(String id : storedPreferences) {
+ for (String id : storedPreferences) {
PapyrusPalettePreferences.changePaletteVisibility(id, editorPart, false);
}
}
@@ -409,7 +409,7 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
* creates the palette preview group
*/
protected void createPalettePreviewGroup() {
- Composite parent = (Composite)getControl();
+ Composite parent = (Composite) getControl();
Composite paletteComposite = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout(2, true);
@@ -455,14 +455,14 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
/**
* handle the selection change event for the palette preview
- *
+ *
* @param event
- * the event that is thrown by the palette viewer
+ * the event that is thrown by the palette viewer
*/
protected void handlePalettePreviewSelectionChanged(SelectionChangedEvent event) {
// retrieve current selection
Configuration configuration = getSelectedConfiguration();
- if(configuration != null) {
+ if (configuration != null) {
selectedConfiguration = configuration;
// update the current selected palette entry proxy
informationComposite.setSelectedConfiguration(selectedConfiguration);
@@ -472,12 +472,12 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
}
// update toolbar
- if(toolbar != null && !toolbar.isDisposed()) {
- for(int i = 0; i < toolbar.getItemCount(); i++) {
+ if (toolbar != null && !toolbar.isDisposed()) {
+ for (int i = 0; i < toolbar.getItemCount(); i++) {
ToolItem item = toolbar.getItem(i);
Object validator = item.getData(VALIDATOR);
- if(validator instanceof ToolBarItemValidator) {
- item.setEnabled(((ToolBarItemValidator)validator).isEnable());
+ if (validator instanceof ToolBarItemValidator) {
+ item.setEnabled(((ToolBarItemValidator) validator).isEnable());
}
}
}
@@ -504,7 +504,7 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
*/
protected void addPalettePreviewDropSupport() {
// transfer types
- Transfer[] transfers = new Transfer[]{ LocalSelectionTransfer.getTransfer() };
+ Transfer[] transfers = new Transfer[] { LocalSelectionTransfer.getTransfer() };
// drag listener
DropTargetListener listener = new TreeDropTargetEffect(paletteTreeViewer.getTree()) {
@@ -515,20 +515,20 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
@Override
public void drop(DropTargetEvent event) {
super.drop(event);
- IStructuredSelection transferedSelection = (IStructuredSelection)LocalSelectionTransfer.getTransfer().nativeToJava(event.currentDataType);
+ IStructuredSelection transferedSelection = (IStructuredSelection) LocalSelectionTransfer.getTransfer().nativeToJava(event.currentDataType);
Object objectToTransfer = transferedSelection.getFirstElement();
- if(!(objectToTransfer instanceof IAdaptable)) {
+ if (!(objectToTransfer instanceof IAdaptable)) {
return;
}
final EObject eobjectToTransfer = EMFHelper.getEObject(objectToTransfer);
- Object targetObject = ((TreeItem)event.item).getData();
- if(!(targetObject instanceof IAdaptable)) {
+ Object targetObject = ((TreeItem) event.item).getData();
+ if (!(targetObject instanceof IAdaptable)) {
return;
}
- final EObject targetEObject =EMFHelper.getEObject(targetObject);
- if(targetEObject == null) {
+ final EObject targetEObject = EMFHelper.getEObject(targetObject);
+ if (targetEObject == null) {
return;
}
@@ -539,10 +539,10 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
*/
@Override
public Object caseDrawerConfiguration(DrawerConfiguration drawerConfigurationToMove) {
- if(targetEObject instanceof DrawerConfiguration) {
+ if (targetEObject instanceof DrawerConfiguration) {
// move the drawer before the target drawer configuration
- PaletteConfiguration paletteConfiguration = (PaletteConfiguration)((DrawerConfiguration)targetEObject).eContainer();
- PaletteConfigurationUtils.moveDrawerConfiguration(paletteConfiguration, drawerConfigurationToMove, (DrawerConfiguration)targetEObject);
+ PaletteConfiguration paletteConfiguration = (PaletteConfiguration) ((DrawerConfiguration) targetEObject).eContainer();
+ PaletteConfigurationUtils.moveDrawerConfiguration(paletteConfiguration, drawerConfigurationToMove, (DrawerConfiguration) targetEObject);
}
return super.caseDrawerConfiguration(drawerConfigurationToMove);
@@ -553,14 +553,14 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
*/
@Override
public Object caseSeparatorConfiguration(SeparatorConfiguration separatorConfigurationToMove) {
- if(targetEObject instanceof DrawerConfiguration) {
- PaletteConfigurationUtils.moveSeparatorConfiguration(((DrawerConfiguration)targetEObject), separatorConfigurationToMove);
- } else if(targetEObject instanceof StackConfiguration) {
- PaletteConfigurationUtils.moveSeparatorConfiguration(((StackConfiguration)targetEObject), separatorConfigurationToMove);
- } else if(targetEObject instanceof ToolConfiguration) {
- PaletteConfigurationUtils.moveSeparatorConfiguration(((ToolConfiguration)targetEObject), separatorConfigurationToMove);
- } else if(targetEObject instanceof SeparatorConfiguration) {
- PaletteConfigurationUtils.moveSeparatorConfiguration(((SeparatorConfiguration)targetEObject), separatorConfigurationToMove);
+ if (targetEObject instanceof DrawerConfiguration) {
+ PaletteConfigurationUtils.moveSeparatorConfiguration(((DrawerConfiguration) targetEObject), separatorConfigurationToMove);
+ } else if (targetEObject instanceof StackConfiguration) {
+ PaletteConfigurationUtils.moveSeparatorConfiguration(((StackConfiguration) targetEObject), separatorConfigurationToMove);
+ } else if (targetEObject instanceof ToolConfiguration) {
+ PaletteConfigurationUtils.moveSeparatorConfiguration(((ToolConfiguration) targetEObject), separatorConfigurationToMove);
+ } else if (targetEObject instanceof SeparatorConfiguration) {
+ PaletteConfigurationUtils.moveSeparatorConfiguration(((SeparatorConfiguration) targetEObject), separatorConfigurationToMove);
}
return super.caseSeparatorConfiguration(separatorConfigurationToMove);
@@ -571,14 +571,14 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
*/
@Override
public Object caseStackConfiguration(StackConfiguration stackConfigurationToMove) {
- if(targetEObject instanceof DrawerConfiguration) {
- PaletteConfigurationUtils.moveStackConfiguration(((DrawerConfiguration)targetEObject), stackConfigurationToMove);
- } else if(targetEObject instanceof StackConfiguration) {
- PaletteConfigurationUtils.moveStackConfiguration(((StackConfiguration)targetEObject), stackConfigurationToMove);
- } else if(targetEObject instanceof ToolConfiguration) {
- PaletteConfigurationUtils.moveStackConfiguration(((ToolConfiguration)targetEObject), stackConfigurationToMove);
- } else if(targetEObject instanceof SeparatorConfiguration) {
- PaletteConfigurationUtils.moveStackConfiguration(((SeparatorConfiguration)targetEObject), stackConfigurationToMove);
+ if (targetEObject instanceof DrawerConfiguration) {
+ PaletteConfigurationUtils.moveStackConfiguration(((DrawerConfiguration) targetEObject), stackConfigurationToMove);
+ } else if (targetEObject instanceof StackConfiguration) {
+ PaletteConfigurationUtils.moveStackConfiguration(((StackConfiguration) targetEObject), stackConfigurationToMove);
+ } else if (targetEObject instanceof ToolConfiguration) {
+ PaletteConfigurationUtils.moveStackConfiguration(((ToolConfiguration) targetEObject), stackConfigurationToMove);
+ } else if (targetEObject instanceof SeparatorConfiguration) {
+ PaletteConfigurationUtils.moveStackConfiguration(((SeparatorConfiguration) targetEObject), stackConfigurationToMove);
}
return super.caseStackConfiguration(stackConfigurationToMove);
@@ -589,14 +589,14 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
*/
@Override
public Object caseToolConfiguration(ToolConfiguration toolConfigurationToMove) {
- if(targetEObject instanceof DrawerConfiguration) {
- PaletteConfigurationUtils.moveToolConfiguration(((DrawerConfiguration)targetEObject), toolConfigurationToMove);
- } else if(targetEObject instanceof StackConfiguration) {
- PaletteConfigurationUtils.moveToolConfiguration(((StackConfiguration)targetEObject), toolConfigurationToMove);
- } else if(targetEObject instanceof ToolConfiguration) {
- PaletteConfigurationUtils.moveToolConfiguration(((ToolConfiguration)targetEObject), toolConfigurationToMove);
- } else if(targetEObject instanceof SeparatorConfiguration) {
- PaletteConfigurationUtils.moveToolConfiguration(((SeparatorConfiguration)targetEObject), toolConfigurationToMove);
+ if (targetEObject instanceof DrawerConfiguration) {
+ PaletteConfigurationUtils.moveToolConfiguration(((DrawerConfiguration) targetEObject), toolConfigurationToMove);
+ } else if (targetEObject instanceof StackConfiguration) {
+ PaletteConfigurationUtils.moveToolConfiguration(((StackConfiguration) targetEObject), toolConfigurationToMove);
+ } else if (targetEObject instanceof ToolConfiguration) {
+ PaletteConfigurationUtils.moveToolConfiguration(((ToolConfiguration) targetEObject), toolConfigurationToMove);
+ } else if (targetEObject instanceof SeparatorConfiguration) {
+ PaletteConfigurationUtils.moveToolConfiguration(((SeparatorConfiguration) targetEObject), toolConfigurationToMove);
}
return super.caseToolConfiguration(toolConfigurationToMove);
@@ -615,7 +615,7 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
public void dragOver(DropTargetEvent event) {
super.dragOver(event);
- IStructuredSelection transferedSelection = (IStructuredSelection)LocalSelectionTransfer.getTransfer().nativeToJava(event.currentDataType);
+ IStructuredSelection transferedSelection = (IStructuredSelection) LocalSelectionTransfer.getTransfer().nativeToJava(event.currentDataType);
// check selection is compatible for drop target
TreeItem item = paletteTreeViewer.getTree().getItem(paletteTreeViewer.getTree().toControl(new Point(event.x, event.y)));
@@ -633,7 +633,7 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
protected void addPalettePreviewDragSupport() {
// transfer types
- Transfer[] transfers = new Transfer[]{ LocalSelectionTransfer.getTransfer() };
+ Transfer[] transfers = new Transfer[] { LocalSelectionTransfer.getTransfer() };
// drag listener
DragSourceListener listener = new DragSourceAdapter() {
@@ -663,33 +663,33 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
/**
* Checks if the selection can be added to the target widget
- *
+ *
* @param transferedSelection
- * the selection to be dropped
+ * the selection to be dropped
* @param widget
- * the widget where to drop
+ * the widget where to drop
*/
protected void checkSelectionForDrop(IStructuredSelection transferedSelection, TreeItem item, final DropTargetEvent event) {
event.detail = DND.DROP_NONE;
final Object objectToTransfer = transferedSelection.getFirstElement();
- if(!(objectToTransfer instanceof IAdaptable)) {
+ if (!(objectToTransfer instanceof IAdaptable)) {
return;
}
final EObject eobjectToTransfer = EMFHelper.getEObject(objectToTransfer);
// handle only first selected element
- if(item == null) {
+ if (item == null) {
// adding to the root, should only be a drawer
- if(eobjectToTransfer instanceof DrawerConfiguration) {
+ if (eobjectToTransfer instanceof DrawerConfiguration) {
event.detail = DND.DROP_LINK;
}
} else {
Object targetObject = item.getData();
- if(!(targetObject instanceof IAdaptable)) {
+ if (!(targetObject instanceof IAdaptable)) {
event.detail = DND.DROP_NONE;
return;
}
final EObject targetEObject = EMFHelper.getEObject(targetObject);
- if(targetEObject == null) {
+ if (targetEObject == null) {
event.detail = DND.DROP_NONE;
return;
}
@@ -701,7 +701,7 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
*/
@Override
public Object caseDrawerConfiguration(DrawerConfiguration object) {
- if(targetEObject instanceof DrawerConfiguration) {
+ if (targetEObject instanceof DrawerConfiguration) {
event.detail = DND.DROP_MOVE;
event.feedback = DND.FEEDBACK_INSERT_BEFORE;
}
@@ -713,15 +713,15 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
*/
@Override
public Object caseSeparatorConfiguration(SeparatorConfiguration object) {
- if(targetEObject instanceof DrawerConfiguration) {
+ if (targetEObject instanceof DrawerConfiguration) {
event.detail = DND.DROP_MOVE;
- } else if(targetEObject instanceof StackConfiguration) {
+ } else if (targetEObject instanceof StackConfiguration) {
event.detail = DND.DROP_MOVE;
event.feedback = DND.FEEDBACK_INSERT_BEFORE;
- } else if(targetEObject instanceof ToolConfiguration) {
+ } else if (targetEObject instanceof ToolConfiguration) {
event.detail = DND.DROP_MOVE;
event.feedback = DND.FEEDBACK_INSERT_BEFORE;
- } else if(targetEObject instanceof SeparatorConfiguration) {
+ } else if (targetEObject instanceof SeparatorConfiguration) {
event.detail = DND.DROP_MOVE;
event.feedback = DND.FEEDBACK_INSERT_BEFORE;
}
@@ -734,15 +734,15 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
*/
@Override
public Object caseStackConfiguration(StackConfiguration object) {
- if(targetEObject instanceof DrawerConfiguration) {
+ if (targetEObject instanceof DrawerConfiguration) {
event.detail = DND.DROP_MOVE;
- } else if(targetEObject instanceof StackConfiguration) {
+ } else if (targetEObject instanceof StackConfiguration) {
event.detail = DND.DROP_MOVE;
event.feedback = DND.FEEDBACK_INSERT_BEFORE;
- } else if(targetEObject instanceof ToolConfiguration) {
+ } else if (targetEObject instanceof ToolConfiguration) {
event.detail = DND.DROP_MOVE;
event.feedback = DND.FEEDBACK_INSERT_BEFORE;
- } else if(targetEObject instanceof SeparatorConfiguration) {
+ } else if (targetEObject instanceof SeparatorConfiguration) {
event.detail = DND.DROP_MOVE;
event.feedback = DND.FEEDBACK_INSERT_BEFORE;
}
@@ -754,14 +754,14 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
*/
@Override
public Object caseToolConfiguration(ToolConfiguration object) {
- if(targetEObject instanceof DrawerConfiguration) {
+ if (targetEObject instanceof DrawerConfiguration) {
event.detail = DND.DROP_MOVE;
- } else if(targetEObject instanceof StackConfiguration) {
+ } else if (targetEObject instanceof StackConfiguration) {
event.detail = DND.DROP_MOVE;
- } else if(targetEObject instanceof ToolConfiguration) {
+ } else if (targetEObject instanceof ToolConfiguration) {
event.detail = DND.DROP_MOVE;
event.feedback = DND.FEEDBACK_INSERT_BEFORE;
- } else if(targetEObject instanceof SeparatorConfiguration) {
+ } else if (targetEObject instanceof SeparatorConfiguration) {
event.detail = DND.DROP_MOVE;
event.feedback = DND.FEEDBACK_INSERT_BEFORE;
}
@@ -789,16 +789,16 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
/**
* Sets the initial content for the palette preview
- *
+ *
* @param descriptor
- * the descriptor that contains the configuration file to load
+ * the descriptor that contains the configuration file to load
*/
public void initializeContent(PapyrusPaletteService.ExtendedProviderDescriptor descriptor) {
resourceSet = createResourceSet();
resourceToEdit = getResourceSet().createResource(descriptor.getRedefinitionFileURI());
// check resource is not null;
- if(resourceToEdit == null) {
+ if (resourceToEdit == null) {
Activator.log.error("No resource has been created for uri :" + descriptor.getRedefinitionFileURI(), null);
}
try {
@@ -811,7 +811,7 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
/**
* Creates and returns the resource set used to modidy the content of the palette configuration
- *
+ *
* @return the newly created ResourceSet.
*/
protected ResourceSet createResourceSet() {
@@ -820,9 +820,9 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
/**
* populates the preview palette toolbar
- *
+ *
* @param toolbar
- * the toolbar to populate
+ * the toolbar to populate
*/
protected void populatePalettePreviewToolBar(ToolBar toolbar) {
ConfigurationSelectedValidator validator = new ConfigurationSelectedValidator();
@@ -835,7 +835,7 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
/**
* Creates the listener for the remove item(s) button
- *
+ *
* @return the listener for the remove button
*/
protected Listener createRemoveElementListener() {
@@ -845,18 +845,18 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
* {@inheritDoc}
*/
public void handleEvent(Event event) {
- IStructuredSelection selection = (IStructuredSelection)paletteTreeViewer.getSelection();
- if(selection == null || selection.size() < 1) {
+ IStructuredSelection selection = (IStructuredSelection) paletteTreeViewer.getSelection();
+ if (selection == null || selection.size() < 1) {
return;
}
Iterator<?> it = selection.iterator();
- while(it.hasNext()) {
+ while (it.hasNext()) {
Object o = it.next();
- if(o instanceof IAdaptable) {
+ if (o instanceof IAdaptable) {
EObject eobject = EMFHelper.getEObject(o);
- if(eobject instanceof Configuration) {
- PaletteConfigurationUtils.removeConfiguration((Configuration)eobject);
+ if (eobject instanceof Configuration) {
+ PaletteConfigurationUtils.removeConfiguration((Configuration) eobject);
}
}
}
@@ -866,7 +866,7 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
/**
* Creates the listener for the new drawer tool item
- *
+ *
* @return the listener created
*/
protected Listener createNewDrawerListener() {
@@ -876,8 +876,8 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
* {@inheritDoc}
*/
public void handleEvent(Event event) {
- PaletteConfiguration paletteConfiguration = (PaletteConfiguration)EcoreUtil.getObjectByType(resourceToEdit.getContents(), PaletteconfigurationPackage.eINSTANCE.getPaletteConfiguration());
- if(paletteConfiguration != null) {
+ PaletteConfiguration paletteConfiguration = (PaletteConfiguration) EcoreUtil.getObjectByType(resourceToEdit.getContents(), PaletteconfigurationPackage.eINSTANCE.getPaletteConfiguration());
+ if (paletteConfiguration != null) {
PaletteConfigurationUtils.createDrawer(paletteConfiguration);
} else {
Activator.log.error("Impossible to find the palette configuration", null);
@@ -890,7 +890,7 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
/**
* Creates the listener for the new stack tool item
- *
+ *
* @return the listener created
*/
protected Listener createNewStackListener() {
@@ -901,10 +901,10 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
*/
public void handleEvent(Event event) {
Configuration selectedConfiguration = getSelectedConfiguration();
- if(selectedConfiguration instanceof DrawerConfiguration) {
- PaletteConfigurationUtils.createStack(((DrawerConfiguration)selectedConfiguration));
- } else if(selectedConfiguration instanceof LeafConfiguration) {
- PaletteConfigurationUtils.createStack(((LeafConfiguration)selectedConfiguration));
+ if (selectedConfiguration instanceof DrawerConfiguration) {
+ PaletteConfigurationUtils.createStack(((DrawerConfiguration) selectedConfiguration));
+ } else if (selectedConfiguration instanceof LeafConfiguration) {
+ PaletteConfigurationUtils.createStack(((LeafConfiguration) selectedConfiguration));
} else {
Activator.log.error("Invalid selection to create a Stack: " + selectedConfiguration, null);
}
@@ -917,9 +917,9 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
/**
* Generates the ID for a local element
- *
+ *
* @param base
- * the begining of the id
+ * the begining of the id
* @return the separator id
*/
protected String generateID(String base) {
@@ -933,7 +933,7 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
/**
* Creates the listener for the new separator tool item
- *
+ *
* @return the listener created
*/
protected Listener createNewSeparatorListener() {
@@ -944,10 +944,10 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
*/
public void handleEvent(Event event) {
Configuration selectedConfiguration = getSelectedConfiguration();
- if(selectedConfiguration instanceof DrawerConfiguration) {
- PaletteConfigurationUtils.createSeparator(((DrawerConfiguration)selectedConfiguration));
- } else if(selectedConfiguration instanceof LeafConfiguration) {
- PaletteConfigurationUtils.createSeparator(((LeafConfiguration)selectedConfiguration));
+ if (selectedConfiguration instanceof DrawerConfiguration) {
+ PaletteConfigurationUtils.createSeparator(((DrawerConfiguration) selectedConfiguration));
+ } else if (selectedConfiguration instanceof LeafConfiguration) {
+ PaletteConfigurationUtils.createSeparator(((LeafConfiguration) selectedConfiguration));
} else {
Activator.log.error("Invalid selection to create a separator: " + selectedConfiguration, null);
}
@@ -959,22 +959,22 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
/**
* Returns the current selected configuration
- *
+ *
* @return the current selected configuration or <code>null</code> if the element is not translatable into a {@link Configuration}
*/
protected Configuration getSelectedConfiguration() {
// retrieve selection
- if(paletteTreeViewer != null && !paletteTreeViewer.getControl().isDisposed()) {
+ if (paletteTreeViewer != null && !paletteTreeViewer.getControl().isDisposed()) {
// retrieve selection. first element should be a drawer
- IStructuredSelection selection = (IStructuredSelection)paletteTreeViewer.getSelection();
- if(selection == null) {
+ IStructuredSelection selection = (IStructuredSelection) paletteTreeViewer.getSelection();
+ if (selection == null) {
return null;
} else {
Object object = selection.getFirstElement();
- if(object instanceof IAdaptable) {
+ if (object instanceof IAdaptable) {
EObject eobject = EMFHelper.getEObject(object);
- if(eobject instanceof Configuration) {
- return (Configuration)eobject;
+ if (eobject instanceof Configuration) {
+ return (Configuration) eobject;
}
}
}
@@ -984,15 +984,15 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
/**
* Creates a toolbar item.
- *
+ *
* @param toolbar
- * the parent toolbar
+ * the parent toolbar
* @param itemIcon
- * path for icon
+ * path for icon
* @param tooltip
- * tooltip text for the toolbar item
+ * tooltip text for the toolbar item
* @param listener
- * listener for tool bar item
+ * listener for tool bar item
*/
protected void createToolBarItem(ToolBar toolbar, String itemIcon, String tooltip, Listener listener, ToolBarItemValidator validator) {
ToolItem item = new ToolItem(toolbar, SWT.BORDER);
@@ -1006,7 +1006,7 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
* creates the buttons to add/remove entries
*/
protected void createAddRemoveButtons() {
- Composite composite = new Composite((Composite)getControl(), SWT.NONE);
+ Composite composite = new Composite((Composite) getControl(), SWT.NONE);
GridLayout layout = new GridLayout(1, true);
composite.setLayout(layout);
@@ -1030,7 +1030,7 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
/**
* selection listener for the tools viewer , to update the state of the add button
- *
+ *
* @return the new created selection listener
*/
protected ISelectionChangedListener createToolsViewerSelectionChangeListener() {
@@ -1043,18 +1043,18 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
// get source and target selection
// check source entry can be added to target entry
- Object source = ((IStructuredSelection)availableToolsViewer.getSelection()).getFirstElement();
- Object target = ((IStructuredSelection)paletteTreeViewer.getSelection()).getFirstElement();
+ Object source = ((IStructuredSelection) availableToolsViewer.getSelection()).getFirstElement();
+ Object target = ((IStructuredSelection) paletteTreeViewer.getSelection()).getFirstElement();
// manage add button
- if(isAddValidTarget(source, target)) {
+ if (isAddValidTarget(source, target)) {
addButton.setEnabled(true);
} else {
addButton.setEnabled(false);
}
// manage remove button
- if(isRemoveValidSource(target)) {
+ if (isRemoveValidSource(target)) {
removeButton.setEnabled(true);
} else {
removeButton.setEnabled(false);
@@ -1064,15 +1064,15 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
/**
* Returns true if the source can be added to the target
- *
+ *
* @param source
- * the source object
+ * the source object
* @param target
- * the target object
+ * the target object
* @return <code>true</code> if the source can be added to the target
*/
protected boolean isAddValidTarget(Object source, Object target) {
- if(!(source instanceof PaletteEntry)) {
+ if (!(source instanceof PaletteEntry)) {
return false;
}
@@ -1081,21 +1081,21 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
// case2: source is a palette tool
// it can't be added to the root element
// it can only be added to a container element (drawer or stack)
- if(source instanceof PaletteDrawer) {
- if(target == null) {
+ if (source instanceof PaletteDrawer) {
+ if (target == null) {
return true;
}
return false;
- } else if(source instanceof ToolEntry) {
- if(target instanceof PaletteEntryProxy) {
- // EntryType type = ((PaletteEntryProxy)target).getType();
- // switch(type) {
- // case DRAWER:
- // case STACK:
- // return true;
- // default:
- // return false;
- // }
+ } else if (source instanceof ToolEntry) {
+ if (target instanceof PaletteEntryProxy) {
+ // EntryType type = ((PaletteEntryProxy)target).getType();
+ // switch(type) {
+ // case DRAWER:
+ // case STACK:
+ // return true;
+ // default:
+ // return false;
+ // }
}
return false;
}
@@ -1104,14 +1104,14 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
/**
* Returns true if the source can be added to the target
- *
+ *
* @param source
- * the source object
+ * the source object
* @return <code>true</code> if the source can be removed (not null and instanceof
* PaletteEntryProxy)
*/
protected boolean isRemoveValidSource(Object source) {
- if(source instanceof PaletteEntryProxy) {
+ if (source instanceof PaletteEntryProxy) {
return true;
}
return false;
@@ -1127,36 +1127,36 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
return new MouseListener() {
public void mouseUp(MouseEvent e) {
- // // add the element selected on the left to the right tree
- // // check the selection.
- // IStructuredSelection selection = (IStructuredSelection)availableToolsViewer.getSelection();
- // if(selection == null || selection.size() < 1) {
- // return;
- // }
- // PaletteEntry entry = (PaletteEntry)selection.getFirstElement();
- // if(entry == null) {
- // return;
- // }
+ // // add the element selected on the left to the right tree
+ // // check the selection.
+ // IStructuredSelection selection = (IStructuredSelection)availableToolsViewer.getSelection();
+ // if(selection == null || selection.size() < 1) {
+ // return;
+ // }
+ // PaletteEntry entry = (PaletteEntry)selection.getFirstElement();
+ // if(entry == null) {
+ // return;
+ // }
//
- // // find the selection on the right
- // selection = (IStructuredSelection)paletteTreeViewer.getSelection();
+ // // find the selection on the right
+ // selection = (IStructuredSelection)paletteTreeViewer.getSelection();
//
- // PaletteEntryProxy parentNode = (PaletteEntryProxy)selection.getFirstElement();
- // // Bugfix: only drawers can be added to root element
- // if(parentNode == null && entry instanceof PaletteDrawer) {
- // parentNode = (PaletteContainerProxy)paletteTreeViewer.getInput();
- // }
+ // PaletteEntryProxy parentNode = (PaletteEntryProxy)selection.getFirstElement();
+ // // Bugfix: only drawers can be added to root element
+ // if(parentNode == null && entry instanceof PaletteDrawer) {
+ // parentNode = (PaletteContainerProxy)paletteTreeViewer.getInput();
+ // }
//
- // // check we have a containe here
- // if(!(parentNode instanceof PaletteContainerProxy)) {
- // return;
- // }
+ // // check we have a containe here
+ // if(!(parentNode instanceof PaletteContainerProxy)) {
+ // return;
+ // }
//
- // // create a new entry in the document
- // PaletteEntryProxy proxy = createNodeFromEntry(entry);
- // ((PaletteContainerProxy)parentNode).addChild(proxy);
+ // // create a new entry in the document
+ // PaletteEntryProxy proxy = createNodeFromEntry(entry);
+ // ((PaletteContainerProxy)parentNode).addChild(proxy);
//
- // paletteTreeViewer.expandToLevel(parentNode, 1);
+ // paletteTreeViewer.expandToLevel(parentNode, 1);
}
/**
@@ -1175,33 +1175,33 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
};
}
- // /**
- // * Creates a node in the xml document from the given entry
- // *
- // * @param entry
- // * the palette entry from which to create the node
- // * @param parentNode
- // * the parent node for the newly created node
- // * @return the created entry proxy or <code>null</code>
- // */
- // protected PaletteEntryProxy createNodeFromEntry(Object entry) {
- // PaletteEntryProxy entryProxy = null;
+ // /**
+ // * Creates a node in the xml document from the given entry
+ // *
+ // * @param entry
+ // * the palette entry from which to create the node
+ // * @param parentNode
+ // * the parent node for the newly created node
+ // * @return the created entry proxy or <code>null</code>
+ // */
+ // protected PaletteEntryProxy createNodeFromEntry(Object entry) {
+ // PaletteEntryProxy entryProxy = null;
//
- // if(entry instanceof AspectCreationEntry) {
- // // should modify id of the element here, otherwise, different elements would have the same id...
- // entryProxy = new PaletteAspectToolEntryProxy(((AspectCreationEntry)entry).clone());
- // } else if(entry instanceof CombinedTemplateCreationEntry) {
- // CombinedTemplateCreationEntry originalEntry = (CombinedTemplateCreationEntry)entry;
- // // create a new Aspect entry proxy
- // AspectCreationEntry aspectEntry = new AspectCreationEntry(originalEntry.getLabel(), originalEntry.getDescription(), originalEntry.getId() + "_" + System.currentTimeMillis(), originalEntry.getSmallIcon(), originalEntry, new HashMap<Object, Object>());
- // entryProxy = new PaletteAspectToolEntryProxy(aspectEntry);
- // } else if(entry instanceof PaletteContainer) {
- // entryProxy = new PaletteContainerProxy((PaletteContainer)entry);
- // } else if(entry instanceof PaletteEntryProxy) {
- // entryProxy = ((PaletteEntryProxy)entry);
- // }
- // return entryProxy;
- // }
+ // if(entry instanceof AspectCreationEntry) {
+ // // should modify id of the element here, otherwise, different elements would have the same id...
+ // entryProxy = new PaletteAspectToolEntryProxy(((AspectCreationEntry)entry).clone());
+ // } else if(entry instanceof CombinedTemplateCreationEntry) {
+ // CombinedTemplateCreationEntry originalEntry = (CombinedTemplateCreationEntry)entry;
+ // // create a new Aspect entry proxy
+ // AspectCreationEntry aspectEntry = new AspectCreationEntry(originalEntry.getLabel(), originalEntry.getDescription(), originalEntry.getId() + "_" + System.currentTimeMillis(), originalEntry.getSmallIcon(), originalEntry, new HashMap<Object, Object>());
+ // entryProxy = new PaletteAspectToolEntryProxy(aspectEntry);
+ // } else if(entry instanceof PaletteContainer) {
+ // entryProxy = new PaletteContainerProxy((PaletteContainer)entry);
+ // } else if(entry instanceof PaletteEntryProxy) {
+ // entryProxy = ((PaletteEntryProxy)entry);
+ // }
+ // return entryProxy;
+ // }
/**
* Creates the add button listener
@@ -1213,12 +1213,12 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
// remove the element selected on the right
// add the element selected on the left to the right tree
// check the selection.
- IStructuredSelection selection = (IStructuredSelection)paletteTreeViewer.getSelection();
- if(selection == null || selection.size() < 1) {
+ IStructuredSelection selection = (IStructuredSelection) paletteTreeViewer.getSelection();
+ if (selection == null || selection.size() < 1) {
return;
}
- PaletteEntryProxy proxyToDelete = (PaletteEntryProxy)selection.getFirstElement();
- if(proxyToDelete == null) {
+ PaletteEntryProxy proxyToDelete = (PaletteEntryProxy) selection.getFirstElement();
+ if (proxyToDelete == null) {
return;
}
@@ -1248,7 +1248,7 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
* creates the available entries group
*/
protected void createAvailableToolsGroup() {
- Composite parent = (Composite)getControl();
+ Composite parent = (Composite) getControl();
Composite availableToolsComposite = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout(2, true);
layout.marginHeight = 0;
@@ -1290,9 +1290,9 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
*/
@Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
- if(element instanceof PaletteStack && "noteStack".equals(((PaletteStack)element).getId())) {
+ if (element instanceof PaletteStack && "noteStack".equals(((PaletteStack) element).getId())) {
return false;
- } else if(element instanceof PaletteToolbar && "standardGroup".equals(((PaletteToolbar)element).getId())) {
+ } else if (element instanceof PaletteToolbar && "standardGroup".equals(((PaletteToolbar) element).getId())) {
return false;
}
return true;
@@ -1306,9 +1306,9 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
/**
* Creates the profile combo
- *
+ *
* @param availableToolsComposite
- * the available tools composite
+ * the available tools composite
* @return the created combo
*/
protected Combo createProfileCombo(Composite availableToolsComposite) {
@@ -1322,11 +1322,11 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
List<Profile> profiles = getAllAppliedProfiles();
int profileNumber = profiles.size();
- for(int i = 0; i < profileNumber; i++) {
+ for (int i = 0; i < profileNumber; i++) {
profileComboList.add(i, profiles.get(i).getName());
}
profileComboList.add(UML_TOOLS_LABEL);
- profileCombo.setItems(profileComboList.toArray(new String[]{}));
+ profileCombo.setItems(profileComboList.toArray(new String[] {}));
// add selection listener for the combo. selects the "UML tools" item
ProfileComboSelectionListener listener = new ProfileComboSelectionListener();
@@ -1339,19 +1339,19 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
/**
* returns the list of applied profile for the nearest package of the top element
- *
+ *
* @return the list of applied profile for the nearest package of the top element or an empty
* list
*/
protected List<Profile> getAllAppliedProfiles() {
Package topPackage = null;
- if(editorPart instanceof DiagramEditorWithFlyOutPalette) {
- EObject element = ((DiagramEditorWithFlyOutPalette)editorPart).getDiagram().getElement();
- if(element instanceof org.eclipse.uml2.uml.Element) {
- topPackage = ((org.eclipse.uml2.uml.Element)element).getNearestPackage();
+ if (editorPart instanceof DiagramEditorWithFlyOutPalette) {
+ EObject element = ((DiagramEditorWithFlyOutPalette) editorPart).getDiagram().getElement();
+ if (element instanceof org.eclipse.uml2.uml.Element) {
+ topPackage = ((org.eclipse.uml2.uml.Element) element).getNearestPackage();
}
}
- if(topPackage != null) {
+ if (topPackage != null) {
return topPackage.getAllAppliedProfiles();
}
return Collections.emptyList();
@@ -1362,7 +1362,7 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
*/
protected void addAvailableToolsDragSupport() {
// transfer types
- Transfer[] transfers = new Transfer[]{ LocalSelectionTransfer.getTransfer() };
+ Transfer[] transfers = new Transfer[] { LocalSelectionTransfer.getTransfer() };
// drag listener
DragSourceListener listener = new DragSourceAdapter() {
@@ -1392,9 +1392,9 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
/**
* Adds elements to the tool bar for available tools viewer
- *
+ *
* @param toolbar
- * the toolbar to populate
+ * the toolbar to populate
*/
protected void populateAvailableToolsToolBar(ToolBar toolbar) {
toggleContentProvider = createCheckToolBarItem(toolbar, SWITCH_CONTENT_PROVIDER_ICON, Messages.Local_Palette_SwitchToolsContentProvider_Tooltip, createSwitchToolsContentProviderListener());
@@ -1405,7 +1405,7 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
/**
* Creates the listener for the available tools content provider
- *
+ *
* @return the listener created
*/
protected Listener createSwitchToolsContentProviderListener() {
@@ -1415,16 +1415,16 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
* {@inheritDoc}
*/
public void handleEvent(Event event) {
- if(!(event.widget instanceof ToolItem)) {
+ if (!(event.widget instanceof ToolItem)) {
return;
}
- ToolItem item = ((ToolItem)event.widget);
+ ToolItem item = ((ToolItem) event.widget);
// retrieve current profile selected in the combo profile
int index = profileCombo.getSelectionIndex();
Collection<PaletteEntry> standardEntries = getAllVisibleStandardEntries();
Profile profile = getAllAppliedProfiles().get(index);
- if(item.getSelection()) {
+ if (item.getSelection()) {
availableToolsViewer.setContentProvider(new ProfileToolsStereotypeMetaclassTreeContentProvider(profile, standardEntries));
item.setSelection(true);
} else {
@@ -1441,7 +1441,7 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
/**
* creates the tool item for drawers visibility listener
- *
+ *
* @return the listener for the tool button
*/
protected Listener createShowDrawerListener() {
@@ -1451,11 +1451,11 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
* {@inheritDoc}
*/
public void handleEvent(Event event) {
- if(!(event.widget instanceof ToolItem)) {
+ if (!(event.widget instanceof ToolItem)) {
return;
}
- ToolItem item = ((ToolItem)event.widget);
- if(item.getSelection()) {
+ ToolItem item = ((ToolItem) event.widget);
+ if (item.getSelection()) {
// elements should be hidden
availableToolsViewer.addFilter(drawerFilter);
item.setSelection(true);
@@ -1469,7 +1469,7 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
/**
* creates the tool item for tools visibility listener
- *
+ *
* @return the listener for the tool button
*/
protected Listener createsShowToolListener() {
@@ -1479,11 +1479,11 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
* {@inheritDoc}
*/
public void handleEvent(Event event) {
- if(!(event.widget instanceof ToolItem)) {
+ if (!(event.widget instanceof ToolItem)) {
return;
}
- ToolItem item = ((ToolItem)event.widget);
- if(item.getSelection()) {
+ ToolItem item = ((ToolItem) event.widget);
+ if (item.getSelection()) {
// elements should be hidden
availableToolsViewer.addFilter(toolFilter);
item.setSelection(true);
@@ -1497,15 +1497,15 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
/**
* Creates a toolbar item which can be checked.
- *
+ *
* @param toolbar
- * the parent toolbar
+ * the parent toolbar
* @param shownElementsIcon
- * path for shown elements icon
+ * path for shown elements icon
* @param listener
- * listener for button action
+ * listener for button action
* @param tooltip
- * tooltip text for the toolbar item
+ * tooltip text for the toolbar item
*/
protected ToolItem createCheckToolBarItem(ToolBar toolbar, String shownElementsIcon, String tooltip, Listener listener) {
ToolItem item = new ToolItem(toolbar, SWT.CHECK | SWT.BORDER);
@@ -1521,7 +1521,7 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
protected boolean validatePage() {
boolean valid = true;
- if(valid) {
+ if (valid) {
setMessage(null);
setErrorMessage(null);
}
@@ -1543,9 +1543,9 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
/**
* Constructor
- *
+ *
* @param viewer
- * The viewer whose ContentProvider this content provider is
+ * The viewer whose ContentProvider this content provider is
*/
public UMLToolsTreeContentProvider() {
}
@@ -1556,15 +1556,15 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
public Object[] getElements(Object inputElement) {
Object[] elements = null;
- if(inputElement instanceof Collection<?>) {
- elements = ((Collection<?>)inputElement).toArray();
- } else if(inputElement instanceof PaletteRoot) {
+ if (inputElement instanceof Collection<?>) {
+ elements = ((Collection<?>) inputElement).toArray();
+ } else if (inputElement instanceof PaletteRoot) {
// paletteUil.getAllEntries(...) to add drawers
// if so, uncomment the addFilterbutton for drawers in populate tool bar
- elements = PaletteUtil.getAllToolEntries(((PaletteRoot)inputElement)).toArray();
+ elements = PaletteUtil.getAllToolEntries(((PaletteRoot) inputElement)).toArray();
}
- if(elements == null) {
+ if (elements == null) {
elements = new Object[0];
}
return elements;
@@ -1589,12 +1589,12 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
public Object[] getChildren(Object parentElement) {
Object[] elements = null;
- if(parentElement instanceof Collection<?>) {
- elements = ((Collection<?>)parentElement).toArray();
- } else if(parentElement instanceof PaletteRoot) {
+ if (parentElement instanceof Collection<?>) {
+ elements = ((Collection<?>) parentElement).toArray();
+ } else if (parentElement instanceof PaletteRoot) {
// paletteUil.getAllEntries(...) to add drawers
// if so, uncomment the addFilterbutton for drawers in populate tool bar
- elements = PaletteUtil.getAllToolEntries(((PaletteRoot)parentElement)).toArray();
+ elements = PaletteUtil.getAllToolEntries(((PaletteRoot) parentElement)).toArray();
}
return elements;
@@ -1619,9 +1619,9 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
* Label provider for palette tools.
* <P>
* We should be using the Palette label provider from GEF, if it was not with visibility "package"...
- *
+ *
* @see org.eclipse.gef.ui.palette.customize.PaletteLabelProvider </P>
- *
+ *
*/
public class PaletteLabelProvider implements ILabelProvider {
@@ -1629,13 +1629,13 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
* {@inheritDoc}
*/
public Image getImage(Object element) {
- if(element instanceof PaletteEntry) {
- ImageDescriptor descriptor = ((PaletteEntry)element).getSmallIcon();
- if(descriptor == null) {
+ if (element instanceof PaletteEntry) {
+ ImageDescriptor descriptor = ((PaletteEntry) element).getSmallIcon();
+ if (descriptor == null) {
return null;
}
return Activator.getPluginIconImage(Activator.ID, descriptor);
- } else if(element instanceof Stereotype) {
+ } else if (element instanceof Stereotype) {
return Activator.getPluginIconImage(Activator.ID, "/icons/stereotype.gif");
}
return null;
@@ -1645,10 +1645,10 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
* {@inheritDoc}
*/
public String getText(Object element) {
- if(element instanceof PaletteEntry) {
- return ((PaletteEntry)element).getLabel();
- } else if(element instanceof Stereotype) {
- return ((Stereotype)element).getName();
+ if (element instanceof PaletteEntry) {
+ return ((PaletteEntry) element).getLabel();
+ } else if (element instanceof Stereotype) {
+ return ((Stereotype) element).getName();
}
return "unknown element";
}
@@ -1687,11 +1687,11 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
* Label provider for palette tools.
* <P>
* We should be using the Palette label provider from GEF, if it was not with visibility "package"...
- *
+ *
* @see org.eclipse.gef.ui.palette.customize.PaletteLabelProvider </P>
- *
+ *
*/
- public class ExtendedPaletteLabelProvider extends CustomizedLabelProvider{
+ public class ExtendedPaletteLabelProvider extends CustomizedLabelProvider {
/**
* Constructor.
@@ -1711,7 +1711,7 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
*/
@Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
- if(element instanceof PaletteDrawer) {
+ if (element instanceof PaletteDrawer) {
return false;
}
return true;
@@ -1729,7 +1729,7 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
*/
@Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
- if(element instanceof ToolEntry) {
+ if (element instanceof ToolEntry) {
return false;
}
return true;
@@ -1744,20 +1744,20 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
private CustomizationCatalogManager catalogManager;
private ResourceSet catalogManagerResourceSet;
-
+
/**
* Constructor.
*/
public ExtendedPaletteContentProvider() {
super(manager);
- //TODO: EMFFACET refactor this code
+ // TODO: EMFFACET refactor this code
catalogManagerResourceSet = new ResourceSetImpl();
- catalogManager=(CustomizationCatalogManager)ICustomizationCatalogManagerFactory.DEFAULT.getOrCreateCustomizationCatalogManager(catalogManagerResourceSet);
- List<Customization> paletteCustomizations =catalogManager.getCustomizationsByName("PaletteConfiguration");
- if(paletteCustomizations.size()>0) {
-// manager.setShowTypeOfLinks(false);
-// manager.registerCustomization(paletteCustomization);
-// manager.loadCustomizations();
+ catalogManager = (CustomizationCatalogManager) ICustomizationCatalogManagerFactory.DEFAULT.getOrCreateCustomizationCatalogManager(catalogManagerResourceSet);
+ List<Customization> paletteCustomizations = catalogManager.getCustomizationsByName("PaletteConfiguration");
+ if (paletteCustomizations.size() > 0) {
+ // manager.setShowTypeOfLinks(false);
+ // manager.registerCustomization(paletteCustomization);
+ // manager.loadCustomizations();
}
}
@@ -1765,27 +1765,27 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
public void dispose() {
super.dispose();
- if(catalogManagerResourceSet != null) {
+ if (catalogManagerResourceSet != null) {
EMFHelper.unload(catalogManagerResourceSet);
catalogManagerResourceSet = null;
}
catalogManager = null;
}
-
+
/**
* {@inheritDoc}
*/
@Override
public Object[] getRootElements(Object inputElement) {
- if(inputElement instanceof PaletteConfiguration) {
- return ((PaletteConfiguration)inputElement).getDrawerConfigurations().toArray();
- } else if(inputElement instanceof Resource) {
- List<EObject> roots = ((Resource)inputElement).getContents();
- if(roots != null && !roots.isEmpty()) {
+ if (inputElement instanceof PaletteConfiguration) {
+ return ((PaletteConfiguration) inputElement).getDrawerConfigurations().toArray();
+ } else if (inputElement instanceof Resource) {
+ List<EObject> roots = ((Resource) inputElement).getContents();
+ if (roots != null && !roots.isEmpty()) {
EObject rootObject = roots.get(0);
- if(rootObject instanceof PaletteConfiguration) {
- return ((PaletteConfiguration)rootObject).getDrawerConfigurations().toArray();
+ if (rootObject instanceof PaletteConfiguration) {
+ return ((PaletteConfiguration) rootObject).getDrawerConfigurations().toArray();
}
}
}
@@ -1798,10 +1798,10 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
@Override
public boolean hasChildren(Object element) {
Object[] children = getChildren(element);
- if(children == null) {
+ if (children == null) {
return false;
}
- if(children.length == 0) {
+ if (children.length == 0) {
return false;
}
return true;
@@ -1811,12 +1811,12 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
/**
* Performs all action on finish
- *
+ *
* @param id
- * the path for the file
+ * the path for the file
*/
public void performFinish(String path) {
- if(resourceToEdit != null) {
+ if (resourceToEdit != null) {
try {
resourceToEdit.save(Collections.emptyMap());
} catch (IOException e) {
@@ -1824,186 +1824,186 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
}
}
- // // creates the document
- // Document document = createXMLDocumentFromPalettePreview();
- // saveDocument(document, path);
+ // // creates the document
+ // Document document = createXMLDocumentFromPalettePreview();
+ // saveDocument(document, path);
// requiredProfiles = collectRequiredProfiles();
}
- // /**
- // * collect the required profiles from all tool provided by the local palette definition
- // */
- // protected Set<String> collectRequiredProfiles() {
- // Set<String> profiles = new HashSet<String>();
- // PaletteContainerProxy rootProxy = (PaletteContainerProxy)paletteTreeViewer.getInput();
- // collectRequiredProfiles(rootProxy.getChildren(), profiles);
- // return profiles;
- // }
+ // /**
+ // * collect the required profiles from all tool provided by the local palette definition
+ // */
+ // protected Set<String> collectRequiredProfiles() {
+ // Set<String> profiles = new HashSet<String>();
+ // PaletteContainerProxy rootProxy = (PaletteContainerProxy)paletteTreeViewer.getInput();
+ // collectRequiredProfiles(rootProxy.getChildren(), profiles);
+ // return profiles;
+ // }
//
- // /**
- // * collect the required profiles from all tool provided by the local palette definition
- // */
- // protected void collectRequiredProfiles(List<PaletteEntryProxy> proxies, Set<String> requiredProfiles) {
- // for(PaletteEntryProxy proxy : proxies) {
- // // add profile(s) if relevant, check for children
+ // /**
+ // * collect the required profiles from all tool provided by the local palette definition
+ // */
+ // protected void collectRequiredProfiles(List<PaletteEntryProxy> proxies, Set<String> requiredProfiles) {
+ // for(PaletteEntryProxy proxy : proxies) {
+ // // add profile(s) if relevant, check for children
//
- // if(proxy instanceof PaletteAspectToolEntryProxy) {
- // // list of profiles
- // for(String stereotypeQN : ((PaletteAspectToolEntryProxy)proxy).getStereotypesQNList()) {
- // // retrieve list of profiles from the stereotype QN (only remove last segment
- // // ?!)
- // String profileName = PaletteUtil.findProfileNameFromStereotypeName(stereotypeQN);
- // requiredProfiles.add(profileName);
- // }
- // }
+ // if(proxy instanceof PaletteAspectToolEntryProxy) {
+ // // list of profiles
+ // for(String stereotypeQN : ((PaletteAspectToolEntryProxy)proxy).getStereotypesQNList()) {
+ // // retrieve list of profiles from the stereotype QN (only remove last segment
+ // // ?!)
+ // String profileName = PaletteUtil.findProfileNameFromStereotypeName(stereotypeQN);
+ // requiredProfiles.add(profileName);
+ // }
+ // }
//
- // if(proxy.getChildren() != null) {
- // collectRequiredProfiles(proxy.getChildren(), requiredProfiles);
- // }
- // }
- // }
+ // if(proxy.getChildren() != null) {
+ // collectRequiredProfiles(proxy.getChildren(), requiredProfiles);
+ // }
+ // }
+ // }
//
- // /**
- // * Saves the xml document into file
- // *
- // * @param document
- // * the document to save
- // * @param path
- // * name of the file
- // * @return the file created or updated
- // */
- // protected File saveDocument(Document document, String path) {
- // File file = null;
- // try {
- // // create the file that stores the XML configuration
- // file = Activator.getDefault().getStateLocation().append(path).toFile();
- // TransformerFactory tranFactory = TransformerFactory.newInstance();
- // Transformer aTransformer;
+ // /**
+ // * Saves the xml document into file
+ // *
+ // * @param document
+ // * the document to save
+ // * @param path
+ // * name of the file
+ // * @return the file created or updated
+ // */
+ // protected File saveDocument(Document document, String path) {
+ // File file = null;
+ // try {
+ // // create the file that stores the XML configuration
+ // file = Activator.getDefault().getStateLocation().append(path).toFile();
+ // TransformerFactory tranFactory = TransformerFactory.newInstance();
+ // Transformer aTransformer;
//
- // aTransformer = tranFactory.newTransformer();
+ // aTransformer = tranFactory.newTransformer();
//
- // Source src = new DOMSource(document);
- // Result dest = new StreamResult(file);
- // aTransformer.transform(src, dest);
- // } catch (TransformerConfigurationException e) {
- // Activator.log.error(e);
- // } catch (TransformerException e) {
- // Activator.log.error(e);
- // }
- // return file;
+ // Source src = new DOMSource(document);
+ // Result dest = new StreamResult(file);
+ // aTransformer.transform(src, dest);
+ // } catch (TransformerConfigurationException e) {
+ // Activator.log.error(e);
+ // } catch (TransformerException e) {
+ // Activator.log.error(e);
+ // }
+ // return file;
//
- // }
+ // }
//
- // /**
- // * Creates the document from the palette preview
- // *
- // * @return the dom structure of the document
- // */
- // protected Document createXMLDocumentFromPalettePreview() {
- // DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
- // documentBuilderFactory.setNamespaceAware(true);
- // DocumentBuilder documentBuilder;
- // try {
- // documentBuilder = documentBuilderFactory.newDocumentBuilder();
- // document = documentBuilder.newDocument();
- // Element paletteDefElement = document.createElement(IPapyrusPaletteConstant.PALETTE_DEFINITION);
- // document.appendChild(paletteDefElement);
- // Element contentElement = document.createElement(IPapyrusPaletteConstant.CONTENT);
- // paletteDefElement.appendChild(contentElement);
+ // /**
+ // * Creates the document from the palette preview
+ // *
+ // * @return the dom structure of the document
+ // */
+ // protected Document createXMLDocumentFromPalettePreview() {
+ // DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
+ // documentBuilderFactory.setNamespaceAware(true);
+ // DocumentBuilder documentBuilder;
+ // try {
+ // documentBuilder = documentBuilderFactory.newDocumentBuilder();
+ // document = documentBuilder.newDocument();
+ // Element paletteDefElement = document.createElement(IPapyrusPaletteConstant.PALETTE_DEFINITION);
+ // document.appendChild(paletteDefElement);
+ // Element contentElement = document.createElement(IPapyrusPaletteConstant.CONTENT);
+ // paletteDefElement.appendChild(contentElement);
//
- // generateXMLPaletteContent(document, contentElement);
- // return document;
- // } catch (ParserConfigurationException e) {
- // Activator.getDefault().logError("impossible to create the palette tree viewer content", e);
- // }
- // return null;
- // }
+ // generateXMLPaletteContent(document, contentElement);
+ // return document;
+ // } catch (ParserConfigurationException e) {
+ // Activator.getDefault().logError("impossible to create the palette tree viewer content", e);
+ // }
+ // return null;
+ // }
//
- // /**
- // * Generates the xml content for the palette
- // *
- // * @param document
- // * the document to fill
- // * @param contentElement
- // * the root for the xml content
- // */
- // protected void generateXMLPaletteContent(Document document, Element contentElement) {
- // PaletteContainerProxy rootProxy = (PaletteContainerProxy)paletteTreeViewer.getInput();
- // for(PaletteEntryProxy proxy : rootProxy.getChildren()) {
- // generateXMLPaletteContainerProxy(document, contentElement, proxy);
- // }
- // }
+ // /**
+ // * Generates the xml content for the palette
+ // *
+ // * @param document
+ // * the document to fill
+ // * @param contentElement
+ // * the root for the xml content
+ // */
+ // protected void generateXMLPaletteContent(Document document, Element contentElement) {
+ // PaletteContainerProxy rootProxy = (PaletteContainerProxy)paletteTreeViewer.getInput();
+ // for(PaletteEntryProxy proxy : rootProxy.getChildren()) {
+ // generateXMLPaletteContainerProxy(document, contentElement, proxy);
+ // }
+ // }
//
- // /**
- // * Generates the xml content for the given container
- // *
- // * @param document
- // * the document to fill
- // * @param containerProxy
- // * the entry proxy
- // */
- // protected void generateXMLPaletteContainerProxy(Document document, Element contentElement, PaletteEntryProxy containerProxy) {
+ // /**
+ // * Generates the xml content for the given container
+ // *
+ // * @param document
+ // * the document to fill
+ // * @param containerProxy
+ // * the entry proxy
+ // */
+ // protected void generateXMLPaletteContainerProxy(Document document, Element contentElement, PaletteEntryProxy containerProxy) {
//
- // Element element = null;
- // List<PaletteEntryProxy> children = containerProxy.getChildren();
- // // generate the element
- // switch(containerProxy.getType()) {
- // case DRAWER:
- // element = document.createElement(IPapyrusPaletteConstant.DRAWER);
- // element.setAttribute(IPapyrusPaletteConstant.NAME, containerProxy.getLabel());
- // if(containerProxy instanceof PaletteLocalDrawerProxy) {
- // element.setAttribute(IPapyrusPaletteConstant.ICON_PATH, ((PaletteLocalDrawerProxy)containerProxy).getImagePath());
- // }
- // break;
- // case TOOL:
- // element = document.createElement(IPapyrusPaletteConstant.TOOL);
- // break;
- // case SEPARATOR:
- // element = document.createElement(IPapyrusPaletteConstant.SEPARATOR);
- // break;
- // case STACK:
- // element = document.createElement(IPapyrusPaletteConstant.STACK);
- // break;
- // case ASPECT_TOOL:
- // element = document.createElement(IPapyrusPaletteConstant.ASPECT_TOOL);
- // // try to cast the element into PaletteAspectToolEntryProxy
- // if(containerProxy instanceof PaletteAspectToolEntryProxy) {
- // PaletteAspectToolEntryProxy aspectEntryProxy = (PaletteAspectToolEntryProxy)containerProxy;
- // // element.setAttribute(IPapyrusPaletteConstant.ID, aspectEntryProxy.getId());
- // element.setAttribute(IPapyrusPaletteConstant.NAME, aspectEntryProxy.getLabel());
- // element.setAttribute(IPapyrusPaletteConstant.DESCRIPTION, aspectEntryProxy.getEntry().getDescription());
- // element.setAttribute(IPapyrusPaletteConstant.REF_TOOL_ID, aspectEntryProxy.getReferencedPaletteID());
+ // Element element = null;
+ // List<PaletteEntryProxy> children = containerProxy.getChildren();
+ // // generate the element
+ // switch(containerProxy.getType()) {
+ // case DRAWER:
+ // element = document.createElement(IPapyrusPaletteConstant.DRAWER);
+ // element.setAttribute(IPapyrusPaletteConstant.NAME, containerProxy.getLabel());
+ // if(containerProxy instanceof PaletteLocalDrawerProxy) {
+ // element.setAttribute(IPapyrusPaletteConstant.ICON_PATH, ((PaletteLocalDrawerProxy)containerProxy).getImagePath());
+ // }
+ // break;
+ // case TOOL:
+ // element = document.createElement(IPapyrusPaletteConstant.TOOL);
+ // break;
+ // case SEPARATOR:
+ // element = document.createElement(IPapyrusPaletteConstant.SEPARATOR);
+ // break;
+ // case STACK:
+ // element = document.createElement(IPapyrusPaletteConstant.STACK);
+ // break;
+ // case ASPECT_TOOL:
+ // element = document.createElement(IPapyrusPaletteConstant.ASPECT_TOOL);
+ // // try to cast the element into PaletteAspectToolEntryProxy
+ // if(containerProxy instanceof PaletteAspectToolEntryProxy) {
+ // PaletteAspectToolEntryProxy aspectEntryProxy = (PaletteAspectToolEntryProxy)containerProxy;
+ // // element.setAttribute(IPapyrusPaletteConstant.ID, aspectEntryProxy.getId());
+ // element.setAttribute(IPapyrusPaletteConstant.NAME, aspectEntryProxy.getLabel());
+ // element.setAttribute(IPapyrusPaletteConstant.DESCRIPTION, aspectEntryProxy.getEntry().getDescription());
+ // element.setAttribute(IPapyrusPaletteConstant.REF_TOOL_ID, aspectEntryProxy.getReferencedPaletteID());
//
- // if(aspectEntryProxy.getImagePath() != null && !aspectEntryProxy.getImagePath().equals("")) {
- // element.setAttribute(IPapyrusPaletteConstant.ICON_PATH, aspectEntryProxy.getImagePath());
- // }
+ // if(aspectEntryProxy.getImagePath() != null && !aspectEntryProxy.getImagePath().equals("")) {
+ // element.setAttribute(IPapyrusPaletteConstant.ICON_PATH, aspectEntryProxy.getImagePath());
+ // }
//
//
- // // add post action, stereotype list
- // for(IAspectAction action : ((PaletteAspectToolEntryProxy)containerProxy).getPostActions()) {
- // Element postActionNode = document.createElement(IPapyrusPaletteConstant.POST_ACTION);
- // postActionNode.setAttribute(IPapyrusPaletteConstant.ID, action.getFactoryId());
- // action.save(postActionNode);
- // element.appendChild(postActionNode);
- // }
- // }
- // default:
- // break;
- // }
+ // // add post action, stereotype list
+ // for(IAspectAction action : ((PaletteAspectToolEntryProxy)containerProxy).getPostActions()) {
+ // Element postActionNode = document.createElement(IPapyrusPaletteConstant.POST_ACTION);
+ // postActionNode.setAttribute(IPapyrusPaletteConstant.ID, action.getFactoryId());
+ // action.save(postActionNode);
+ // element.appendChild(postActionNode);
+ // }
+ // }
+ // default:
+ // break;
+ // }
//
- // element.setAttribute(IPapyrusPaletteConstant.ID, containerProxy.getId());
- // contentElement.appendChild(element);
+ // element.setAttribute(IPapyrusPaletteConstant.ID, containerProxy.getId());
+ // contentElement.appendChild(element);
//
- // if(children != null) {
- // for(PaletteEntryProxy proxy : children) {
- // generateXMLPaletteContainerProxy(document, element, proxy);
- // }
- // }
- // }
+ // if(children != null) {
+ // for(PaletteEntryProxy proxy : children) {
+ // generateXMLPaletteContainerProxy(document, element, proxy);
+ // }
+ // }
+ // }
- // public enum EntryType {
- // DRAWER, TOOL, STACK, SEPARATOR, ASPECT_TOOL
- // }
+ // public enum EntryType {
+ // DRAWER, TOOL, STACK, SEPARATOR, ASPECT_TOOL
+ // }
/**
@@ -2026,21 +2026,21 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
String label1 = "";
String label2 = "";
- if(e1 instanceof PaletteEntry) {
- label1 = ((PaletteEntry)e1).getLabel();
- } else if(e1 instanceof Stereotype) {
- label1 = ((Stereotype)e1).getName();
+ if (e1 instanceof PaletteEntry) {
+ label1 = ((PaletteEntry) e1).getLabel();
+ } else if (e1 instanceof Stereotype) {
+ label1 = ((Stereotype) e1).getName();
}
- if(e2 instanceof PaletteEntry) {
- label2 = ((PaletteEntry)e2).getLabel();
- } else if(e2 instanceof Stereotype) {
- label2 = ((Stereotype)e2).getName();
+ if (e2 instanceof PaletteEntry) {
+ label2 = ((PaletteEntry) e2).getLabel();
+ } else if (e2 instanceof Stereotype) {
+ label2 = ((Stereotype) e2).getName();
}
- if(label1 == null) {
+ if (label1 == null) {
return 1;
}
- if(label2 == null) {
+ if (label2 == null) {
return -1;
}
@@ -2079,26 +2079,26 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
*/
protected void handleSelectionChanged() {
int index = profileCombo.getSelectionIndex();
- if(index < 0 || index >= profileCombo.getItems().length) {
+ if (index < 0 || index >= profileCombo.getItems().length) {
return;
}
String name = profileComboList.get(index);
Collection<PaletteEntry> standardEntries = getAllVisibleStandardEntries();
// retrieve the profile or uml standards tools to display
- if(UML_TOOLS_LABEL.equals(name)) {
+ if (UML_TOOLS_LABEL.equals(name)) {
// change content provider
availableToolsViewer.setContentProvider(new UMLToolsTreeContentProvider());
availableToolsViewer.setInput(standardEntries);
toggleContentProvider.setEnabled(false);
} else {
- if(toggleContentProvider != null && !toggleContentProvider.isDisposed()) {
+ if (toggleContentProvider != null && !toggleContentProvider.isDisposed()) {
toggleContentProvider.setEnabled(true);
}
// switch content provider
// this is a profile in case of uml2 tools
Profile profile = getAllAppliedProfiles().get(index);
- if(toggleContentProvider.getSelection()) {
+ if (toggleContentProvider.getSelection()) {
availableToolsViewer.setContentProvider(new ProfileToolsStereotypeMetaclassTreeContentProvider(profile, standardEntries));
} else {
availableToolsViewer.setContentProvider(new ProfileToolsMetaclassStereotypeTreeContentProvider(profile, standardEntries));
@@ -2121,11 +2121,11 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
/**
* Creates a new ProfileToolsStereotypeMetaclassTreeContentProvider.
- *
+ *
* @param profile
- * the profile for which tools are built
+ * the profile for which tools are built
* @param standardEntries
- * list of standard uml tools palette entries
+ * list of standard uml tools palette entries
*/
public ProfileToolsStereotypeMetaclassTreeContentProvider(Profile profile, Collection<PaletteEntry> standardEntries) {
this.standardEntries = standardEntries;
@@ -2135,29 +2135,30 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
* {@inheritDoc}
*/
public Object[] getChildren(Object parentElement) {
- if(parentElement instanceof Profile) {
- return ((Profile)parentElement).getOwnedStereotypes().toArray();
- } else if(parentElement instanceof Stereotype) {
+ if (parentElement instanceof Profile) {
+ return ((Profile) parentElement).getOwnedStereotypes().toArray();
+ } else if (parentElement instanceof Stereotype) {
List<PaletteEntry> entries = new ArrayList<PaletteEntry>();
- Stereotype stereotype = (Stereotype)parentElement;
+ Stereotype stereotype = (Stereotype) parentElement;
- for(PaletteEntry entry : standardEntries) {
+ for (PaletteEntry entry : standardEntries) {
// retrieve the element type created by the tool.
- if(entry instanceof CombinedTemplateCreationEntry) {
+ if (entry instanceof CombinedTemplateCreationEntry) {
- EClass toolMetaclass = PaletteUtil.getToolMetaclass((CombinedTemplateCreationEntry)entry);
- if(toolMetaclass != null) {
+ EClass toolMetaclass = PaletteUtil.getToolMetaclass((CombinedTemplateCreationEntry) entry);
+ if (toolMetaclass != null) {
List<Class> metaclasses = stereotype.getAllExtendedMetaclasses();
- for(Class stMetaclass : metaclasses) {
+ for (Class stMetaclass : metaclasses) {
// get Eclass
java.lang.Class<?> metaclassClass = stMetaclass.getClass();
- if(metaclassClass != null) {
+ if (metaclassClass != null) {
EClassifier metaClassifier = UMLPackage.eINSTANCE.getEClassifier(stMetaclass.getName());
- if(((EClass)metaClassifier).isSuperTypeOf(toolMetaclass)) {
+ if (((EClass) metaClassifier).isSuperTypeOf(toolMetaclass)) {
// should create the palette entry
Map<Object, Object> properties = new HashMap<Object, Object>();
properties.put(IPapyrusPaletteConstant.ASPECT_ACTION_KEY, StereotypeAspectActionProvider.createConfigurationNode(stereotype.getQualifiedName()));
- AspectCreationEntry aspectEntry = new AspectCreationEntry(stereotype.getName() + " (" + entry.getLabel() + ")", "Create an element with a stereotype", entry.getId() + "_" + System.currentTimeMillis(), entry.getSmallIcon(), (CombinedTemplateCreationEntry)entry, properties);
+ AspectCreationEntry aspectEntry = new AspectCreationEntry(stereotype.getName() + " (" + entry.getLabel() + ")", "Create an element with a stereotype", entry.getId() + "_" + System.currentTimeMillis(),
+ entry.getSmallIcon(), (CombinedTemplateCreationEntry) entry, properties);
entries.add(aspectEntry);
}
}
@@ -2176,8 +2177,8 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
* {@inheritDoc}
*/
public Object getParent(Object element) {
- if(element instanceof Stereotype) {
- return ((Stereotype)element).getProfile();
+ if (element instanceof Stereotype) {
+ return ((Stereotype) element).getProfile();
}
return null;
}
@@ -2186,9 +2187,9 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
* {@inheritDoc}
*/
public boolean hasChildren(Object element) {
- if(element instanceof Profile) {
+ if (element instanceof Profile) {
return true;
- } else if(element instanceof Stereotype) {
+ } else if (element instanceof Stereotype) {
return true;
}
return false;
@@ -2198,8 +2199,8 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
* {@inheritDoc}
*/
public Object[] getElements(Object inputElement) {
- if(inputElement instanceof Profile) {
- List<Stereotype> stereotypes = ((Profile)inputElement).getOwnedStereotypes();
+ if (inputElement instanceof Profile) {
+ List<Stereotype> stereotypes = ((Profile) inputElement).getOwnedStereotypes();
return stereotypes.toArray();
}
return new Object[0];
@@ -2234,11 +2235,11 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
/**
* Creates a new ProfileToolsMetaclassStereotypeTreeContentProvider.
- *
+ *
* @param profile
- * the profile for which tools are built
+ * the profile for which tools are built
* @param standardEntries
- * list of standard uml tools palette entries
+ * list of standard uml tools palette entries
*/
public ProfileToolsMetaclassStereotypeTreeContentProvider(Profile profile, Collection<PaletteEntry> standardEntries) {
this.profile = profile;
@@ -2249,28 +2250,29 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
* {@inheritDoc}
*/
public Object[] getChildren(Object parentElement) {
- if(parentElement instanceof Profile) {
+ if (parentElement instanceof Profile) {
return standardEntries.toArray();
- } else if(parentElement instanceof AspectCreationEntry) {
+ } else if (parentElement instanceof AspectCreationEntry) {
return new Object[0];
- } else if(parentElement instanceof PaletteEntry) {
+ } else if (parentElement instanceof PaletteEntry) {
List<AspectCreationEntry> entries = new ArrayList<AspectCreationEntry>();
// display all stereotypes applicable to the type of element created by this tool
- if(parentElement instanceof CombinedTemplateCreationEntry) {
- CombinedTemplateCreationEntry entry = (CombinedTemplateCreationEntry)parentElement;
+ if (parentElement instanceof CombinedTemplateCreationEntry) {
+ CombinedTemplateCreationEntry entry = (CombinedTemplateCreationEntry) parentElement;
EClass toolMetaclass = PaletteUtil.getToolMetaclass(entry);
- if(toolMetaclass != null) {
- for(Stereotype stereotype : profile.getOwnedStereotypes()) {
+ if (toolMetaclass != null) {
+ for (Stereotype stereotype : profile.getOwnedStereotypes()) {
List<Class> metaclasses = stereotype.getAllExtendedMetaclasses();
- for(Class stMetaclass : metaclasses) {
+ for (Class stMetaclass : metaclasses) {
// get Eclass
EClassifier metaClassifier = UMLPackage.eINSTANCE.getEClassifier(stMetaclass.getName());
- if(((EClass)metaClassifier).isSuperTypeOf(toolMetaclass)) {
+ if (((EClass) metaClassifier).isSuperTypeOf(toolMetaclass)) {
// should create the palette entry
Map<Object, Object> properties = new HashMap<Object, Object>();
// ArrayList<String> stereotypesQNToApply = new ArrayList<String>();
properties.put(IPapyrusPaletteConstant.ASPECT_ACTION_KEY, StereotypeAspectActionProvider.createConfigurationNode(stereotype.getQualifiedName()));
- AspectCreationEntry aspectEntry = new AspectCreationEntry(stereotype.getName() + " (" + entry.getLabel() + ")", "Create an element with a stereotype", entry.getId() + "_" + System.currentTimeMillis(), entry.getSmallIcon(), entry, properties);
+ AspectCreationEntry aspectEntry = new AspectCreationEntry(stereotype.getName() + " (" + entry.getLabel() + ")", "Create an element with a stereotype", entry.getId() + "_" + System.currentTimeMillis(), entry.getSmallIcon(),
+ entry, properties);
entries.add(aspectEntry);
}
}
@@ -2287,8 +2289,8 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
* {@inheritDoc}
*/
public Object getParent(Object element) {
- if(element instanceof Stereotype) {
- return ((Stereotype)element).getProfile();
+ if (element instanceof Stereotype) {
+ return ((Stereotype) element).getProfile();
}
return null;
}
@@ -2297,11 +2299,11 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
* {@inheritDoc}
*/
public boolean hasChildren(Object element) {
- if(element instanceof Profile) {
+ if (element instanceof Profile) {
return true;
- } else if(element instanceof AspectCreationEntry) {
+ } else if (element instanceof AspectCreationEntry) {
return false;
- } else if(element instanceof PaletteEntry) {
+ } else if (element instanceof PaletteEntry) {
return true;
}
return false;
@@ -2311,7 +2313,7 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
* {@inheritDoc}
*/
public Object[] getElements(Object inputElement) {
- if(inputElement instanceof Profile) {
+ if (inputElement instanceof Profile) {
return standardEntries.toArray();
}
return new Object[0];
@@ -2335,14 +2337,14 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
/**
* Returns the list of all visible palette entries
- *
+ *
* @return the list of all visible palette entries
*/
protected Collection<PaletteEntry> getAllVisibleStandardEntries() {
HashSet<PaletteEntry> result = new HashSet<PaletteEntry>();
- for(PaletteEntry entry : PaletteUtil.getAvailableEntriesSet(editorPart, priority).values()) {
+ for (PaletteEntry entry : PaletteUtil.getAvailableEntriesSet(editorPart, priority).values()) {
// the entry is not just a defineOnly entry but a visible one
- if(getRootParent(entry) != null) {
+ if (getRootParent(entry) != null) {
result.add(entry);
}
}
@@ -2351,16 +2353,16 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
/**
* Returns the Root element for the palette entry. It searches recursively from parent to parent, until it find the root element
- *
+ *
* @param entry
- * the palette entry for which root element is searched
+ * the palette entry for which root element is searched
* @return the root element or <code>null</code> if none was found
*/
protected PaletteRoot getRootParent(PaletteEntry entry) {
PaletteContainer parent = entry.getParent();
- if(parent instanceof PaletteRoot) {
- return (PaletteRoot)parent;
- } else if(parent != null) {
+ if (parent instanceof PaletteRoot) {
+ return (PaletteRoot) parent;
+ } else if (parent != null) {
return getRootParent(parent);
} else {
return null;
@@ -2374,7 +2376,7 @@ public class ExtendedPaletteContentPage extends WizardPage implements Listener {
/**
* Checks if the button should be enable or not
- *
+ *
* @return <code>true</code> if the button should be enable
*/
public abstract boolean isEnable();
diff --git a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/ExtendedPaletteInformationPage.java b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/ExtendedPaletteInformationPage.java
index 070f6755321..a8e766aec7f 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/ExtendedPaletteInformationPage.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/ExtendedPaletteInformationPage.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2009 CEA LIST.
- *
+ *
* 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
@@ -83,14 +83,14 @@ public class ExtendedPaletteInformationPage extends WizardPage implements Listen
protected boolean validateOnLaunch = false;
static {
- priorityList = new String[]{ ProviderPriority.LOWEST.getName(), ProviderPriority.LOW.getName(), ProviderPriority.MEDIUM.getName(), ProviderPriority.HIGH.getName(), ProviderPriority.HIGHEST.getName() };
+ priorityList = new String[] { ProviderPriority.LOWEST.getName(), ProviderPriority.LOW.getName(), ProviderPriority.MEDIUM.getName(), ProviderPriority.HIGH.getName(), ProviderPriority.HIGHEST.getName() };
}
/**
* Creates a new wizard page with the given name, title, and image.
- *
+ *
* @param part
- * the editor part in which the wizard was created
+ * the editor part in which the wizard was created
*/
public ExtendedPaletteInformationPage(IEditorPart part) {
super(Messages.Local_Palette_InfoPage_Name, Messages.Local_Palette_InfoPage_Title, Activator.getImageDescriptor(WIZARD_ICON));
@@ -102,8 +102,8 @@ public class ExtendedPaletteInformationPage extends WizardPage implements Listen
*/
@Override
public IWizardPage getNextPage() {
- ExtendedPaletteContentPage contentPage = (ExtendedPaletteContentPage)super.getNextPage();
- if(priority != null) {
+ ExtendedPaletteContentPage contentPage = (ExtendedPaletteContentPage) super.getNextPage();
+ if (priority != null) {
contentPage.setPriority(priority);
contentPage.profileCombo.deselectAll();
contentPage.profileCombo.select(contentPage.profileCombo.getItems().length - 1); // select the last one (UML)
@@ -137,7 +137,7 @@ public class ExtendedPaletteInformationPage extends WizardPage implements Listen
// Show description on opening
setErrorMessage(null);
setMessage(null);
- if(validateOnLaunch) {
+ if (validateOnLaunch) {
setPageComplete(validatePage());
}
setControl(control);
@@ -149,8 +149,8 @@ public class ExtendedPaletteInformationPage extends WizardPage implements Listen
public void intializeValues() {
initName("");
String editorIDValue = "";
- if(editorPart instanceof DiagramEditorWithFlyOutPalette) {
- editorIDValue = ((DiagramEditorWithFlyOutPalette)editorPart).getContributorId();
+ if (editorPart instanceof DiagramEditorWithFlyOutPalette) {
+ editorIDValue = ((DiagramEditorWithFlyOutPalette) editorPart).getContributorId();
}
initEditorID(editorIDValue);
initPaletteID(System.getProperty("user.name") + "_" + System.currentTimeMillis());
@@ -163,8 +163,8 @@ public class ExtendedPaletteInformationPage extends WizardPage implements Listen
public void intializeValues(PapyrusPaletteService.ExtendedProviderDescriptor descriptor) {
initName(descriptor.getContributionName());
String editorIDValue = "";
- if(editorPart instanceof DiagramEditorWithFlyOutPalette) {
- editorIDValue = ((DiagramEditorWithFlyOutPalette)editorPart).getContributorId();
+ if (editorPart instanceof DiagramEditorWithFlyOutPalette) {
+ editorIDValue = ((DiagramEditorWithFlyOutPalette) editorPart).getContributorId();
}
initEditorID(editorIDValue);
initPaletteID(descriptor.getContributionID());
@@ -174,7 +174,7 @@ public class ExtendedPaletteInformationPage extends WizardPage implements Listen
/**
* Returns the current value of palette name
- *
+ *
* @return the current value of palette name
*/
public String getPaletteName() {
@@ -183,7 +183,7 @@ public class ExtendedPaletteInformationPage extends WizardPage implements Listen
/**
* Returns the current value of palette ID
- *
+ *
* @return the current value of palette ID
*/
public String getPaletteID() {
@@ -192,7 +192,7 @@ public class ExtendedPaletteInformationPage extends WizardPage implements Listen
/**
* Returns the current value of editor ID
- *
+ *
* @return the current value of editor ID
*/
public String getEditorID() {
@@ -201,7 +201,7 @@ public class ExtendedPaletteInformationPage extends WizardPage implements Listen
/**
* Returns the current value of editor ID
- *
+ *
* @return the current value of editor ID
*/
public ProviderPriority getPalettePriority() {
@@ -210,9 +210,9 @@ public class ExtendedPaletteInformationPage extends WizardPage implements Listen
/**
* inits the name field value
- *
+ *
* @param value
- * value to set
+ * value to set
*/
protected void initName(String value) {
name = value;
@@ -220,9 +220,9 @@ public class ExtendedPaletteInformationPage extends WizardPage implements Listen
/**
* inits the priority value
- *
+ *
* @param value
- * value to set
+ * value to set
*/
protected void initPriority(ProviderPriority value) {
this.priority = value; // by default, Medium
@@ -230,9 +230,9 @@ public class ExtendedPaletteInformationPage extends WizardPage implements Listen
/**
* inits the palette id value
- *
+ *
* @param value
- * value to set
+ * value to set
*/
protected void initPaletteID(String value) {
paletteID = value;
@@ -241,9 +241,9 @@ public class ExtendedPaletteInformationPage extends WizardPage implements Listen
/**
* inits the editor id value
- *
+ *
* @param value
- * value to set
+ * value to set
*/
protected void initEditorID(String value) {
editorID = value;
@@ -254,19 +254,19 @@ public class ExtendedPaletteInformationPage extends WizardPage implements Listen
*/
protected boolean validatePage() {
boolean valid = true;
- if(advancedComposite != null && !advancedComposite.isDisposed()) {
- if("".equals(getPaletteID())) {
+ if (advancedComposite != null && !advancedComposite.isDisposed()) {
+ if ("".equals(getPaletteID())) {
setErrorMessage(Messages.Local_Palette_Error_PaletteId);
valid = false;
}
}
- if("".equals(getPaletteName())) {
+ if ("".equals(getPaletteName())) {
setErrorMessage(Messages.Local_Palette_Error_Name);
valid = false;
}
- if(valid) {
+ if (valid) {
setMessage(null);
setErrorMessage(null);
}
@@ -275,9 +275,9 @@ public class ExtendedPaletteInformationPage extends WizardPage implements Listen
/**
* Creates the widget for advanced options.
- *
+ *
* @param parent
- * the parent composite
+ * the parent composite
*/
protected void createAdvancedControls(Composite parent) {
advancedButton = new Button(parent, SWT.PUSH);
@@ -319,9 +319,9 @@ public class ExtendedPaletteInformationPage extends WizardPage implements Listen
* Shows/hides the advanced option widgets.
*/
protected void handleAdvancedButtonSelect() {
- Composite composite = (Composite)getControl();
+ Composite composite = (Composite) getControl();
- if(advancedComposite != null) {
+ if (advancedComposite != null) {
advancedComposite.dispose();
advancedComposite = null;
advancedButton.setText(Messages.Dialog_Advanced_Button_Closed);
@@ -333,9 +333,9 @@ public class ExtendedPaletteInformationPage extends WizardPage implements Listen
/**
* creates the control area for the priority
- *
+ *
* @param control
- * the parent composite
+ * the parent composite
*/
protected void createPriorityControl(Composite control) {
final Label priorityLabel = new Label(control, SWT.NONE);
@@ -359,9 +359,9 @@ public class ExtendedPaletteInformationPage extends WizardPage implements Listen
/**
* creates the control area for the id definition
- *
+ *
* @param control
- * the parent composite
+ * the parent composite
*/
protected void createIDControl(Composite control) {
final Label idLabel = new Label(control, SWT.NONE);
@@ -387,9 +387,9 @@ public class ExtendedPaletteInformationPage extends WizardPage implements Listen
/**
* creates the control area for the name definition
- *
+ *
* @param control
- * the parent composite
+ * the parent composite
*/
protected void createNameControl(Composite control) {
final Label nameLabel = new Label(control, SWT.NONE);
@@ -409,9 +409,9 @@ public class ExtendedPaletteInformationPage extends WizardPage implements Listen
/**
* creates the control area for the name definition
- *
+ *
* @param control
- * the parent composite
+ * the parent composite
*/
protected void createEditorIDControl(Composite control) {
final Label editorLabel = new Label(control, SWT.NONE);
@@ -447,11 +447,11 @@ public class ExtendedPaletteInformationPage extends WizardPage implements Listen
*/
public void handleEvent(Event event) {
Widget widget = event.widget;
- if(widget.equals(nameText)) {
+ if (widget.equals(nameText)) {
name = nameText.getText();
- } else if(widget.equals(idText)) {
+ } else if (widget.equals(idText)) {
paletteID = idText.getText();
- } else if(widget.equals(editorText)) {
+ } else if (widget.equals(editorText)) {
editorID = editorText.getText();
}
setPageComplete(validatePage());
diff --git a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/LocalPaletteContentPage.java b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/LocalPaletteContentPage.java
index 5670f3830dc..6e4aa4250f6 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/LocalPaletteContentPage.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/LocalPaletteContentPage.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2009 CEA LIST.
- *
+ *
* 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
@@ -55,6 +55,7 @@ import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorWithFlyOutPalette;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.util.LocalSelectionTransfer;
+import org.eclipse.jface.viewers.AbstractTreeViewer;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.ILabelProvider;
@@ -241,9 +242,9 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
/**
* Creates a new wizard page with the given name, title, and image.
- *
+ *
* @param part
- * the editor part in which the wizard was created
+ * the editor part in which the wizard was created
*/
public LocalPaletteContentPage(IEditorPart part, PaletteCustomizer customizer) {
super(Messages.Local_Palette_ContentPage_Name, Messages.Local_Palette_ContentPage_Title, Activator.getImageDescriptor(WIZARD_ICON));
@@ -303,14 +304,14 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
* Creates the composite group that presents information about ascpect actions for aspect tools
*/
protected void createAspectActionComposite() {
- aspectActionComposite.createComposite((Composite)getControl(), getAllAppliedProfiles());
+ aspectActionComposite.createComposite((Composite) getControl(), getAllAppliedProfiles());
}
/**
* Creates the composite group that presents information about current selected tool
*/
protected void createToolDescriptionGroup() {
- informationComposite.createComposite((Composite)getControl(), getAllAppliedProfiles());
+ informationComposite.createComposite((Composite) getControl(), getAllAppliedProfiles());
}
/**
@@ -321,7 +322,7 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
storedPreferences = PapyrusPalettePreferences.getHiddenPalettes(editorPart);
// remove all, but should only remove visible palettes
- for(String id : storedPreferences) {
+ for (String id : storedPreferences) {
PapyrusPalettePreferences.changePaletteVisibility(id, editorPart, true);
}
}
@@ -331,7 +332,7 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
*/
public void restorePreferences() {
// remove all, but should only remove visible palettes
- for(String id : storedPreferences) {
+ for (String id : storedPreferences) {
PapyrusPalettePreferences.changePaletteVisibility(id, editorPart, false);
}
}
@@ -340,7 +341,7 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
* creates the palette preview group
*/
protected void createPalettePreviewGroup() {
- Composite parent = (Composite)getControl();
+ Composite parent = (Composite) getControl();
Composite paletteComposite = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout(2, true);
@@ -386,28 +387,28 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
/**
* handle the selection change event for the palette preview
- *
+ *
* @param event
- * the event that is thrown by the palette viewer
+ * the event that is thrown by the palette viewer
*/
protected void handlePalettePreviewSelectionChanged(SelectionChangedEvent event) {
// retrieve current selection
- ITreeSelection selection = (TreeSelection)event.getSelection();
+ ITreeSelection selection = (TreeSelection) event.getSelection();
Object firstSelected = selection.getFirstElement();
- if(firstSelected instanceof PaletteEntryProxy) {
+ if (firstSelected instanceof PaletteEntryProxy) {
// update the current selected palette entry proxy
- selectedEntryProxy = ((PaletteEntryProxy)firstSelected);
+ selectedEntryProxy = ((PaletteEntryProxy) firstSelected);
informationComposite.setSelectedEntryProxy(selectedEntryProxy);
aspectActionComposite.setSelectedEntryProxy(selectedEntryProxy);
}
// update toolbar
- if(toolbar != null && !toolbar.isDisposed()) {
- for(int i = 0; i < toolbar.getItemCount(); i++) {
+ if (toolbar != null && !toolbar.isDisposed()) {
+ for (int i = 0; i < toolbar.getItemCount(); i++) {
ToolItem item = toolbar.getItem(i);
Object validator = item.getData(VALIDATOR);
- if(validator instanceof ToolBarItemValidator) {
- item.setEnabled(((ToolBarItemValidator)validator).isEnable());
+ if (validator instanceof ToolBarItemValidator) {
+ item.setEnabled(((ToolBarItemValidator) validator).isEnable());
}
}
}
@@ -433,13 +434,13 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
*/
public void doubleClick(DoubleClickEvent event) {
// retrieve current item double clicked...
- ITreeSelection selection = (TreeSelection)event.getSelection();
+ ITreeSelection selection = (TreeSelection) event.getSelection();
Object firstSelected = selection.getFirstElement();
- if(firstSelected instanceof PaletteLocalDrawerProxy) {
- UpdateLocalDrawerWizard wizard = new UpdateLocalDrawerWizard(((PaletteLocalDrawerProxy)firstSelected).getParent(), (PaletteLocalDrawerProxy)firstSelected);
+ if (firstSelected instanceof PaletteLocalDrawerProxy) {
+ UpdateLocalDrawerWizard wizard = new UpdateLocalDrawerWizard(((PaletteLocalDrawerProxy) firstSelected).getParent(), (PaletteLocalDrawerProxy) firstSelected);
WizardDialog dialog = new WizardDialog(getShell(), wizard);
dialog.open();
- //paletteTreeViewer.refresh();
+ // paletteTreeViewer.refresh();
}
}
});
@@ -451,7 +452,7 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
*/
protected void addPalettePreviewDropSupport() {
// transfer types
- Transfer[] transfers = new Transfer[]{ LocalSelectionTransfer.getTransfer() };
+ Transfer[] transfers = new Transfer[] { LocalSelectionTransfer.getTransfer() };
// drag listener
DropTargetListener listener = new TreeDropTargetEffect(paletteTreeViewer.getTree()) {
@@ -464,32 +465,32 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
super.drop(event);
// create proxy and adds it to its target parent
- PaletteEntryProxy target = (PaletteEntryProxy)((TreeItem)event.item).getData();
- if(target == null) {
- target = (PaletteContainerProxy)paletteTreeViewer.getInput();
+ PaletteEntryProxy target = (PaletteEntryProxy) ((TreeItem) event.item).getData();
+ if (target == null) {
+ target = (PaletteContainerProxy) paletteTreeViewer.getInput();
}
// get the elements from the drag listener (either a palette entry or a palette
// entry proxy)
- IStructuredSelection transferedSelection = (IStructuredSelection)LocalSelectionTransfer.getTransfer().nativeToJava(event.currentDataType);
+ IStructuredSelection transferedSelection = (IStructuredSelection) LocalSelectionTransfer.getTransfer().nativeToJava(event.currentDataType);
Object entry = transferedSelection.getFirstElement();
// creates the proxy for the element to be dropped
PaletteEntryProxy entryProxy = createNodeFromEntry(entry);
- if(entryProxy == null) {
+ if (entryProxy == null) {
return;
}
- if(target instanceof PaletteContainerProxy) {
+ if (target instanceof PaletteContainerProxy) {
// tries to remove from its parent if possible
- if(entryProxy.getParent() != null) {
+ if (entryProxy.getParent() != null) {
entryProxy.getParent().removeChild(entryProxy);
}
- ((PaletteContainerProxy)target).addChild(entryProxy);
+ ((PaletteContainerProxy) target).addChild(entryProxy);
paletteTreeViewer.expandToLevel(target, 1);
- } else if(target instanceof PaletteEntryProxy) {
+ } else if (target instanceof PaletteEntryProxy) {
// tries to remove from its parent if possible
- if(entryProxy.getParent() != null) {
+ if (entryProxy.getParent() != null) {
entryProxy.getParent().removeChild(entryProxy);
}
target.getParent().addChild(entryProxy, target);
@@ -497,7 +498,7 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
} else {
// add to parent...
target.getParent().addChild(entryProxy);
- paletteTreeViewer.expandToLevel(target.getParent(), TreeViewer.ALL_LEVELS);
+ paletteTreeViewer.expandToLevel(target.getParent(), AbstractTreeViewer.ALL_LEVELS);
}
setPageComplete(validatePage());
}
@@ -509,7 +510,7 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
public void dragOver(DropTargetEvent event) {
super.dragOver(event);
- IStructuredSelection transferedSelection = (IStructuredSelection)LocalSelectionTransfer.getTransfer().nativeToJava(event.currentDataType);
+ IStructuredSelection transferedSelection = (IStructuredSelection) LocalSelectionTransfer.getTransfer().nativeToJava(event.currentDataType);
// check selection is compatible for drop target
TreeItem item = paletteTreeViewer.getTree().getItem(paletteTreeViewer.getTree().toControl(new Point(event.x, event.y)));
@@ -527,7 +528,7 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
protected void addPalettePreviewDragSupport() {
// transfer types
- Transfer[] transfers = new Transfer[]{ LocalSelectionTransfer.getTransfer() };
+ Transfer[] transfers = new Transfer[] { LocalSelectionTransfer.getTransfer() };
// drag listener
DragSourceListener listener = new DragSourceAdapter() {
@@ -557,49 +558,49 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
/**
* Checks if the selection can be added to the target widget
- *
+ *
* @param transferedSelection
- * the selection to be dropped
+ * the selection to be dropped
* @param widget
- * the widget where to drop
+ * the widget where to drop
* @return <code>true</code> if element can be dropped
*/
protected void checkSelectionForDrop(IStructuredSelection transferedSelection, TreeItem item, DropTargetEvent event) {
event.detail = DND.DROP_NONE;
Object entry = transferedSelection.getFirstElement();
// handle only first selected element
- if(item == null) {
+ if (item == null) {
// adding to the root, should only be a drawer
- if(entry instanceof PaletteDrawer) {
+ if (entry instanceof PaletteDrawer) {
event.detail = DND.DROP_LINK;
}
} else {
- PaletteEntryProxy targetProxy = (PaletteEntryProxy)item.getData();
- switch(targetProxy.getType()) {
+ PaletteEntryProxy targetProxy = (PaletteEntryProxy) item.getData();
+ switch (targetProxy.getType()) {
case DRAWER:
- if(entry instanceof ToolEntry) {
+ if (entry instanceof ToolEntry) {
event.detail = DND.DROP_LINK;
- } else if(entry instanceof PaletteEntryProxy) {
+ } else if (entry instanceof PaletteEntryProxy) {
event.detail = DND.DROP_MOVE;
}
break;
case STACK:
- if(entry instanceof ToolEntry) {
+ if (entry instanceof ToolEntry) {
event.detail = DND.DROP_LINK;
- } else if(entry instanceof PaletteEntryProxy && !(entry instanceof PaletteLocalStackProxy)) {
+ } else if (entry instanceof PaletteEntryProxy && !(entry instanceof PaletteLocalStackProxy)) {
event.detail = DND.DROP_MOVE;
}
break;
case TOOL:
- if(entry instanceof ToolEntry) {
+ if (entry instanceof ToolEntry) {
event.detail = DND.DROP_LINK; // add the selected tool before the destination
// tool
- } else if(entry instanceof PaletteEntryProxy) {
+ } else if (entry instanceof PaletteEntryProxy) {
event.detail = DND.DROP_MOVE; // moves the element before the entry
}
break;
case SEPARATOR:
- if(entry instanceof PaletteEntryProxy) {
+ if (entry instanceof PaletteEntryProxy) {
event.detail = DND.DROP_MOVE;
}
break;
@@ -639,18 +640,18 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
// URL url = bundle.getEntry(path);
File file = Activator.getDefault().getStateLocation().append(xmlPath).toFile();
- if(!file.exists()) {
+ if (!file.exists()) {
Activator.log.error("Impossible to load file: " + file, null);
} else {
Document document = documentBuilder.parse(file);
Map<String, PaletteEntry> entries = PaletteUtil.getAvailableEntriesSet(editorPart, ProviderPriority.HIGHEST);
-
+
XMLPaletteDefinitionProxyFactory factory = new XMLPaletteDefinitionProxyFactory(entries);
XMLPaletteDefinitionWalker walker = new XMLPaletteDefinitionWalker(factory);
-
- for(int i = 0; i < document.getChildNodes().getLength(); i++) {
+
+ for (int i = 0; i < document.getChildNodes().getLength(); i++) {
Node node = document.getChildNodes().item(i);
- if(IPapyrusPaletteConstant.PALETTE_DEFINITION.equals(node.getNodeName())) {
+ if (IPapyrusPaletteConstant.PALETTE_DEFINITION.equals(node.getNodeName())) {
walker.walk(node);
}
}
@@ -674,11 +675,11 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
/**
* Saves the xml document into file
- *
+ *
* @param document
- * the document to save
+ * the document to save
* @param path
- * name of the file
+ * name of the file
* @return the file created or updated
*/
protected File loadDocument(Document document, String path) {
@@ -702,9 +703,9 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
/**
* populates the preview palette toolbar
- *
+ *
* @param toolbar
- * the toolbar to populate
+ * the toolbar to populate
*/
protected void populatePalettePreviewToolBar(ToolBar toolbar) {
PaletteEntryProxySelectedValidator validator = new PaletteEntryProxySelectedValidator();
@@ -717,7 +718,7 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
/**
* Edits the current selected elements. This works for drawers, should work on more elements
- *
+ *
* @return the listener for the edit button
*/
protected Listener createEditElementListener() {
@@ -727,14 +728,14 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
* {@inheritDoc}
*/
public void handleEvent(Event event) {
- IStructuredSelection selection = (IStructuredSelection)paletteTreeViewer.getSelection();
- if(selection == null || selection.size() < 1) {
+ IStructuredSelection selection = (IStructuredSelection) paletteTreeViewer.getSelection();
+ if (selection == null || selection.size() < 1) {
return;
}
Object selected = selection.getFirstElement();
- if(selected instanceof PaletteLocalDrawerProxy) {
- UpdateLocalDrawerWizard wizard = new UpdateLocalDrawerWizard(((PaletteLocalDrawerProxy)selected).getParent(), (PaletteLocalDrawerProxy)selected);
+ if (selected instanceof PaletteLocalDrawerProxy) {
+ UpdateLocalDrawerWizard wizard = new UpdateLocalDrawerWizard(((PaletteLocalDrawerProxy) selected).getParent(), (PaletteLocalDrawerProxy) selected);
WizardDialog dialog = new WizardDialog(getShell(), wizard);
dialog.open();
}
@@ -746,7 +747,7 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
/**
* Creates the listener for the remove item(s) button
- *
+ *
* @return the listener for the remove button
*/
protected Listener createRemoveElementListener() {
@@ -756,20 +757,20 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
* {@inheritDoc}
*/
public void handleEvent(Event event) {
- IStructuredSelection selection = (IStructuredSelection)paletteTreeViewer.getSelection();
- if(selection == null || selection.size() < 1) {
+ IStructuredSelection selection = (IStructuredSelection) paletteTreeViewer.getSelection();
+ if (selection == null || selection.size() < 1) {
return;
}
Iterator<Object> it = selection.iterator();
- while(it.hasNext()) {
+ while (it.hasNext()) {
Object o = it.next();
- if(o instanceof PaletteEntryProxy) {
- PaletteEntryProxy proxyToDelete = (PaletteEntryProxy)o;
+ if (o instanceof PaletteEntryProxy) {
+ PaletteEntryProxy proxyToDelete = (PaletteEntryProxy) o;
// create a new entry in the document
// get container of the proxy to be deleted
PaletteContainerProxy parentProxy = proxyToDelete.getParent();
- if(parentProxy != null) {
+ if (parentProxy != null) {
parentProxy.removeChild(proxyToDelete);
}
}
@@ -781,7 +782,7 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
/**
* Creates the listener for the new drawer tool item
- *
+ *
* @return the listener created
*/
protected Listener createNewDrawerListener() {
@@ -793,7 +794,7 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
public void handleEvent(Event event) {
// retrieve selected container
PaletteContainerProxy containerProxy;
- containerProxy = (PaletteContainerProxy)paletteTreeViewer.getInput();
+ containerProxy = (PaletteContainerProxy) paletteTreeViewer.getInput();
NewDrawerWizard wizard = new NewDrawerWizard(containerProxy);
WizardDialog wizardDialog = new WizardDialog(new Shell(), wizard);
wizardDialog.open();
@@ -805,7 +806,7 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
/**
* Creates the listener for the new stack tool item
- *
+ *
* @return the listener created
*/
protected Listener createNewStackListener() {
@@ -816,21 +817,21 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
*/
public void handleEvent(Event event) {
// retrieve selected element
- Object object = ((IStructuredSelection)paletteTreeViewer.getSelection()).getFirstElement();
+ Object object = ((IStructuredSelection) paletteTreeViewer.getSelection()).getFirstElement();
// if element = drawer => the new stack must be created at the end of the drawer's
// children list
// if element = tool => must be placed before this tool
// else : nothinng to do
- if(object instanceof PaletteLocalDrawerProxy) {
+ if (object instanceof PaletteLocalDrawerProxy) {
String id = generateID("Stack");
PaletteLocalStackProxy proxy = new PaletteLocalStackProxy(id);
- ((PaletteLocalDrawerProxy)object).addChild(proxy);
- } else if(object instanceof PaletteEntryProxy) {
+ ((PaletteLocalDrawerProxy) object).addChild(proxy);
+ } else if (object instanceof PaletteEntryProxy) {
String id = generateID("Stack");
PaletteLocalStackProxy proxy = new PaletteLocalStackProxy(id);
// retrieve parent
- PaletteEntryProxy childProxy = (PaletteEntryProxy)object;
+ PaletteEntryProxy childProxy = (PaletteEntryProxy) object;
PaletteContainerProxy parentProxy = childProxy.getParent();
parentProxy.addChild(proxy, childProxy);
}
@@ -843,9 +844,9 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
/**
* Generates the ID for a local element
- *
+ *
* @param base
- * the begining of the id
+ * the begining of the id
* @return the separator id
*/
protected String generateID(String base) {
@@ -859,7 +860,7 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
/**
* Creates the listener for the new separator tool item
- *
+ *
* @return the listener created
*/
protected Listener createNewSeparatorListener() {
@@ -870,21 +871,21 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
*/
public void handleEvent(Event event) {
// retrieve selected element
- Object object = ((IStructuredSelection)paletteTreeViewer.getSelection()).getFirstElement();
+ Object object = ((IStructuredSelection) paletteTreeViewer.getSelection()).getFirstElement();
// if element = drawer => the new stack must be created at the end of the drawer's
// children list
// if element = tool => must be placed before this tool
// else : nothinng to do
- if(object instanceof PaletteLocalDrawerProxy) {
+ if (object instanceof PaletteLocalDrawerProxy) {
String id = generateID("Separator");
PaletteLocalSeparatorProxy proxy = new PaletteLocalSeparatorProxy(id);
- ((PaletteLocalDrawerProxy)object).addChild(proxy);
- } else if(object instanceof PaletteEntryProxy) {
+ ((PaletteLocalDrawerProxy) object).addChild(proxy);
+ } else if (object instanceof PaletteEntryProxy) {
String id = generateID("Separator");
PaletteLocalSeparatorProxy proxy = new PaletteLocalSeparatorProxy(id);
// retrieve parent
- PaletteEntryProxy childProxy = (PaletteEntryProxy)object;
+ PaletteEntryProxy childProxy = (PaletteEntryProxy) object;
PaletteContainerProxy parentProxy = childProxy.getParent();
parentProxy.addChild(proxy, childProxy);
}
@@ -896,15 +897,15 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
/**
* Creates a toolbar item.
- *
+ *
* @param toolbar
- * the parent toolbar
+ * the parent toolbar
* @param itemIcon
- * path for icon
+ * path for icon
* @param tooltip
- * tooltip text for the toolbar item
+ * tooltip text for the toolbar item
* @param listener
- * listener for tool bar item
+ * listener for tool bar item
*/
protected void createToolBarItem(ToolBar toolbar, String itemIcon, String tooltip, Listener listener, ToolBarItemValidator validator) {
ToolItem item = new ToolItem(toolbar, SWT.BORDER);
@@ -918,7 +919,7 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
* creates the buttons to add/remove entries
*/
protected void createAddRemoveButtons() {
- Composite composite = new Composite((Composite)getControl(), SWT.NONE);
+ Composite composite = new Composite((Composite) getControl(), SWT.NONE);
GridLayout layout = new GridLayout(1, true);
composite.setLayout(layout);
@@ -942,7 +943,7 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
/**
* selection listener for the tools viewer , to update the state of the add button
- *
+ *
* @return the new created selection listener
*/
protected ISelectionChangedListener createToolsViewerSelectionChangeListener() {
@@ -955,18 +956,18 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
// get source and target selection
// check source entry can be added to target entry
- Object source = ((IStructuredSelection)availableToolsViewer.getSelection()).getFirstElement();
- Object target = ((IStructuredSelection)paletteTreeViewer.getSelection()).getFirstElement();
+ Object source = ((IStructuredSelection) availableToolsViewer.getSelection()).getFirstElement();
+ Object target = ((IStructuredSelection) paletteTreeViewer.getSelection()).getFirstElement();
// manage add button
- if(isAddValidTarget(source, target)) {
+ if (isAddValidTarget(source, target)) {
addButton.setEnabled(true);
} else {
addButton.setEnabled(false);
}
// manage remove button
- if(isRemoveValidSource(target)) {
+ if (isRemoveValidSource(target)) {
removeButton.setEnabled(true);
} else {
removeButton.setEnabled(false);
@@ -976,15 +977,15 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
/**
* Returns true if the source can be added to the target
- *
+ *
* @param source
- * the source object
+ * the source object
* @param target
- * the target object
+ * the target object
* @return <code>true</code> if the source can be added to the target
*/
protected boolean isAddValidTarget(Object source, Object target) {
- if(!(source instanceof PaletteEntry)) {
+ if (!(source instanceof PaletteEntry)) {
return false;
}
@@ -993,15 +994,15 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
// case2: source is a palette tool
// it can't be added to the root element
// it can only be added to a container element (drawer or stack)
- if(source instanceof PaletteDrawer) {
- if(target == null) {
+ if (source instanceof PaletteDrawer) {
+ if (target == null) {
return true;
}
return false;
- } else if(source instanceof ToolEntry) {
- if(target instanceof PaletteEntryProxy) {
- EntryType type = ((PaletteEntryProxy)target).getType();
- switch(type) {
+ } else if (source instanceof ToolEntry) {
+ if (target instanceof PaletteEntryProxy) {
+ EntryType type = ((PaletteEntryProxy) target).getType();
+ switch (type) {
case DRAWER:
case STACK:
return true;
@@ -1016,14 +1017,14 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
/**
* Returns true if the source can be added to the target
- *
+ *
* @param source
- * the source object
+ * the source object
* @return <code>true</code> if the source can be removed (not null and instanceof
* PaletteEntryProxy)
*/
protected boolean isRemoveValidSource(Object source) {
- if(source instanceof PaletteEntryProxy) {
+ if (source instanceof PaletteEntryProxy) {
return true;
}
return false;
@@ -1041,32 +1042,32 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
public void mouseUp(MouseEvent e) {
// add the element selected on the left to the right tree
// check the selection.
- IStructuredSelection selection = (IStructuredSelection)availableToolsViewer.getSelection();
- if(selection == null || selection.size() < 1) {
+ IStructuredSelection selection = (IStructuredSelection) availableToolsViewer.getSelection();
+ if (selection == null || selection.size() < 1) {
return;
}
- PaletteEntry entry = (PaletteEntry)selection.getFirstElement();
- if(entry == null) {
+ PaletteEntry entry = (PaletteEntry) selection.getFirstElement();
+ if (entry == null) {
return;
}
// find the selection on the right
- selection = (IStructuredSelection)paletteTreeViewer.getSelection();
+ selection = (IStructuredSelection) paletteTreeViewer.getSelection();
- PaletteEntryProxy parentNode = (PaletteEntryProxy)selection.getFirstElement();
+ PaletteEntryProxy parentNode = (PaletteEntryProxy) selection.getFirstElement();
// Bugfix: only drawers can be added to root element
- if(parentNode == null && entry instanceof PaletteDrawer) {
- parentNode = (PaletteContainerProxy)paletteTreeViewer.getInput();
+ if (parentNode == null && entry instanceof PaletteDrawer) {
+ parentNode = (PaletteContainerProxy) paletteTreeViewer.getInput();
}
// check we have a containe here
- if(!(parentNode instanceof PaletteContainerProxy)) {
+ if (!(parentNode instanceof PaletteContainerProxy)) {
return;
}
// create a new entry in the document
PaletteEntryProxy proxy = createNodeFromEntry(entry);
- ((PaletteContainerProxy)parentNode).addChild(proxy);
+ ((PaletteContainerProxy) parentNode).addChild(proxy);
paletteTreeViewer.expandToLevel(parentNode, 1);
}
@@ -1089,28 +1090,29 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
/**
* Creates a node in the xml document from the given entry
- *
+ *
* @param entry
- * the palette entry from which to create the node
+ * the palette entry from which to create the node
* @param parentNode
- * the parent node for the newly created node
+ * the parent node for the newly created node
* @return the created entry proxy or <code>null</code>
*/
protected PaletteEntryProxy createNodeFromEntry(Object entry) {
PaletteEntryProxy entryProxy = null;
- if(entry instanceof AspectCreationEntry) {
+ if (entry instanceof AspectCreationEntry) {
// should modify id of the element here, otherwise, different elements would have the same id...
- entryProxy = new PaletteAspectToolEntryProxy(((AspectCreationEntry)entry).clone());
- } else if(entry instanceof CombinedTemplateCreationEntry) {
- CombinedTemplateCreationEntry originalEntry = (CombinedTemplateCreationEntry)entry;
+ entryProxy = new PaletteAspectToolEntryProxy(((AspectCreationEntry) entry).clone());
+ } else if (entry instanceof CombinedTemplateCreationEntry) {
+ CombinedTemplateCreationEntry originalEntry = (CombinedTemplateCreationEntry) entry;
// create a new Aspect entry proxy
- AspectCreationEntry aspectEntry = new AspectCreationEntry(originalEntry.getLabel(), originalEntry.getDescription(), originalEntry.getId() + "_" + System.currentTimeMillis(), originalEntry.getSmallIcon(), originalEntry, new HashMap<Object, Object>());
+ AspectCreationEntry aspectEntry = new AspectCreationEntry(originalEntry.getLabel(), originalEntry.getDescription(), originalEntry.getId() + "_" + System.currentTimeMillis(), originalEntry.getSmallIcon(), originalEntry,
+ new HashMap<Object, Object>());
entryProxy = new PaletteAspectToolEntryProxy(aspectEntry);
- } else if(entry instanceof PaletteContainer) {
- entryProxy = new PaletteContainerProxy((PaletteContainer)entry);
- } else if(entry instanceof PaletteEntryProxy) {
- entryProxy = ((PaletteEntryProxy)entry);
+ } else if (entry instanceof PaletteContainer) {
+ entryProxy = new PaletteContainerProxy((PaletteContainer) entry);
+ } else if (entry instanceof PaletteEntryProxy) {
+ entryProxy = ((PaletteEntryProxy) entry);
}
return entryProxy;
}
@@ -1125,12 +1127,12 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
// remove the element selected on the right
// add the element selected on the left to the right tree
// check the selection.
- IStructuredSelection selection = (IStructuredSelection)paletteTreeViewer.getSelection();
- if(selection == null || selection.size() < 1) {
+ IStructuredSelection selection = (IStructuredSelection) paletteTreeViewer.getSelection();
+ if (selection == null || selection.size() < 1) {
return;
}
- PaletteEntryProxy proxyToDelete = (PaletteEntryProxy)selection.getFirstElement();
- if(proxyToDelete == null) {
+ PaletteEntryProxy proxyToDelete = (PaletteEntryProxy) selection.getFirstElement();
+ if (proxyToDelete == null) {
return;
}
@@ -1160,7 +1162,7 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
* creates the available entries group
*/
protected void createAvailableToolsGroup() {
- Composite parent = (Composite)getControl();
+ Composite parent = (Composite) getControl();
Composite availableToolsComposite = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout(2, true);
layout.marginHeight = 0;
@@ -1202,9 +1204,9 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
*/
@Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
- if(element instanceof PaletteStack && "noteStack".equals(((PaletteStack)element).getId())) {
+ if (element instanceof PaletteStack && "noteStack".equals(((PaletteStack) element).getId())) {
return false;
- } else if(element instanceof PaletteToolbar && "standardGroup".equals(((PaletteToolbar)element).getId())) {
+ } else if (element instanceof PaletteToolbar && "standardGroup".equals(((PaletteToolbar) element).getId())) {
return false;
}
return true;
@@ -1218,9 +1220,9 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
/**
* Creates the profile combo
- *
+ *
* @param availableToolsComposite
- * the available tools composite
+ * the available tools composite
* @return the created combo
*/
protected Combo createProfileCombo(Composite availableToolsComposite) {
@@ -1234,11 +1236,11 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
List<Profile> profiles = getAllAppliedProfiles();
int profileNumber = profiles.size();
- for(int i = 0; i < profileNumber; i++) {
+ for (int i = 0; i < profileNumber; i++) {
profileComboList.add(i, profiles.get(i).getName());
}
profileComboList.add(UML_TOOLS_LABEL);
- profileCombo.setItems(profileComboList.toArray(new String[]{}));
+ profileCombo.setItems(profileComboList.toArray(new String[] {}));
// add selection listener for the combo. selects the "UML tools" item
ProfileComboSelectionListener listener = new ProfileComboSelectionListener();
@@ -1251,19 +1253,19 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
/**
* returns the list of applied profile for the nearest package of the top element
- *
+ *
* @return the list of applied profile for the nearest package of the top element or an empty
* list
*/
protected List<Profile> getAllAppliedProfiles() {
Package topPackage = null;
- if(editorPart instanceof DiagramEditorWithFlyOutPalette) {
- EObject element = ((DiagramEditorWithFlyOutPalette)editorPart).getDiagram().getElement();
- if(element instanceof org.eclipse.uml2.uml.Element) {
- topPackage = ((org.eclipse.uml2.uml.Element)element).getNearestPackage();
+ if (editorPart instanceof DiagramEditorWithFlyOutPalette) {
+ EObject element = ((DiagramEditorWithFlyOutPalette) editorPart).getDiagram().getElement();
+ if (element instanceof org.eclipse.uml2.uml.Element) {
+ topPackage = ((org.eclipse.uml2.uml.Element) element).getNearestPackage();
}
}
- if(topPackage != null) {
+ if (topPackage != null) {
return topPackage.getAllAppliedProfiles();
}
return Collections.EMPTY_LIST;
@@ -1274,7 +1276,7 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
*/
protected void addAvailableToolsDragSupport() {
// transfer types
- Transfer[] transfers = new Transfer[]{ LocalSelectionTransfer.getTransfer() };
+ Transfer[] transfers = new Transfer[] { LocalSelectionTransfer.getTransfer() };
// drag listener
DragSourceListener listener = new DragSourceAdapter() {
@@ -1304,9 +1306,9 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
/**
* Adds elements to the tool bar for available tools viewer
- *
+ *
* @param toolbar
- * the toolbar to populate
+ * the toolbar to populate
*/
protected void populateAvailableToolsToolBar(ToolBar toolbar) {
toggleContentProvider = createCheckToolBarItem(toolbar, SWITCH_CONTENT_PROVIDER_ICON, Messages.Local_Palette_SwitchToolsContentProvider_Tooltip, createSwitchToolsContentProviderListener());
@@ -1317,7 +1319,7 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
/**
* Creates the listener for the available tools content provider
- *
+ *
* @return the listener created
*/
protected Listener createSwitchToolsContentProviderListener() {
@@ -1327,16 +1329,16 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
* {@inheritDoc}
*/
public void handleEvent(Event event) {
- if(!(event.widget instanceof ToolItem)) {
+ if (!(event.widget instanceof ToolItem)) {
return;
}
- ToolItem item = ((ToolItem)event.widget);
+ ToolItem item = ((ToolItem) event.widget);
// retrieve current profile selected in the combo profile
int index = profileCombo.getSelectionIndex();
Collection<PaletteEntry> standardEntries = getAllVisibleStandardEntries();
Profile profile = getAllAppliedProfiles().get(index);
- if(item.getSelection()) {
+ if (item.getSelection()) {
availableToolsViewer.setContentProvider(new ProfileToolsStereotypeMetaclassTreeContentProvider(profile, standardEntries));
item.setSelection(true);
} else {
@@ -1353,7 +1355,7 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
/**
* creates the tool item for drawers visibility listener
- *
+ *
* @return the listener for the tool button
*/
protected Listener createShowDrawerListener() {
@@ -1363,11 +1365,11 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
* {@inheritDoc}
*/
public void handleEvent(Event event) {
- if(!(event.widget instanceof ToolItem)) {
+ if (!(event.widget instanceof ToolItem)) {
return;
}
- ToolItem item = ((ToolItem)event.widget);
- if(item.getSelection()) {
+ ToolItem item = ((ToolItem) event.widget);
+ if (item.getSelection()) {
// elements should be hidden
availableToolsViewer.addFilter(drawerFilter);
item.setSelection(true);
@@ -1381,7 +1383,7 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
/**
* creates the tool item for tools visibility listener
- *
+ *
* @return the listener for the tool button
*/
protected Listener createsShowToolListener() {
@@ -1391,11 +1393,11 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
* {@inheritDoc}
*/
public void handleEvent(Event event) {
- if(!(event.widget instanceof ToolItem)) {
+ if (!(event.widget instanceof ToolItem)) {
return;
}
- ToolItem item = ((ToolItem)event.widget);
- if(item.getSelection()) {
+ ToolItem item = ((ToolItem) event.widget);
+ if (item.getSelection()) {
// elements should be hidden
availableToolsViewer.addFilter(toolFilter);
item.setSelection(true);
@@ -1409,15 +1411,15 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
/**
* Creates a toolbar item which can be checked.
- *
+ *
* @param toolbar
- * the parent toolbar
+ * the parent toolbar
* @param shownElementsIcon
- * path for shown elements icon
+ * path for shown elements icon
* @param listener
- * listener for button action
+ * listener for button action
* @param tooltip
- * tooltip text for the toolbar item
+ * tooltip text for the toolbar item
*/
protected ToolItem createCheckToolBarItem(ToolBar toolbar, String shownElementsIcon, String tooltip, Listener listener) {
ToolItem item = new ToolItem(toolbar, SWT.CHECK | SWT.BORDER);
@@ -1433,7 +1435,7 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
protected boolean validatePage() {
boolean valid = true;
- if(valid) {
+ if (valid) {
setMessage(null);
setErrorMessage(null);
}
@@ -1455,9 +1457,9 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
/**
* Constructor
- *
+ *
* @param viewer
- * The viewer whose ContentProvider this content provider is
+ * The viewer whose ContentProvider this content provider is
*/
public UMLToolsTreeContentProvider() {
}
@@ -1468,15 +1470,15 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
public Object[] getElements(Object inputElement) {
Object[] elements = null;
- if(inputElement instanceof Collection<?>) {
- elements = ((Collection<?>)inputElement).toArray();
- } else if(inputElement instanceof PaletteRoot) {
+ if (inputElement instanceof Collection<?>) {
+ elements = ((Collection<?>) inputElement).toArray();
+ } else if (inputElement instanceof PaletteRoot) {
// paletteUil.getAllEntries(...) to add drawers
// if so, uncomment the addFilterbutton for drawers in populate tool bar
- elements = PaletteUtil.getAllToolEntries(((PaletteRoot)inputElement)).toArray();
+ elements = PaletteUtil.getAllToolEntries(((PaletteRoot) inputElement)).toArray();
}
- if(elements == null) {
+ if (elements == null) {
elements = new Object[0];
}
return elements;
@@ -1501,12 +1503,12 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
public Object[] getChildren(Object parentElement) {
Object[] elements = null;
- if(parentElement instanceof Collection<?>) {
- elements = ((Collection<?>)parentElement).toArray();
- } else if(parentElement instanceof PaletteRoot) {
+ if (parentElement instanceof Collection<?>) {
+ elements = ((Collection<?>) parentElement).toArray();
+ } else if (parentElement instanceof PaletteRoot) {
// paletteUil.getAllEntries(...) to add drawers
// if so, uncomment the addFilterbutton for drawers in populate tool bar
- elements = PaletteUtil.getAllToolEntries(((PaletteRoot)parentElement)).toArray();
+ elements = PaletteUtil.getAllToolEntries(((PaletteRoot) parentElement)).toArray();
}
return elements;
@@ -1531,9 +1533,9 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
* Label provider for palette tools.
* <P>
* We should be using the Palette label provider from GEF, if it was not with visibility "package"...
- *
+ *
* @see org.eclipse.gef.ui.palette.customize.PaletteLabelProvider </P>
- *
+ *
*/
public class PaletteLabelProvider implements ILabelProvider {
@@ -1541,13 +1543,13 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
* {@inheritDoc}
*/
public Image getImage(Object element) {
- if(element instanceof PaletteEntry) {
- ImageDescriptor descriptor = ((PaletteEntry)element).getSmallIcon();
- if(descriptor == null) {
+ if (element instanceof PaletteEntry) {
+ ImageDescriptor descriptor = ((PaletteEntry) element).getSmallIcon();
+ if (descriptor == null) {
return null;
}
return Activator.getPluginIconImage(Activator.ID, descriptor);
- } else if(element instanceof Stereotype) {
+ } else if (element instanceof Stereotype) {
return Activator.getPluginIconImage(Activator.ID, "/icons/stereotype.gif");
}
return null;
@@ -1557,10 +1559,10 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
* {@inheritDoc}
*/
public String getText(Object element) {
- if(element instanceof PaletteEntry) {
- return ((PaletteEntry)element).getLabel();
- } else if(element instanceof Stereotype) {
- return ((Stereotype)element).getName();
+ if (element instanceof PaletteEntry) {
+ return ((PaletteEntry) element).getLabel();
+ } else if (element instanceof Stereotype) {
+ return ((Stereotype) element).getName();
}
return "unknown element";
}
@@ -1599,9 +1601,9 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
* Label provider for palette tools.
* <P>
* We should be using the Palette label provider from GEF, if it was not with visibility "package"...
- *
+ *
* @see org.eclipse.gef.ui.palette.customize.PaletteLabelProvider </P>
- *
+ *
*/
public class PaletteProxyLabelProvider implements ILabelProvider {
@@ -1609,8 +1611,8 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
* {@inheritDoc}
*/
public Image getImage(Object element) {
- if(element instanceof PaletteEntryProxy) {
- return ((PaletteEntryProxy)element).getImage();
+ if (element instanceof PaletteEntryProxy) {
+ return ((PaletteEntryProxy) element).getImage();
}
return null;
}
@@ -1619,8 +1621,8 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
* {@inheritDoc}
*/
public String getText(Object element) {
- if(element instanceof PaletteEntryProxy) {
- return ((PaletteEntryProxy)element).getLabel();
+ if (element instanceof PaletteEntryProxy) {
+ return ((PaletteEntryProxy) element).getLabel();
}
return "unknown element";
}
@@ -1665,7 +1667,7 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
*/
@Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
- if(element instanceof PaletteDrawer) {
+ if (element instanceof PaletteDrawer) {
return false;
}
return true;
@@ -1683,7 +1685,7 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
*/
@Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
- if(element instanceof ToolEntry) {
+ if (element instanceof ToolEntry) {
return false;
}
return true;
@@ -1712,9 +1714,9 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
/**
* Creates a new PaletteContentProvider.
- *
+ *
* @param treeviewer
- * tree viewer this provider provides content
+ * tree viewer this provider provides content
*/
public PaletteContentProvider(TreeViewer treeviewer) {
this.viewer = treeviewer;
@@ -1732,8 +1734,8 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
* {@inheritDoc}
*/
public Object[] getChildren(Object parentElement) {
- if(parentElement instanceof PaletteEntryProxy) {
- List<PaletteEntryProxy> children = ((PaletteEntryProxy)parentElement).getChildren();
+ if (parentElement instanceof PaletteEntryProxy) {
+ List<PaletteEntryProxy> children = ((PaletteEntryProxy) parentElement).getChildren();
return (children != null) ? children.toArray() : new Object[0];
}
return null;
@@ -1743,8 +1745,8 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
* {@inheritDoc}
*/
public boolean hasChildren(Object element) {
- if(element instanceof PaletteEntryProxy) {
- return ((PaletteEntryProxy)element).getChildren() != null && !((PaletteEntryProxy)element).getChildren().isEmpty();
+ if (element instanceof PaletteEntryProxy) {
+ return ((PaletteEntryProxy) element).getChildren() != null && !((PaletteEntryProxy) element).getChildren().isEmpty();
}
return false;
}
@@ -1754,7 +1756,7 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
*/
public Object[] getElements(Object inputElement) {
Object[] elements = getChildren(inputElement);
- if(elements == null) {
+ if (elements == null) {
elements = new Object[0];
}
return elements;
@@ -1764,8 +1766,8 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
* {@inheritDoc}
*/
public Object getParent(Object element) {
- if(element instanceof PaletteEntryProxy) {
- return ((PaletteEntryProxy)element).getParent();
+ if (element instanceof PaletteEntryProxy) {
+ return ((PaletteEntryProxy) element).getParent();
}
return null;
}
@@ -1774,13 +1776,13 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
* {@inheritDoc}
*/
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- if(rootProxy != null) {
+ if (rootProxy != null) {
// warning.. the root has no entry, this is a virtual node
traverseModel(rootProxy, false);
}
- if(newInput != null) {
- rootProxy = ((PaletteContainerProxy)newInput);
+ if (newInput != null) {
+ rootProxy = ((PaletteContainerProxy) newInput);
traverseModel(rootProxy, true);
}
}
@@ -1789,38 +1791,38 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
* This method is invoked whenever there is any change in the model. It updates the
* viewer with the changes that were made to the model. Sub-classes may override this
* method to change or extend its functionality.
- *
+ *
* @param evt
- * The {@link PropertyChangeEvent} that was fired from the model
+ * The {@link PropertyChangeEvent} that was fired from the model
*/
protected void handlePropertyChanged(PropertyChangeEvent evt) {
- PaletteEntryProxy entry = ((PaletteEntryProxy)evt.getSource());
+ PaletteEntryProxy entry = ((PaletteEntryProxy) evt.getSource());
String property = evt.getPropertyName();
- if(property.equals(PaletteEntry.PROPERTY_LABEL) || property.equals(PaletteEntry.PROPERTY_SMALL_ICON) || property.equals(PaletteEntryProxy.PROPERTY_ICON_PATH)) {
+ if (property.equals(PaletteEntry.PROPERTY_LABEL) || property.equals(PaletteEntry.PROPERTY_SMALL_ICON) || property.equals(PaletteEntryProxy.PROPERTY_ICON_PATH)) {
viewer.update(entry, null);
- } else if(property.equals(PaletteContainerProxy.PROPERTY_ADD_CHILDREN)) {
+ } else if (property.equals(PaletteEntryProxy.PROPERTY_ADD_CHILDREN)) {
viewer.refresh(entry.getParent());
// add the listeners to the child
- traverseModel(((PaletteEntryProxy)evt.getNewValue()), true);
- } else if(property.equals(PaletteContainerProxy.PROPERTY_REMOVE_CHILDREN)) {
+ traverseModel(((PaletteEntryProxy) evt.getNewValue()), true);
+ } else if (property.equals(PaletteEntryProxy.PROPERTY_REMOVE_CHILDREN)) {
viewer.refresh(entry.getParent());
// add the listeners to the child
- traverseModel(((PaletteEntryProxy)evt.getOldValue()), false);
+ traverseModel(((PaletteEntryProxy) evt.getOldValue()), false);
}
}
protected void traverseModel(PaletteEntryProxy entryProxy, boolean isHook) {
- if(entryProxy != null) {
- if(isHook) {
+ if (entryProxy != null) {
+ if (isHook) {
entryProxy.addPropertyChangeListener(modelListener);
} else {
entryProxy.removePropertyChangeListener(modelListener);
}
}
- if(entryProxy.getChildren() != null && !entryProxy.getChildren().isEmpty()) {
- for(PaletteEntryProxy proxy : entryProxy.getChildren()) {
+ if (entryProxy.getChildren() != null && !entryProxy.getChildren().isEmpty()) {
+ for (PaletteEntryProxy proxy : entryProxy.getChildren()) {
traverseModel(proxy, isHook);
}
}
@@ -1829,9 +1831,9 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
/**
* Performs all action on finish
- *
+ *
* @param id
- * the path for the file
+ * the path for the file
*/
public void performFinish(String path) {
// creates the document
@@ -1845,7 +1847,7 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
*/
protected Set<String> collectRequiredProfiles() {
Set<String> profiles = new HashSet<String>();
- PaletteContainerProxy rootProxy = (PaletteContainerProxy)paletteTreeViewer.getInput();
+ PaletteContainerProxy rootProxy = (PaletteContainerProxy) paletteTreeViewer.getInput();
collectRequiredProfiles(rootProxy.getChildren(), profiles);
return profiles;
}
@@ -1854,12 +1856,12 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
* collect the required profiles from all tool provided by the local palette definition
*/
protected void collectRequiredProfiles(List<PaletteEntryProxy> proxies, Set<String> requiredProfiles) {
- for(PaletteEntryProxy proxy : proxies) {
+ for (PaletteEntryProxy proxy : proxies) {
// add profile(s) if relevant, check for children
- if(proxy instanceof PaletteAspectToolEntryProxy) {
+ if (proxy instanceof PaletteAspectToolEntryProxy) {
// list of profiles
- for(String stereotypeQN : ((PaletteAspectToolEntryProxy)proxy).getStereotypesQNList()) {
+ for (String stereotypeQN : ((PaletteAspectToolEntryProxy) proxy).getStereotypesQNList()) {
// retrieve list of profiles from the stereotype QN (only remove last segment
// ?!)
String profileName = PaletteUtil.findProfileNameFromStereotypeName(stereotypeQN);
@@ -1867,7 +1869,7 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
}
}
- if(proxy.getChildren() != null) {
+ if (proxy.getChildren() != null) {
collectRequiredProfiles(proxy.getChildren(), requiredProfiles);
}
}
@@ -1875,11 +1877,11 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
/**
* Saves the xml document into file
- *
+ *
* @param document
- * the document to save
+ * the document to save
* @param path
- * name of the file
+ * name of the file
* @return the file created or updated
*/
protected File saveDocument(Document document, String path) {
@@ -1906,7 +1908,7 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
/**
* Creates the document from the palette preview
- *
+ *
* @return the dom structure of the document
*/
protected Document createXMLDocumentFromPalettePreview() {
@@ -1931,38 +1933,38 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
/**
* Generates the xml content for the palette
- *
+ *
* @param document
- * the document to fill
+ * the document to fill
* @param contentElement
- * the root for the xml content
+ * the root for the xml content
*/
protected void generateXMLPaletteContent(Document document, Element contentElement) {
- PaletteContainerProxy rootProxy = (PaletteContainerProxy)paletteTreeViewer.getInput();
- for(PaletteEntryProxy proxy : rootProxy.getChildren()) {
+ PaletteContainerProxy rootProxy = (PaletteContainerProxy) paletteTreeViewer.getInput();
+ for (PaletteEntryProxy proxy : rootProxy.getChildren()) {
generateXMLPaletteContainerProxy(document, contentElement, proxy);
}
}
/**
* Generates the xml content for the given container
- *
+ *
* @param document
- * the document to fill
+ * the document to fill
* @param containerProxy
- * the entry proxy
+ * the entry proxy
*/
protected void generateXMLPaletteContainerProxy(Document document, Element contentElement, PaletteEntryProxy containerProxy) {
Element element = null;
List<PaletteEntryProxy> children = containerProxy.getChildren();
// generate the element
- switch(containerProxy.getType()) {
+ switch (containerProxy.getType()) {
case DRAWER:
element = document.createElement(IPapyrusPaletteConstant.DRAWER);
element.setAttribute(IPapyrusPaletteConstant.NAME, containerProxy.getLabel());
- if(containerProxy instanceof PaletteLocalDrawerProxy) {
- element.setAttribute(IPapyrusPaletteConstant.ICON_PATH, ((PaletteLocalDrawerProxy)containerProxy).getImagePath());
+ if (containerProxy instanceof PaletteLocalDrawerProxy) {
+ element.setAttribute(IPapyrusPaletteConstant.ICON_PATH, ((PaletteLocalDrawerProxy) containerProxy).getImagePath());
}
break;
case TOOL:
@@ -1977,26 +1979,26 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
case ASPECT_TOOL:
element = document.createElement(IPapyrusPaletteConstant.ASPECT_TOOL);
// try to cast the element into PaletteAspectToolEntryProxy
- if(containerProxy instanceof PaletteAspectToolEntryProxy) {
- PaletteAspectToolEntryProxy aspectEntryProxy = (PaletteAspectToolEntryProxy)containerProxy;
+ if (containerProxy instanceof PaletteAspectToolEntryProxy) {
+ PaletteAspectToolEntryProxy aspectEntryProxy = (PaletteAspectToolEntryProxy) containerProxy;
// element.setAttribute(IPapyrusPaletteConstant.ID, aspectEntryProxy.getId());
element.setAttribute(IPapyrusPaletteConstant.NAME, aspectEntryProxy.getLabel());
element.setAttribute(IPapyrusPaletteConstant.DESCRIPTION, aspectEntryProxy.getEntry().getDescription());
element.setAttribute(IPapyrusPaletteConstant.REF_TOOL_ID, aspectEntryProxy.getReferencedPaletteID());
- if(aspectEntryProxy.getImagePath() != null && !aspectEntryProxy.getImagePath().equals("")) {
+ if (aspectEntryProxy.getImagePath() != null && !aspectEntryProxy.getImagePath().equals("")) {
element.setAttribute(IPapyrusPaletteConstant.ICON_PATH, aspectEntryProxy.getImagePath());
}
// add post action, stereotype list
- for(IAspectAction action : ((PaletteAspectToolEntryProxy)containerProxy).getPostActions()) {
+ for (IAspectAction action : ((PaletteAspectToolEntryProxy) containerProxy).getPostActions()) {
Element postActionNode = document.createElement(IPapyrusPaletteConstant.POST_ACTION);
postActionNode.setAttribute(IPapyrusPaletteConstant.ID, action.getFactoryId());
action.save(postActionNode);
element.appendChild(postActionNode);
}
- for(IAspectAction action : ((PaletteAspectToolEntryProxy)containerProxy).getPreActions()) {
+ for (IAspectAction action : ((PaletteAspectToolEntryProxy) containerProxy).getPreActions()) {
Element preActionNode = document.createElement(IPapyrusPaletteConstant.PRE_ACTION);
preActionNode.setAttribute(IPapyrusPaletteConstant.ID, action.getFactoryId());
action.save(preActionNode);
@@ -2010,8 +2012,8 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
element.setAttribute(IPapyrusPaletteConstant.ID, containerProxy.getId());
contentElement.appendChild(element);
- if(children != null) {
- for(PaletteEntryProxy proxy : children) {
+ if (children != null) {
+ for (PaletteEntryProxy proxy : children) {
generateXMLPaletteContainerProxy(document, element, proxy);
}
}
@@ -2038,21 +2040,21 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
String label1 = "";
String label2 = "";
- if(e1 instanceof PaletteEntry) {
- label1 = ((PaletteEntry)e1).getLabel();
- } else if(e1 instanceof Stereotype) {
- label1 = ((Stereotype)e1).getName();
+ if (e1 instanceof PaletteEntry) {
+ label1 = ((PaletteEntry) e1).getLabel();
+ } else if (e1 instanceof Stereotype) {
+ label1 = ((Stereotype) e1).getName();
}
- if(e2 instanceof PaletteEntry) {
- label2 = ((PaletteEntry)e2).getLabel();
- } else if(e2 instanceof Stereotype) {
- label2 = ((Stereotype)e2).getName();
+ if (e2 instanceof PaletteEntry) {
+ label2 = ((PaletteEntry) e2).getLabel();
+ } else if (e2 instanceof Stereotype) {
+ label2 = ((Stereotype) e2).getName();
}
- if(label1 == null) {
+ if (label1 == null) {
return 1;
}
- if(label2 == null) {
+ if (label2 == null) {
return -1;
}
@@ -2091,26 +2093,26 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
*/
protected void handleSelectionChanged() {
int index = profileCombo.getSelectionIndex();
- if(index < 0 || index >= profileCombo.getItems().length) {
+ if (index < 0 || index >= profileCombo.getItems().length) {
return;
}
String name = profileComboList.get(index);
Collection<PaletteEntry> standardEntries = getAllVisibleStandardEntries();
// retrieve the profile or uml standards tools to display
- if(UML_TOOLS_LABEL.equals(name)) {
+ if (UML_TOOLS_LABEL.equals(name)) {
// change content provider
availableToolsViewer.setContentProvider(new UMLToolsTreeContentProvider());
availableToolsViewer.setInput(standardEntries);
toggleContentProvider.setEnabled(false);
} else {
- if(toggleContentProvider != null && !toggleContentProvider.isDisposed()) {
+ if (toggleContentProvider != null && !toggleContentProvider.isDisposed()) {
toggleContentProvider.setEnabled(true);
}
// switch content provider
// this is a profile in case of uml2 tools
Profile profile = getAllAppliedProfiles().get(index);
- if(toggleContentProvider.getSelection()) {
+ if (toggleContentProvider.getSelection()) {
availableToolsViewer.setContentProvider(new ProfileToolsStereotypeMetaclassTreeContentProvider(profile, standardEntries));
} else {
availableToolsViewer.setContentProvider(new ProfileToolsMetaclassStereotypeTreeContentProvider(profile, standardEntries));
@@ -2133,11 +2135,11 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
/**
* Creates a new ProfileToolsStereotypeMetaclassTreeContentProvider.
- *
+ *
* @param profile
- * the profile for which tools are built
+ * the profile for which tools are built
* @param standardEntries
- * list of standard uml tools palette entries
+ * list of standard uml tools palette entries
*/
public ProfileToolsStereotypeMetaclassTreeContentProvider(Profile profile, Collection<PaletteEntry> standardEntries) {
this.standardEntries = standardEntries;
@@ -2147,29 +2149,30 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
* {@inheritDoc}
*/
public Object[] getChildren(Object parentElement) {
- if(parentElement instanceof Profile) {
- return ((Profile)parentElement).getOwnedStereotypes().toArray();
- } else if(parentElement instanceof Stereotype) {
+ if (parentElement instanceof Profile) {
+ return ((Profile) parentElement).getOwnedStereotypes().toArray();
+ } else if (parentElement instanceof Stereotype) {
List<PaletteEntry> entries = new ArrayList<PaletteEntry>();
- Stereotype stereotype = (Stereotype)parentElement;
+ Stereotype stereotype = (Stereotype) parentElement;
- for(PaletteEntry entry : standardEntries) {
+ for (PaletteEntry entry : standardEntries) {
// retrieve the element type created by the tool.
- if(entry instanceof CombinedTemplateCreationEntry) {
+ if (entry instanceof CombinedTemplateCreationEntry) {
- EClass toolMetaclass = PaletteUtil.getToolMetaclass((CombinedTemplateCreationEntry)entry);
- if(toolMetaclass != null) {
+ EClass toolMetaclass = PaletteUtil.getToolMetaclass((CombinedTemplateCreationEntry) entry);
+ if (toolMetaclass != null) {
List<Class> metaclasses = stereotype.getAllExtendedMetaclasses();
- for(Class stMetaclass : metaclasses) {
+ for (Class stMetaclass : metaclasses) {
// get Eclass
java.lang.Class metaclassClass = stMetaclass.getClass();
- if(metaclassClass != null) {
+ if (metaclassClass != null) {
EClassifier metaClassifier = UMLPackage.eINSTANCE.getEClassifier(stMetaclass.getName());
- if(((EClass)metaClassifier).isSuperTypeOf(toolMetaclass)) {
+ if (((EClass) metaClassifier).isSuperTypeOf(toolMetaclass)) {
// should create the palette entry
HashMap properties = new HashMap();
properties.put(IPapyrusPaletteConstant.ASPECT_ACTION_KEY, StereotypeAspectActionProvider.createConfigurationNode(stereotype.getQualifiedName()));
- AspectCreationEntry aspectEntry = new AspectCreationEntry(stereotype.getName() + " (" + entry.getLabel() + ")", "Create an element with a stereotype", entry.getId() + "_" + System.currentTimeMillis(), entry.getSmallIcon(), (CombinedTemplateCreationEntry)entry, properties);
+ AspectCreationEntry aspectEntry = new AspectCreationEntry(stereotype.getName() + " (" + entry.getLabel() + ")", "Create an element with a stereotype", entry.getId() + "_" + System.currentTimeMillis(),
+ entry.getSmallIcon(), (CombinedTemplateCreationEntry) entry, properties);
entries.add(aspectEntry);
}
}
@@ -2188,8 +2191,8 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
* {@inheritDoc}
*/
public Object getParent(Object element) {
- if(element instanceof Stereotype) {
- return ((Stereotype)element).getProfile();
+ if (element instanceof Stereotype) {
+ return ((Stereotype) element).getProfile();
}
return null;
}
@@ -2198,9 +2201,9 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
* {@inheritDoc}
*/
public boolean hasChildren(Object element) {
- if(element instanceof Profile) {
+ if (element instanceof Profile) {
return true;
- } else if(element instanceof Stereotype) {
+ } else if (element instanceof Stereotype) {
return true;
}
return false;
@@ -2210,8 +2213,8 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
* {@inheritDoc}
*/
public Object[] getElements(Object inputElement) {
- if(inputElement instanceof Profile) {
- List<Stereotype> stereotypes = ((Profile)inputElement).getOwnedStereotypes();
+ if (inputElement instanceof Profile) {
+ List<Stereotype> stereotypes = ((Profile) inputElement).getOwnedStereotypes();
return stereotypes.toArray();
}
return new Object[0];
@@ -2246,11 +2249,11 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
/**
* Creates a new ProfileToolsMetaclassStereotypeTreeContentProvider.
- *
+ *
* @param profile
- * the profile for which tools are built
+ * the profile for which tools are built
* @param standardEntries
- * list of standard uml tools palette entries
+ * list of standard uml tools palette entries
*/
public ProfileToolsMetaclassStereotypeTreeContentProvider(Profile profile, Collection<PaletteEntry> standardEntries) {
this.profile = profile;
@@ -2261,30 +2264,31 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
* {@inheritDoc}
*/
public Object[] getChildren(Object parentElement) {
- if(parentElement instanceof Profile) {
+ if (parentElement instanceof Profile) {
return standardEntries.toArray();
- } else if(parentElement instanceof AspectCreationEntry) {
+ } else if (parentElement instanceof AspectCreationEntry) {
return new Object[0];
- } else if(parentElement instanceof PaletteEntry) {
+ } else if (parentElement instanceof PaletteEntry) {
List<AspectCreationEntry> entries = new ArrayList<AspectCreationEntry>();
// display all stereotypes applicable to the type of element created by this tool
- if(parentElement instanceof CombinedTemplateCreationEntry) {
- CombinedTemplateCreationEntry entry = (CombinedTemplateCreationEntry)parentElement;
+ if (parentElement instanceof CombinedTemplateCreationEntry) {
+ CombinedTemplateCreationEntry entry = (CombinedTemplateCreationEntry) parentElement;
EClass toolMetaclass = PaletteUtil.getToolMetaclass(entry);
- if(toolMetaclass != null) {
- for(Stereotype stereotype : profile.getOwnedStereotypes()) {
+ if (toolMetaclass != null) {
+ for (Stereotype stereotype : profile.getOwnedStereotypes()) {
List<Class> metaclasses = stereotype.getAllExtendedMetaclasses();
- for(Class stMetaclass : metaclasses) {
+ for (Class stMetaclass : metaclasses) {
// get Eclass
java.lang.Class metaclassClass = stMetaclass.getClass();
- if(metaclassClass != null) {
+ if (metaclassClass != null) {
EClassifier metaClassifier = UMLPackage.eINSTANCE.getEClassifier(stMetaclass.getName());
- if(((EClass)metaClassifier).isSuperTypeOf(toolMetaclass)) {
+ if (((EClass) metaClassifier).isSuperTypeOf(toolMetaclass)) {
// should create the palette entry
HashMap properties = new HashMap();
ArrayList<String> stereotypesQNToApply = new ArrayList<String>();
properties.put(IPapyrusPaletteConstant.ASPECT_ACTION_KEY, StereotypeAspectActionProvider.createConfigurationNode(stereotype.getQualifiedName()));
- AspectCreationEntry aspectEntry = new AspectCreationEntry(stereotype.getName() + " (" + entry.getLabel() + ")", "Create an element with a stereotype", entry.getId() + "_" + System.currentTimeMillis(), entry.getSmallIcon(), entry, properties);
+ AspectCreationEntry aspectEntry = new AspectCreationEntry(stereotype.getName() + " (" + entry.getLabel() + ")", "Create an element with a stereotype", entry.getId() + "_" + System.currentTimeMillis(),
+ entry.getSmallIcon(), entry, properties);
entries.add(aspectEntry);
}
}
@@ -2303,8 +2307,8 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
* {@inheritDoc}
*/
public Object getParent(Object element) {
- if(element instanceof Stereotype) {
- return ((Stereotype)element).getProfile();
+ if (element instanceof Stereotype) {
+ return ((Stereotype) element).getProfile();
}
return null;
}
@@ -2313,11 +2317,11 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
* {@inheritDoc}
*/
public boolean hasChildren(Object element) {
- if(element instanceof Profile) {
+ if (element instanceof Profile) {
return true;
- } else if(element instanceof AspectCreationEntry) {
+ } else if (element instanceof AspectCreationEntry) {
return false;
- } else if(element instanceof PaletteEntry) {
+ } else if (element instanceof PaletteEntry) {
return true;
}
return false;
@@ -2327,7 +2331,7 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
* {@inheritDoc}
*/
public Object[] getElements(Object inputElement) {
- if(inputElement instanceof Profile) {
+ if (inputElement instanceof Profile) {
return standardEntries.toArray();
}
return new Object[0];
@@ -2351,14 +2355,14 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
/**
* Returns the list of all visible palette entries
- *
+ *
* @return the list of all visible palette entries
*/
protected Collection<PaletteEntry> getAllVisibleStandardEntries() {
HashSet<PaletteEntry> result = new HashSet<PaletteEntry>();
- for(PaletteEntry entry : PaletteUtil.getAvailableEntriesSet(editorPart, priority).values()) {
+ for (PaletteEntry entry : PaletteUtil.getAvailableEntriesSet(editorPart, priority).values()) {
// the entry is not just a defineOnly entry but a visible one
- if(getRootParent(entry) != null) {
+ if (getRootParent(entry) != null) {
result.add(entry);
}
}
@@ -2367,16 +2371,16 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
/**
* Returns the Root element for the palette entry. It searches recursively from parent to parent, until it find the root element
- *
+ *
* @param entry
- * the palette entry for which root element is searched
+ * the palette entry for which root element is searched
* @return the root element or <code>null</code> if none was found
*/
protected PaletteRoot getRootParent(PaletteEntry entry) {
PaletteContainer parent = entry.getParent();
- if(parent instanceof PaletteRoot) {
- return (PaletteRoot)parent;
- } else if(parent != null) {
+ if (parent instanceof PaletteRoot) {
+ return (PaletteRoot) parent;
+ } else if (parent != null) {
return getRootParent(parent);
} else {
return null;
@@ -2385,7 +2389,7 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
/**
* Returns the list of required profiles by this local palette definition
- *
+ *
* @return the profiles required by this palette
*/
public Set<String> getRequiredProfiles() {
@@ -2399,7 +2403,7 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
/**
* Checks if the button should be enable or not
- *
+ *
* @return <code>true</code> if the button should be enable
*/
public abstract boolean isEnable();
@@ -2416,10 +2420,10 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
@Override
public boolean isEnable() {
// retrieve selection
- if(paletteTreeViewer != null && !paletteTreeViewer.getControl().isDisposed()) {
+ if (paletteTreeViewer != null && !paletteTreeViewer.getControl().isDisposed()) {
// retrieve selection. first element should be a drawer
- IStructuredSelection selection = (IStructuredSelection)paletteTreeViewer.getSelection();
- if(selection == null) {
+ IStructuredSelection selection = (IStructuredSelection) paletteTreeViewer.getSelection();
+ if (selection == null) {
return false;
} else {
// look for first element. should be an instance of drawer
@@ -2431,8 +2435,7 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
}
/**
- * validator for the create separator or stack tool item. Only valid when selection is a {@link PaletteEntryProxy} or a
- * {@link PaletteLocalDrawerProxy}
+ * validator for the create separator or stack tool item. Only valid when selection is a {@link PaletteEntryProxy} or a {@link PaletteLocalDrawerProxy}
*/
protected class PaletteEntryProxySelectedValidator extends ToolBarItemValidator {
@@ -2442,10 +2445,10 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
@Override
public boolean isEnable() {
// retrieve selection
- if(paletteTreeViewer != null && !paletteTreeViewer.getControl().isDisposed()) {
+ if (paletteTreeViewer != null && !paletteTreeViewer.getControl().isDisposed()) {
// retrieve selection. first element should be a drawer
- IStructuredSelection selection = (IStructuredSelection)paletteTreeViewer.getSelection();
- if(selection == null) {
+ IStructuredSelection selection = (IStructuredSelection) paletteTreeViewer.getSelection();
+ if (selection == null) {
return false;
} else {
Object object = selection.getFirstElement();
@@ -2458,9 +2461,9 @@ public class LocalPaletteContentPage extends WizardPage implements Listener {
/**
* Sets the priority of the current edited palette
- *
+ *
* @param priority
- * the priority of the current edited palette
+ * the priority of the current edited palette
*/
public void setPriority(ProviderPriority priority) {
this.priority = priority;
diff --git a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/LocalPaletteInformationPage.java b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/LocalPaletteInformationPage.java
index 552193087d5..18de885ef37 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/LocalPaletteInformationPage.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/LocalPaletteInformationPage.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2009 CEA LIST.
- *
+ *
* 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
@@ -87,14 +87,14 @@ public class LocalPaletteInformationPage extends WizardPage implements Listener
protected boolean validateOnLaunch = false;
static {
- priorityList = new String[]{ ProviderPriority.LOWEST.getName(), ProviderPriority.LOW.getName(), ProviderPriority.MEDIUM.getName(), ProviderPriority.HIGH.getName(), ProviderPriority.HIGHEST.getName() };
+ priorityList = new String[] { ProviderPriority.LOWEST.getName(), ProviderPriority.LOW.getName(), ProviderPriority.MEDIUM.getName(), ProviderPriority.HIGH.getName(), ProviderPriority.HIGHEST.getName() };
}
/**
* Creates a new wizard page with the given name, title, and image.
- *
+ *
* @param part
- * the editor part in which the wizard was created
+ * the editor part in which the wizard was created
*/
public LocalPaletteInformationPage(IEditorPart part) {
super(Messages.Local_Palette_InfoPage_Name, Messages.Local_Palette_InfoPage_Title, Activator.getImageDescriptor(WIZARD_ICON));
@@ -106,8 +106,8 @@ public class LocalPaletteInformationPage extends WizardPage implements Listener
*/
@Override
public IWizardPage getNextPage() {
- LocalPaletteContentPage contentPage = (LocalPaletteContentPage)super.getNextPage();
- if(priority != null) {
+ LocalPaletteContentPage contentPage = (LocalPaletteContentPage) super.getNextPage();
+ if (priority != null) {
contentPage.setPriority(priority);
contentPage.profileCombo.deselectAll();
contentPage.profileCombo.select(contentPage.profileCombo.getItems().length - 1); // select the last one (UML)
@@ -141,7 +141,7 @@ public class LocalPaletteInformationPage extends WizardPage implements Listener
// Show description on opening
setErrorMessage(null);
setMessage(null);
- if(validateOnLaunch) {
+ if (validateOnLaunch) {
setPageComplete(validatePage());
}
setControl(control);
@@ -153,8 +153,8 @@ public class LocalPaletteInformationPage extends WizardPage implements Listener
public void intializeValues() {
initName("");
String editorIDValue = "";
- if(editorPart instanceof DiagramEditorWithFlyOutPalette) {
- editorIDValue = ((DiagramEditorWithFlyOutPalette)editorPart).getContributorId();
+ if (editorPart instanceof DiagramEditorWithFlyOutPalette) {
+ editorIDValue = ((DiagramEditorWithFlyOutPalette) editorPart).getContributorId();
}
initEditorID(editorIDValue);
initPaletteID(System.getProperty("user.name") + "_" + System.currentTimeMillis());
@@ -167,8 +167,8 @@ public class LocalPaletteInformationPage extends WizardPage implements Listener
public void intializeValues(PapyrusPaletteService.LocalProviderDescriptor descriptor) {
initName(descriptor.getContributionName());
String editorIDValue = "";
- if(editorPart instanceof DiagramEditorWithFlyOutPalette) {
- editorIDValue = ((DiagramEditorWithFlyOutPalette)editorPart).getContributorId();
+ if (editorPart instanceof DiagramEditorWithFlyOutPalette) {
+ editorIDValue = ((DiagramEditorWithFlyOutPalette) editorPart).getContributorId();
}
initEditorID(editorIDValue);
initPaletteID(descriptor.getContributionID());
@@ -178,7 +178,7 @@ public class LocalPaletteInformationPage extends WizardPage implements Listener
/**
* Returns the current value of palette name
- *
+ *
* @return the current value of palette name
*/
public String getPaletteName() {
@@ -187,7 +187,7 @@ public class LocalPaletteInformationPage extends WizardPage implements Listener
/**
* Returns the current value of palette ID
- *
+ *
* @return the current value of palette ID
*/
public String getPaletteID() {
@@ -196,7 +196,7 @@ public class LocalPaletteInformationPage extends WizardPage implements Listener
/**
* Returns the current value of editor ID
- *
+ *
* @return the current value of editor ID
*/
public String getEditorID() {
@@ -205,7 +205,7 @@ public class LocalPaletteInformationPage extends WizardPage implements Listener
/**
* Returns the current value of editor ID
- *
+ *
* @return the current value of editor ID
*/
public ProviderPriority getPalettePriority() {
@@ -214,9 +214,9 @@ public class LocalPaletteInformationPage extends WizardPage implements Listener
/**
* inits the name field value
- *
+ *
* @param value
- * value to set
+ * value to set
*/
protected void initName(String value) {
name = value;
@@ -224,13 +224,13 @@ public class LocalPaletteInformationPage extends WizardPage implements Listener
/**
* inits the priority value
- *
+ *
* @param value
- * value to set
+ * value to set
*/
protected void initPriority(ProviderPriority value) {
- if(value!=null) {
- this.priority = value;
+ if (value != null) {
+ this.priority = value;
} else {
// by default, Medium
this.priority = ProviderPriority.MEDIUM;
@@ -239,9 +239,9 @@ public class LocalPaletteInformationPage extends WizardPage implements Listener
/**
* inits the palette id value
- *
+ *
* @param value
- * value to set
+ * value to set
*/
protected void initPaletteID(String value) {
paletteID = value;
@@ -250,9 +250,9 @@ public class LocalPaletteInformationPage extends WizardPage implements Listener
/**
* inits the editor id value
- *
+ *
* @param value
- * value to set
+ * value to set
*/
protected void initEditorID(String value) {
editorID = value;
@@ -263,28 +263,28 @@ public class LocalPaletteInformationPage extends WizardPage implements Listener
*/
protected boolean validatePage() {
boolean valid = true;
- if(advancedComposite != null && !advancedComposite.isDisposed()) {
- if(-1 == priorityCombo.getSelectionIndex()) {
+ if (advancedComposite != null && !advancedComposite.isDisposed()) {
+ if (-1 == priorityCombo.getSelectionIndex()) {
setErrorMessage(Messages.Local_Palette_Error_Priority);
valid = false;
}
- if("".equals(getEditorID())) {
+ if ("".equals(getEditorID())) {
setErrorMessage(Messages.Local_Palette_Error_EditorId);
valid = false;
}
- if("".equals(getPaletteID())) {
+ if ("".equals(getPaletteID())) {
setErrorMessage(Messages.Local_Palette_Error_PaletteId);
valid = false;
}
}
- if("".equals(getPaletteName())) {
+ if ("".equals(getPaletteName())) {
setErrorMessage(Messages.Local_Palette_Error_Name);
valid = false;
}
- if(valid) {
+ if (valid) {
setMessage(null);
setErrorMessage(null);
}
@@ -293,9 +293,9 @@ public class LocalPaletteInformationPage extends WizardPage implements Listener
/**
* Creates the widget for advanced options.
- *
+ *
* @param parent
- * the parent composite
+ * the parent composite
*/
protected void createAdvancedControls(Composite parent) {
advancedButton = new Button(parent, SWT.PUSH);
@@ -337,9 +337,9 @@ public class LocalPaletteInformationPage extends WizardPage implements Listener
* Shows/hides the advanced option widgets.
*/
protected void handleAdvancedButtonSelect() {
- Composite composite = (Composite)getControl();
+ Composite composite = (Composite) getControl();
- if(advancedComposite != null) {
+ if (advancedComposite != null) {
advancedComposite.dispose();
advancedComposite = null;
advancedButton.setText(Messages.Dialog_Advanced_Button_Closed);
@@ -351,9 +351,9 @@ public class LocalPaletteInformationPage extends WizardPage implements Listener
/**
* creates the control area for the priority
- *
+ *
* @param control
- * the parent composite
+ * the parent composite
*/
protected void createPriorityControl(Composite control) {
final Label priorityLabel = new Label(control, SWT.NONE);
@@ -381,9 +381,9 @@ public class LocalPaletteInformationPage extends WizardPage implements Listener
/**
* creates the control area for the id definition
- *
+ *
* @param control
- * the parent composite
+ * the parent composite
*/
protected void createIDControl(Composite control) {
final Label idLabel = new Label(control, SWT.NONE);
@@ -409,9 +409,9 @@ public class LocalPaletteInformationPage extends WizardPage implements Listener
/**
* creates the control area for the name definition
- *
+ *
* @param control
- * the parent composite
+ * the parent composite
*/
protected void createNameControl(Composite control) {
final Label nameLabel = new Label(control, SWT.NONE);
@@ -431,9 +431,9 @@ public class LocalPaletteInformationPage extends WizardPage implements Listener
/**
* creates the control area for the name definition
- *
+ *
* @param control
- * the parent composite
+ * the parent composite
*/
protected void createEditorIDControl(Composite control) {
final Label editorLabel = new Label(control, SWT.NONE);
@@ -471,13 +471,13 @@ public class LocalPaletteInformationPage extends WizardPage implements Listener
*/
public void handleEvent(Event event) {
Widget widget = event.widget;
- if(widget.equals(nameText)) {
+ if (widget.equals(nameText)) {
name = nameText.getText();
- } else if(widget.equals(idText)) {
+ } else if (widget.equals(idText)) {
paletteID = idText.getText();
- } else if(widget.equals(editorText)) {
+ } else if (widget.equals(editorText)) {
editorID = editorText.getText();
- } else if(widget.equals(priorityCombo)) {
+ } else if (widget.equals(priorityCombo)) {
priority = ProviderPriority.parse(priorityCombo.getText());
}
setPageComplete(validatePage());
diff --git a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/NewDrawerWizard.java b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/NewDrawerWizard.java
index a249f361758..ebf866476b7 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/NewDrawerWizard.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/NewDrawerWizard.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2009 CEA LIST.
- *
+ *
* 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
@@ -28,9 +28,9 @@ public class NewDrawerWizard extends Wizard {
/**
* Creates a NewDrawerWizard.
- *
+ *
* @param paletteContainerProxy
- * the element where to add the new drawer
+ * the element where to add the new drawer
*/
public NewDrawerWizard(PaletteContainerProxy paletteContainerProxy) {
this.paletteContainerProxy = paletteContainerProxy;
diff --git a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/NewLocalPaletteWizard.java b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/NewLocalPaletteWizard.java
index 83f66775a18..f3726979ba0 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/NewLocalPaletteWizard.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/NewLocalPaletteWizard.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2009 CEA LIST.
- *
+ *
* 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
@@ -37,9 +37,9 @@ public class NewLocalPaletteWizard extends Wizard {
/**
* Creates a NewLocalPaletteWizard.
- *
+ *
* @param part
- * the editor part where the palette will be available
+ * the editor part where the palette will be available
*/
public NewLocalPaletteWizard(IEditorPart part, PaletteCustomizer customizer) {
this.editorPart = part;
diff --git a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/PaletteAspectToolEntryProxy.java b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/PaletteAspectToolEntryProxy.java
index f19a2852d2f..d0e2d6ae469 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/PaletteAspectToolEntryProxy.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/PaletteAspectToolEntryProxy.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2009 CEA LIST.
- *
+ *
* 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
@@ -41,9 +41,9 @@ public class PaletteAspectToolEntryProxy extends PaletteEntryProxy implements IP
/**
* Creates a new {@link PaletteAspectToolEntryProxy}
- *
+ *
* @param entry
- * the proxied entry
+ * the proxied entry
*/
public PaletteAspectToolEntryProxy(AspectCreationEntry entry) {
super(entry);
@@ -53,7 +53,7 @@ public class PaletteAspectToolEntryProxy extends PaletteEntryProxy implements IP
/**
* returns the list of post actions attached to this {@link PaletteAspectToolEntryProxy}
- *
+ *
* @return the list of post actions attached to this {@link PaletteAspectToolEntryProxy}
*/
public List<IPostAction> getPostActions() {
@@ -65,9 +65,9 @@ public class PaletteAspectToolEntryProxy extends PaletteEntryProxy implements IP
* <p>
* Warning! This should not be used to initialize the list of action, only move the already existing actions.
* </p>
- *
+ *
* @param postActions
- * the postActions to set
+ * the postActions to set
*/
public void setPostActions(List<IPostAction> postActions) {
this.postActions = postActions;
@@ -75,7 +75,7 @@ public class PaletteAspectToolEntryProxy extends PaletteEntryProxy implements IP
/**
* returns the list of pre actions attached to this {@link PaletteAspectToolEntryProxy}
- *
+ *
* @return the list of pre actions attached to this {@link PaletteAspectToolEntryProxy}
*/
public List<IPreAction> getPreActions() {
@@ -86,9 +86,9 @@ public class PaletteAspectToolEntryProxy extends PaletteEntryProxy implements IP
* Sets the list of pre actions attached to this {@link PaletteAspectToolEntryProxy}
* <p>
* Warning! This should not be used to initialize the list of action, only move the already existing actions.
- *
+ *
* @param preActions
- * the preActions to set
+ * the preActions to set
*/
protected void setPreActions(List<IPreAction> preActions) {
this.preActions = preActions;
@@ -96,7 +96,7 @@ public class PaletteAspectToolEntryProxy extends PaletteEntryProxy implements IP
/**
* returns the list of aspect actions attached to this {@link PaletteAspectToolEntryProxy}
- *
+ *
* @return the list of aspect actions attached to this {@link PaletteAspectToolEntryProxy}
*/
public List<IAspectAction> getAspectActions() {
@@ -111,8 +111,8 @@ public class PaletteAspectToolEntryProxy extends PaletteEntryProxy implements IP
*/
protected void initAspectActions() {
Object value = getEntry().getAspectProperties(IPapyrusPaletteConstant.ASPECT_ACTION_KEY);
- if(value instanceof NodeList) {
- PaletteUtil.initAspectActions((NodeList)value, postActions, preActions);
+ if (value instanceof NodeList) {
+ PaletteUtil.initAspectActions((NodeList) value, postActions, preActions);
}
}
@@ -135,12 +135,12 @@ public class PaletteAspectToolEntryProxy extends PaletteEntryProxy implements IP
/**
* returns the small icon of the cached entry
- *
+ *
* @return the small icon of the cached entry
*/
@Override
public Image getImage() {
- if(getImagePath() != null && !getImagePath().equals("")) {
+ if (getImagePath() != null && !getImagePath().equals("")) {
return Activator.getPluginIconImage(Activator.ID, getImagePath());
}
return super.getImage();
@@ -151,12 +151,12 @@ public class PaletteAspectToolEntryProxy extends PaletteEntryProxy implements IP
*/
@Override
public AspectCreationEntry getEntry() {
- return (AspectCreationEntry)super.getEntry();
+ return (AspectCreationEntry) super.getEntry();
}
/**
* Returns the ID of the referenced entry of the aspect entry
- *
+ *
* @return the ID of the referenced entry of the aspect entry
*/
public String getReferencedPaletteID() {
@@ -165,14 +165,14 @@ public class PaletteAspectToolEntryProxy extends PaletteEntryProxy implements IP
/**
* Returns the list of stereotypes Qualified names to apply
- *
+ *
* @return the list of stereotypes qualified names to apply
*/
public List<String> getStereotypesQNList() {
List<String> list = new ArrayList<String>();
- for(IAspectAction action : postActions) {
- if(action instanceof StereotypePostAction) {
- list.addAll(((StereotypePostAction)action).getStereotypesToApply());
+ for (IAspectAction action : postActions) {
+ if (action instanceof StereotypePostAction) {
+ list.addAll(((StereotypePostAction) action).getStereotypesToApply());
}
}
return list;
diff --git a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/PaletteContainerProxy.java b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/PaletteContainerProxy.java
index 2876bdfd16e..efc704c86d4 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/PaletteContainerProxy.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/PaletteContainerProxy.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2010 CEA LIST.
- *
+ *
* 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
@@ -27,9 +27,9 @@ public class PaletteContainerProxy extends PaletteEntryProxy {
/**
* Creates a new PaletteContainer
- *
+ *
* @param drawer
- * the drawer to cache
+ * the drawer to cache
*/
public PaletteContainerProxy(PaletteContainer drawer) {
super(drawer);
@@ -48,14 +48,14 @@ public class PaletteContainerProxy extends PaletteEntryProxy {
*/
@Override
public PaletteContainer getEntry() {
- return (PaletteContainer)super.getEntry();
+ return (PaletteContainer) super.getEntry();
}
/**
* Method to add a child proxy to this proxy
- *
+ *
* @param entry
- * the entry to add
+ * the entry to add
*/
@Override
public void addChild(PaletteEntryProxy entry) {
@@ -66,11 +66,11 @@ public class PaletteContainerProxy extends PaletteEntryProxy {
/**
* Method to add a child proxy to this proxy, before the given element
- *
+ *
* @param entry
- * the entry to add
+ * the entry to add
* @param nextElement
- * the element that should be just after the entry
+ * the element that should be just after the entry
*/
@Override
public void addChild(PaletteEntryProxy entry, PaletteEntryProxy nextElement) {
@@ -81,9 +81,9 @@ public class PaletteContainerProxy extends PaletteEntryProxy {
/**
* Remove the specified children from its parent
- *
+ *
* @param proxy
- * the proxy to remove
+ * the proxy to remove
*/
@Override
public void removeChild(PaletteEntryProxy proxy) {
diff --git a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/PaletteEntryProxy.java b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/PaletteEntryProxy.java
index 2279ce26dc4..6e77f74fc60 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/PaletteEntryProxy.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/PaletteEntryProxy.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2010 CEA LIST.
- *
+ *
* 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
@@ -59,9 +59,9 @@ public class PaletteEntryProxy implements IPaletteEntryProxy {
/**
* A listener can only be added once. Adding it more than once will do nothing.
- *
+ *
* @param listener
- * the PropertyChangeListener that is to be notified of changes
+ * the PropertyChangeListener that is to be notified of changes
* @see java.beans.PropertyChangeSupport#addPropertyChangeListener(java.beans.PropertyChangeListener)
*/
public void addPropertyChangeListener(PropertyChangeListener listener) {
@@ -71,7 +71,7 @@ public class PaletteEntryProxy implements IPaletteEntryProxy {
/**
* @param listener
- * the PropertyChangeListener that is not to be notified anymore
+ * the PropertyChangeListener that is not to be notified anymore
* @see java.beans.PropertyChangeSupport#removePropertyChangeListener(java.beans.PropertyChangeListener)
*/
public void removePropertyChangeListener(PropertyChangeListener listener) {
@@ -80,7 +80,7 @@ public class PaletteEntryProxy implements IPaletteEntryProxy {
/**
* Returns the entry cached by this class
- *
+ *
* @return the palette entry
*/
public PaletteEntry getEntry() {
@@ -89,19 +89,19 @@ public class PaletteEntryProxy implements IPaletteEntryProxy {
/**
* Inits the entry type for this proxy
- *
+ *
* @return the entry type for this proxy
*/
protected EntryType initType() {
- if(entry instanceof PaletteDrawer) {
+ if (entry instanceof PaletteDrawer) {
return EntryType.DRAWER;
- } else if(entry instanceof PaletteSeparator) {
+ } else if (entry instanceof PaletteSeparator) {
return EntryType.SEPARATOR;
- } else if(entry instanceof PaletteStack) {
+ } else if (entry instanceof PaletteStack) {
return EntryType.STACK;
- } else if(entry instanceof AspectCreationEntry) {
+ } else if (entry instanceof AspectCreationEntry) {
return EntryType.ASPECT_TOOL;
- } else if(entry instanceof ToolEntry) {
+ } else if (entry instanceof ToolEntry) {
return EntryType.TOOL;
}
return EntryType.TOOL;
@@ -109,7 +109,7 @@ public class PaletteEntryProxy implements IPaletteEntryProxy {
/**
* returns the label of the cached entry
- *
+ *
* @return the label of the cached entry
*/
public String getLabel() {
@@ -118,7 +118,7 @@ public class PaletteEntryProxy implements IPaletteEntryProxy {
/**
* returns the id of the cached entry
- *
+ *
* @return the id of the cached entry
*/
public String getId() {
@@ -127,7 +127,7 @@ public class PaletteEntryProxy implements IPaletteEntryProxy {
/**
* returns the small icon of the cached entry
- *
+ *
* @return the small icon of the cached entry
*/
public Image getImage() {
@@ -136,7 +136,7 @@ public class PaletteEntryProxy implements IPaletteEntryProxy {
/**
* returns the description of this entry proxy
- *
+ *
* @return the description of this entry proxy
*/
public String getDescription() {
@@ -145,7 +145,7 @@ public class PaletteEntryProxy implements IPaletteEntryProxy {
/**
* returns the image path of this entry proxy
- *
+ *
* @return the image path of this entry proxy
*/
public String getImagePath() {
@@ -154,9 +154,9 @@ public class PaletteEntryProxy implements IPaletteEntryProxy {
/**
* Sets the parent for this proxy
- *
+ *
* @param newParent
- * the parent proxy
+ * the parent proxy
*/
public void setParent(PaletteContainerProxy newParent) {
parent = newParent;
@@ -164,7 +164,7 @@ public class PaletteEntryProxy implements IPaletteEntryProxy {
/**
* Returns the parent of this proxy
- *
+ *
* @return the parent of this proxy
*/
public PaletteContainerProxy getParent() {
@@ -173,7 +173,7 @@ public class PaletteEntryProxy implements IPaletteEntryProxy {
/**
* Returns the list of children for this entry. By default, entries do not have children.
- *
+ *
* @return the list of children for this entry
*/
public List<PaletteEntryProxy> getChildren() {
@@ -182,9 +182,9 @@ public class PaletteEntryProxy implements IPaletteEntryProxy {
/**
* Sets the king of tool it is.
- *
+ *
* @param type
- * the type to set
+ * the type to set
*/
public void setType(EntryType type) {
this.type = type;
@@ -192,7 +192,7 @@ public class PaletteEntryProxy implements IPaletteEntryProxy {
/**
* Returns the kind of entry
- *
+ *
* @return the kind of entry
*/
public EntryType getType() {
@@ -201,21 +201,21 @@ public class PaletteEntryProxy implements IPaletteEntryProxy {
/**
* Sets the description of the palette entry proxied by this element
- *
+ *
* @param desc
- * the new description
+ * the new description
*/
public void setDescription(String desc) {
- if(getEntry() == null) {
+ if (getEntry() == null) {
return;
}
String oldDesc = getEntry().getDescription();
- if(oldDesc == null && desc == null) {
+ if (oldDesc == null && desc == null) {
return;
}
- if(desc == null || !desc.equals(oldDesc)) {
+ if (desc == null || !desc.equals(oldDesc)) {
getEntry().setDescription(desc);
listeners.firePropertyChange(PaletteEntry.PROPERTY_DESCRIPTION, oldDesc, desc);
}
@@ -223,21 +223,21 @@ public class PaletteEntryProxy implements IPaletteEntryProxy {
/**
* Sets the label of the palette entry proxied by this element
- *
+ *
* @param label
- * the new label
+ * the new label
*/
public void setLabel(String label) {
- if(getEntry() == null) {
+ if (getEntry() == null) {
return;
}
String oldLabel = getEntry().getLabel();
- if(oldLabel == null && label == null) {
+ if (oldLabel == null && label == null) {
return;
}
- if(label == null || !label.equals(oldLabel)) {
+ if (label == null || !label.equals(oldLabel)) {
getEntry().setLabel(label);
listeners.firePropertyChange(PaletteEntry.PROPERTY_LABEL, oldLabel, label);
}
@@ -245,31 +245,31 @@ public class PaletteEntryProxy implements IPaletteEntryProxy {
/**
* Sets the label of the palette entry proxied by this element
- *
+ *
* @param label
- * the new label
+ * the new label
*/
public void setIcon(String path) {
- if(!(getEntry() instanceof AspectCreationEntry)) {
+ if (!(getEntry() instanceof AspectCreationEntry)) {
return;
}
- String oldPath = ((AspectCreationEntry)getEntry()).getIconPath();
+ String oldPath = ((AspectCreationEntry) getEntry()).getIconPath();
- if(oldPath == null && path == null) {
+ if (oldPath == null && path == null) {
return;
}
- if(path == null || !path.equals(oldPath)) {
- ((AspectCreationEntry)getEntry()).setIconPath(path);
+ if (path == null || !path.equals(oldPath)) {
+ ((AspectCreationEntry) getEntry()).setIconPath(path);
listeners.firePropertyChange(PROPERTY_ICON_PATH, oldPath, path);
}
}
/**
* Method to add a child proxy to this proxy
- *
+ *
* @param entry
- * the entry to add
+ * the entry to add
*/
protected void addChild(PaletteEntryProxy entry) {
listeners.firePropertyChange(PROPERTY_ADD_CHILDREN, null, entry);
@@ -277,11 +277,11 @@ public class PaletteEntryProxy implements IPaletteEntryProxy {
/**
* Method to add a child proxy to this proxy, before the given element
- *
+ *
* @param entry
- * the entry to add
+ * the entry to add
* @param nextElement
- * the element that should be just after the entry
+ * the element that should be just after the entry
*/
protected void addChild(PaletteEntryProxy entry, PaletteEntryProxy nextElement) {
listeners.firePropertyChange(PROPERTY_ADD_CHILDREN, null, entry);
@@ -289,9 +289,9 @@ public class PaletteEntryProxy implements IPaletteEntryProxy {
/**
* Remove the specified children from its parent
- *
+ *
* @param proxy
- * the proxy to remove
+ * the proxy to remove
*/
public void removeChild(PaletteEntryProxy proxy) {
listeners.firePropertyChange(PROPERTY_REMOVE_CHILDREN, proxy, null);
diff --git a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/PaletteEntryProxyInformationComposite.java b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/PaletteEntryProxyInformationComposite.java
index 97e1dded527..50284597ed9 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/PaletteEntryProxyInformationComposite.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/PaletteEntryProxyInformationComposite.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2010 CEA LIST.
- *
+ *
* 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
@@ -17,6 +17,7 @@ import org.eclipse.emf.ecore.EClass;
import org.eclipse.gef.palette.CombinedTemplateCreationEntry;
import org.eclipse.gef.palette.PaletteEntry;
import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.window.Window;
import org.eclipse.papyrus.customization.palette.dialog.LocalPaletteContentPage.EntryType;
import org.eclipse.papyrus.uml.diagram.common.Activator;
import org.eclipse.papyrus.uml.diagram.common.Messages;
@@ -62,11 +63,11 @@ public class PaletteEntryProxyInformationComposite {
/**
* Creates the content of the information composite
- *
+ *
* @param parent
- * the composite where to add created controls
+ * the composite where to add created controls
* @param appliedProfiles
- * the list of applied profiles
+ * the list of applied profiles
* @return the newly created composite
*/
public Composite createComposite(final Composite parent, List<Profile> appliedProfiles) {
@@ -137,16 +138,16 @@ public class PaletteEntryProxyInformationComposite {
*/
public void mouseUp(MouseEvent e) {
BundleIconExplorerDialog dialog = new BundleIconExplorerDialog(parent.getShell(), iconText.getText());
- if(Dialog.OK == dialog.open()) {
+ if (Window.OK == dialog.open()) {
Object[] values = dialog.getResult();
- if(values.length != 1) {
+ if (values.length != 1) {
Activator.log.error("Waiting one icon path, but found " + values.length, null);
} else {
iconText.setText(values[0].toString());
selectedEntryProxy.getEntry().setSmallIcon(Activator.getImageDescriptor(iconText.getText().trim()));
selectedEntryProxy.getEntry().setLargeIcon(Activator.getImageDescriptor(iconText.getText().trim()));
- if(selectedEntryProxy instanceof PaletteAspectToolEntryProxy) {
- ((PaletteAspectToolEntryProxy)selectedEntryProxy).setIcon(iconText.getText().trim());
+ if (selectedEntryProxy instanceof PaletteAspectToolEntryProxy) {
+ ((PaletteAspectToolEntryProxy) selectedEntryProxy).setIcon(iconText.getText().trim());
}
}
}
@@ -173,7 +174,7 @@ public class PaletteEntryProxyInformationComposite {
*/
protected void updateNameEntryField() {
EntryType type = selectedEntryProxy.getType();
- switch(type) {
+ switch (type) {
case STACK:
case SEPARATOR:
nameText.setText("");
@@ -194,14 +195,14 @@ public class PaletteEntryProxyInformationComposite {
* Updates the reference field in the information area
*/
protected void updateReferencedEntryField() {
- if(selectedEntryProxy instanceof PaletteAspectToolEntryProxy) {
- CombinedTemplateCreationEntry entry = ((PaletteAspectToolEntryProxy)selectedEntryProxy).getEntry().getReferencedEntry();
+ if (selectedEntryProxy instanceof PaletteAspectToolEntryProxy) {
+ CombinedTemplateCreationEntry entry = ((PaletteAspectToolEntryProxy) selectedEntryProxy).getEntry().getReferencedEntry();
EClass eClass = PaletteUtil.getToolMetaclass(entry);
referencedText.setText((eClass != null) ? eClass.getInstanceTypeName() : "");
- } else if(selectedEntryProxy instanceof PaletteEntryProxy) {
+ } else if (selectedEntryProxy instanceof PaletteEntryProxy) {
PaletteEntry entry = selectedEntryProxy.getEntry();
- if(entry instanceof CombinedTemplateCreationEntry) {
- EClass eClass = PaletteUtil.getToolMetaclass((CombinedTemplateCreationEntry)entry);
+ if (entry instanceof CombinedTemplateCreationEntry) {
+ EClass eClass = PaletteUtil.getToolMetaclass((CombinedTemplateCreationEntry) entry);
referencedText.setText((eClass != null) ? eClass.getInstanceTypeName() : "");
} else {
referencedText.setText("");
@@ -217,7 +218,7 @@ public class PaletteEntryProxyInformationComposite {
*/
protected void updateDescriptionEntryField() {
EntryType type = selectedEntryProxy.getType();
- switch(type) {
+ switch (type) {
case STACK:
case SEPARATOR:
case DRAWER:
@@ -239,7 +240,7 @@ public class PaletteEntryProxyInformationComposite {
*/
protected void updateIconEntryField() {
EntryType type = selectedEntryProxy.getType();
- switch(type) {
+ switch (type) {
case STACK:
case SEPARATOR:
case TOOL:
@@ -265,9 +266,9 @@ public class PaletteEntryProxyInformationComposite {
/**
* Sets the new Selected entry
- *
+ *
* @param selectedEntryProxy
- * the selectedEntryProxy to set
+ * the selectedEntryProxy to set
*/
public void setSelectedEntryProxy(PaletteEntryProxy selectedEntryProxy) {
this.selectedEntryProxy = selectedEntryProxy;
@@ -293,7 +294,7 @@ public class PaletteEntryProxyInformationComposite {
* @{inheritDoc
*/
public void focusLost(FocusEvent e) {
- if(selectedEntryProxy != null) {
+ if (selectedEntryProxy != null) {
selectedEntryProxy.setLabel(nameText.getText().trim());
}
}
@@ -315,7 +316,7 @@ public class PaletteEntryProxyInformationComposite {
* @{inheritDoc
*/
public void focusLost(FocusEvent e) {
- if(selectedEntryProxy != null && selectedEntryProxy.getEntry() != null) {
+ if (selectedEntryProxy != null && selectedEntryProxy.getEntry() != null) {
selectedEntryProxy.setDescription(descriptionText.getText().trim());
}
}
@@ -336,11 +337,11 @@ public class PaletteEntryProxyInformationComposite {
* @{inheritDoc
*/
public void focusLost(FocusEvent e) {
- if(selectedEntryProxy != null && iconText.getText() != null && !iconText.getText().equals("")) {
+ if (selectedEntryProxy != null && iconText.getText() != null && !iconText.getText().equals("")) {
selectedEntryProxy.getEntry().setSmallIcon(Activator.getImageDescriptor(iconText.getText().trim()));
selectedEntryProxy.getEntry().setLargeIcon(Activator.getImageDescriptor(iconText.getText().trim()));
- if(selectedEntryProxy instanceof PaletteAspectToolEntryProxy) {
- ((PaletteAspectToolEntryProxy)selectedEntryProxy).setIcon(iconText.getText().trim());
+ if (selectedEntryProxy instanceof PaletteAspectToolEntryProxy) {
+ ((PaletteAspectToolEntryProxy) selectedEntryProxy).setIcon(iconText.getText().trim());
}
}
}
diff --git a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/PaletteLocalDrawerProxy.java b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/PaletteLocalDrawerProxy.java
index 8efeabee645..56d9d8db011 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/PaletteLocalDrawerProxy.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/PaletteLocalDrawerProxy.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2010 CEA LIST.
- *
+ *
* 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
@@ -41,9 +41,9 @@ public class PaletteLocalDrawerProxy extends PaletteContainerProxy {
/**
* Creates a new PaletteContainer
- *
+ *
* @param drawer
- * the drawer to cache
+ * the drawer to cache
*/
public PaletteLocalDrawerProxy(String name, String id, String imagePath, String description) {
super(null);
@@ -55,9 +55,9 @@ public class PaletteLocalDrawerProxy extends PaletteContainerProxy {
/**
* A listener can only be added once. Adding it more than once will do nothing.
- *
+ *
* @param listener
- * the PropertyChangeListener that is to be notified of changes
+ * the PropertyChangeListener that is to be notified of changes
* @see java.beans.PropertyChangeSupport#addPropertyChangeListener(java.beans.PropertyChangeListener)
*/
@Override
@@ -69,7 +69,7 @@ public class PaletteLocalDrawerProxy extends PaletteContainerProxy {
/**
* @param listener
- * the PropertyChangeListener that is not to be notified anymore
+ * the PropertyChangeListener that is not to be notified anymore
* @see java.beans.PropertyChangeSupport#removePropertyChangeListener(java.beans.PropertyChangeListener)
*/
@Override
@@ -112,7 +112,7 @@ public class PaletteLocalDrawerProxy extends PaletteContainerProxy {
/**
* Returns the image path
- *
+ *
* @return the image path
*/
@Override
@@ -122,9 +122,9 @@ public class PaletteLocalDrawerProxy extends PaletteContainerProxy {
/**
* Sets the label of the drawer
- *
+ *
* @param label
- * the label to set
+ * the label to set
*/
@Override
public void setLabel(String label) {
@@ -143,9 +143,9 @@ public class PaletteLocalDrawerProxy extends PaletteContainerProxy {
/**
* Sets the id of the drawer
- *
+ *
* @param id
- * the id to set
+ * the id to set
*/
public void setId(String id) {
this.id = id;
@@ -153,9 +153,9 @@ public class PaletteLocalDrawerProxy extends PaletteContainerProxy {
/**
* Sets the image path of the drawer
- *
+ *
* @param imagePath
- * the imagePath to set
+ * the imagePath to set
*/
public void setImagePath(String imagePath) {
String oldValue = this.imagePath;
@@ -165,9 +165,9 @@ public class PaletteLocalDrawerProxy extends PaletteContainerProxy {
/**
* Sets the description of the drawer
- *
+ *
* @param description
- * the description to set
+ * the description to set
*/
@Override
public void setDescription(String description) {
@@ -176,7 +176,7 @@ public class PaletteLocalDrawerProxy extends PaletteContainerProxy {
/**
* Returns the description of the drawer
- *
+ *
* @return the description of the drawer
*/
@Override
diff --git a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/PaletteLocalSeparatorProxy.java b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/PaletteLocalSeparatorProxy.java
index f2de8ef70a9..6162eabf9a4 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/PaletteLocalSeparatorProxy.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/PaletteLocalSeparatorProxy.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2009 CEA LIST.
- *
+ *
* 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
diff --git a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/PaletteLocalStackProxy.java b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/PaletteLocalStackProxy.java
index eb1a953c096..9be7196e8b5 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/PaletteLocalStackProxy.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/PaletteLocalStackProxy.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2009 CEA LIST.
- *
+ *
* 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
diff --git a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/PapyrusPaletteCustomizerDialog.java b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/PapyrusPaletteCustomizerDialog.java
index 6ce9f5a21ad..df38078a3d6 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/PapyrusPaletteCustomizerDialog.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/PapyrusPaletteCustomizerDialog.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2009 CEA LIST.
- *
+ *
* 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
@@ -52,6 +52,7 @@ import org.eclipse.papyrus.uml.diagram.common.Messages;
import org.eclipse.papyrus.uml.diagram.common.part.PaletteUtil;
import org.eclipse.papyrus.uml.diagram.common.part.PapyrusPaletteCustomizer;
import org.eclipse.papyrus.uml.diagram.common.part.PapyrusPalettePreferences;
+import org.eclipse.papyrus.uml.diagram.common.service.IPapyrusPaletteConstant;
import org.eclipse.papyrus.uml.diagram.common.service.PapyrusPaletteService;
import org.eclipse.papyrus.uml.diagram.common.service.PapyrusPaletteService.ExtendedProviderDescriptor;
import org.eclipse.swt.SWT;
@@ -130,13 +131,13 @@ public class PapyrusPaletteCustomizerDialog extends PaletteCustomizerDialogEx im
/**
* Creates a new PapyrusPaletteCustomizerDialog
- *
+ *
* @param shell
- * the shell that hosts the dialog window
+ * the shell that hosts the dialog window
* @param customizer
- * the customizer used to customize the palette
+ * the customizer used to customize the palette
* @param root
- * the root of the palette
+ * the root of the palette
*/
public PapyrusPaletteCustomizerDialog(Shell shell, PaletteCustomizer customizer, PaletteRoot root) {
super(shell, customizer, root);
@@ -214,7 +215,7 @@ public class PapyrusPaletteCustomizerDialog extends PaletteCustomizerDialogEx im
// add listeners
ISelectionChangedListener listener = createSelectionChangedListener();
- if(listener != null) {
+ if (listener != null) {
availablePalettesTableViewer.addSelectionChangedListener(listener);
}
return mainComposite;
@@ -228,13 +229,13 @@ public class PapyrusPaletteCustomizerDialog extends PaletteCustomizerDialogEx im
*/
public void selectionChanged(SelectionChangedEvent event) {
// retrieve element selected
- Object selectedElement = ((IStructuredSelection)event.getSelection()).getFirstElement();
+ Object selectedElement = ((IStructuredSelection) event.getSelection()).getFirstElement();
- if(selectedElement instanceof PapyrusPaletteService.ExtendedProviderDescriptor) {
+ if (selectedElement instanceof PapyrusPaletteService.ExtendedProviderDescriptor) {
paletteButtonsMap.get(DELETE_PALETTE_BUTTON_ID).setEnabled(false);
paletteButtonsMap.get(EDIT_PALETTE_BUTTON_ID).setEnabled(true);
paletteButtonsMap.get(RESTORE_DEFAULT_PALETTE_BUTTON_ID).setEnabled(true);
- } else if(selectedElement instanceof PapyrusPaletteService.LocalProviderDescriptor) {
+ } else if (selectedElement instanceof PapyrusPaletteService.LocalProviderDescriptor) {
paletteButtonsMap.get(DELETE_PALETTE_BUTTON_ID).setEnabled(true);
paletteButtonsMap.get(EDIT_PALETTE_BUTTON_ID).setEnabled(true);
paletteButtonsMap.get(RESTORE_DEFAULT_PALETTE_BUTTON_ID).setEnabled(false);
@@ -244,21 +245,21 @@ public class PapyrusPaletteCustomizerDialog extends PaletteCustomizerDialogEx im
paletteButtonsMap.get(RESTORE_DEFAULT_PALETTE_BUTTON_ID).setEnabled(false);
}
- // if(selectedElement instanceof PapyrusPaletteService.LocalProviderDescriptor) {
- // deletePaletteButton.setEnabled(true);
- // // check if the palette is in good configuration to be edited...
- // if(PaletteUtil.areRequiredProfileApplied(getActiveSashPage(), (PapyrusPaletteService.LocalProviderDescriptor)selectedElement)) {
- // editPaletteButton.setEnabled(true);
- // editPaletteButton.setToolTipText(Messages.PapyrusPaletteCustomizerDialog_EditButtonTooltip_LocalPaletteSelected);
- // } else {
- // editPaletteButton.setEnabled(false);
- // editPaletteButton.setToolTipText(Messages.PapyrusPaletteCustomizerDialog_EditButtonTooltip_MissingProfile);
- // }
- // } else {
- // deletePaletteButton.setEnabled(false);
- // editPaletteButton.setEnabled(false);
- // editPaletteButton.setToolTipText(Messages.PapyrusPaletteCustomizerDialog_EditButtonTooltip_LocalPaletteNotSelected);
- // }
+ // if(selectedElement instanceof PapyrusPaletteService.LocalProviderDescriptor) {
+ // deletePaletteButton.setEnabled(true);
+ // // check if the palette is in good configuration to be edited...
+ // if(PaletteUtil.areRequiredProfileApplied(getActiveSashPage(), (PapyrusPaletteService.LocalProviderDescriptor)selectedElement)) {
+ // editPaletteButton.setEnabled(true);
+ // editPaletteButton.setToolTipText(Messages.PapyrusPaletteCustomizerDialog_EditButtonTooltip_LocalPaletteSelected);
+ // } else {
+ // editPaletteButton.setEnabled(false);
+ // editPaletteButton.setToolTipText(Messages.PapyrusPaletteCustomizerDialog_EditButtonTooltip_MissingProfile);
+ // }
+ // } else {
+ // deletePaletteButton.setEnabled(false);
+ // editPaletteButton.setEnabled(false);
+ // editPaletteButton.setToolTipText(Messages.PapyrusPaletteCustomizerDialog_EditButtonTooltip_LocalPaletteNotSelected);
+ // }
}
};
}
@@ -266,12 +267,12 @@ public class PapyrusPaletteCustomizerDialog extends PaletteCustomizerDialogEx im
protected void addEntry(MouseEvent e) {
ISelection selection = availableToolsTreeViewer.getSelection();
PaletteEntry entry = null;
- if(selection instanceof IStructuredSelection) {
- Object firstElement = ((IStructuredSelection)selection).getFirstElement();
- if(!(firstElement instanceof PaletteEntry)) {
+ if (selection instanceof IStructuredSelection) {
+ Object firstElement = ((IStructuredSelection) selection).getFirstElement();
+ if (!(firstElement instanceof PaletteEntry)) {
return;
} else {
- entry = ((PaletteEntry)firstElement);
+ entry = ((PaletteEntry) firstElement);
}
}
// sets the active entry, to have the page useful for saving modification
@@ -279,27 +280,27 @@ public class PapyrusPaletteCustomizerDialog extends PaletteCustomizerDialogEx im
// add entry to the selected container
// retrieve the selection in the palette viewer
PaletteEntry destContainer = getSelectedPaletteEntry();
- ((PapyrusPaletteCustomizer)getCustomizer()).storePaletteState(entry);
- if(destContainer instanceof PaletteContainer) {
+ ((PapyrusPaletteCustomizer) getCustomizer()).storePaletteState(entry);
+ if (destContainer instanceof PaletteContainer) {
PaletteContainer oldParent = entry.getParent();
// checks if the parent is already changed. If not, must store the standard parent (the
// one given by the factory)
- PaletteContainer stdParent = ((PapyrusPaletteCustomizer)getCustomizer()).getChangedParents().get(entry);
- if(stdParent == null) {
- ((PapyrusPaletteCustomizer)getCustomizer()).getChangedParents().put(entry, entry.getParent());
+ PaletteContainer stdParent = ((PapyrusPaletteCustomizer) getCustomizer()).getChangedParents().get(entry);
+ if (stdParent == null) {
+ ((PapyrusPaletteCustomizer) getCustomizer()).getChangedParents().put(entry, entry.getParent());
}
oldParent.remove(entry);
- entry.setParent((PaletteContainer)destContainer);
- ((PaletteContainer)destContainer).add(entry);
+ entry.setParent((PaletteContainer) destContainer);
+ ((PaletteContainer) destContainer).add(entry);
} else {
// add it to the palette root
- PaletteRoot root = (PaletteRoot)PaletteUtil.getRoot(entry);
- if(root != null) {
+ PaletteRoot root = (PaletteRoot) PaletteUtil.getRoot(entry);
+ if (root != null) {
PaletteContainer oldParent = entry.getParent();
- PaletteContainer stdParent = ((PapyrusPaletteCustomizer)getCustomizer()).getChangedParents().get(entry);
- if(stdParent == null) {
- ((PapyrusPaletteCustomizer)getCustomizer()).getChangedParents().put(entry, stdParent);
+ PaletteContainer stdParent = ((PapyrusPaletteCustomizer) getCustomizer()).getChangedParents().get(entry);
+ if (stdParent == null) {
+ ((PapyrusPaletteCustomizer) getCustomizer()).getChangedParents().put(entry, stdParent);
}
oldParent.remove(entry);
entry.setParent(root);
@@ -310,9 +311,9 @@ public class PapyrusPaletteCustomizerDialog extends PaletteCustomizerDialogEx im
/**
* Creates the available palettes viewer part of the dialog.
- *
+ *
* @param container
- * The Composite within which the viewer has to be created
+ * The Composite within which the viewer has to be created
* @return The newly created Control that has the viewer
*/
protected Control createAvailablePalettesViewer(Composite container) {
@@ -331,7 +332,7 @@ public class PapyrusPaletteCustomizerDialog extends PaletteCustomizerDialogEx im
GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false);
nameLabel.setLayoutData(data);
- // Create action buttons
+ // Create action buttons
createEditionPaletteButton(composite, NEW_LOCAL_PALETTE_BUTTON_ID, Activator.getImage(NEW_LOCAL_DESC_IMAGE), Messages.Dialog_Create_Palette_Tooltip);
createEditionPaletteButton(composite, EDIT_PALETTE_BUTTON_ID, Activator.getImage(EDIT_LOCAL_DESC_IMAGE), Messages.Dialog_Edit_Palette_Tooltip);
createEditionPaletteButton(composite, DELETE_PALETTE_BUTTON_ID, Activator.getImage(DELETE_LOCAL_DESC_IMAGE), Messages.Dialog_Delete_Palette_Tooltip);
@@ -345,10 +346,10 @@ public class PapyrusPaletteCustomizerDialog extends PaletteCustomizerDialogEx im
* {@inheritDoc}
*/
public void widgetSelected(SelectionEvent e) {
- if(e.detail == SWT.CHECK) {
- TableItem item = (TableItem)e.item;
+ if (e.detail == SWT.CHECK) {
+ TableItem item = (TableItem) e.item;
// one item was checked => display/hide the given provider
- changeProviderVisibility((PapyrusPaletteService.ProviderDescriptor)item.getData(), item.getChecked());
+ changeProviderVisibility((PapyrusPaletteService.ProviderDescriptor) item.getData(), item.getChecked());
}
}
@@ -377,7 +378,7 @@ public class PapyrusPaletteCustomizerDialog extends PaletteCustomizerDialogEx im
public void doubleClick(DoubleClickEvent event) {
// get selection. if local palette: open the wizard to edit this local palette
- IStructuredSelection selection = (IStructuredSelection)event.getSelection();
+ IStructuredSelection selection = (IStructuredSelection) event.getSelection();
editSelectedPalette(selection);
}
});
@@ -387,7 +388,7 @@ public class PapyrusPaletteCustomizerDialog extends PaletteCustomizerDialogEx im
/**
* Create button to edit palette in table.
- *
+ *
* @param parentConposite
* @return
*/
@@ -409,7 +410,7 @@ public class PapyrusPaletteCustomizerDialog extends PaletteCustomizerDialogEx im
}
public void mouseUp(MouseEvent e) {
- buttonPressed(((Integer)e.widget.getData()).intValue());
+ buttonPressed(((Integer) e.widget.getData()).intValue());
}
@@ -428,9 +429,9 @@ public class PapyrusPaletteCustomizerDialog extends PaletteCustomizerDialogEx im
*/
@Override
protected void buttonPressed(int buttonId) {
- if(paletteButtonsMap.containsKey(buttonId)) {
+ if (paletteButtonsMap.containsKey(buttonId)) {
- switch(buttonId) {
+ switch (buttonId) {
case NEW_LOCAL_PALETTE_BUTTON_ID:
createNewLocalPalette();
break;
@@ -454,15 +455,15 @@ public class PapyrusPaletteCustomizerDialog extends PaletteCustomizerDialogEx im
/**
* Get selection in palettes table viewer.
- *
+ *
* @return The {@link IStructuredSelection} if there is one, otherwise <code>null</code>
*/
private IStructuredSelection getPalettesTableSelection() {
IStructuredSelection structuredSelection = null;
- if(availablePalettesTableViewer != null) {
+ if (availablePalettesTableViewer != null) {
ISelection selection = availablePalettesTableViewer.getSelection();
- if(selection instanceof IStructuredSelection) {
- structuredSelection = (IStructuredSelection)selection;
+ if (selection instanceof IStructuredSelection) {
+ structuredSelection = (IStructuredSelection) selection;
}
}
@@ -477,7 +478,7 @@ public class PapyrusPaletteCustomizerDialog extends PaletteCustomizerDialogEx im
*/
@Override
protected void setButtonLayoutData(Button button) {
- if(paletteButtonsMap.containsValue(button)) {
+ if (paletteButtonsMap.containsValue(button)) {
GridData data = new GridData(SWT.CENTER, SWT.CENTER, false, false);
button.setLayoutData(data);
button.setEnabled(false);
@@ -488,9 +489,9 @@ public class PapyrusPaletteCustomizerDialog extends PaletteCustomizerDialogEx im
/**
* Launch the wizard for the palette creation
- *
+ *
* @param shell
- * the shell where to display the wizard
+ * the shell where to display the wizard
*/
protected void createNewLocalPalette() {
NewLocalPaletteWizard wizard = new NewLocalPaletteWizard(getActiveSashPage(), getCustomizer());
@@ -502,11 +503,11 @@ public class PapyrusPaletteCustomizerDialog extends PaletteCustomizerDialogEx im
* Deletes the current selected local palette
*/
protected void deleteLocalPalette() {
- IStructuredSelection selection = (IStructuredSelection)availablePalettesTableViewer.getSelection();
- if(selection == null || !(selection.getFirstElement() instanceof PapyrusPaletteService.LocalProviderDescriptor)) {
+ IStructuredSelection selection = (IStructuredSelection) availablePalettesTableViewer.getSelection();
+ if (selection == null || !(selection.getFirstElement() instanceof PapyrusPaletteService.LocalProviderDescriptor)) {
MessageDialog.openError(getShell(), Messages.Dialog_Not_Local_Palette_Title, Messages.Dialog_Not_Local_Palette_Message);
} else {
- PapyrusPaletteService.LocalProviderDescriptor descriptor = ((PapyrusPaletteService.LocalProviderDescriptor)selection.getFirstElement());
+ PapyrusPaletteService.LocalProviderDescriptor descriptor = ((PapyrusPaletteService.LocalProviderDescriptor) selection.getFirstElement());
String id = descriptor.getContributionID();
PapyrusPalettePreferences.deleteLocalPalette(id);
}
@@ -516,11 +517,11 @@ public class PapyrusPaletteCustomizerDialog extends PaletteCustomizerDialogEx im
* Reset the current selected extended palette to the initial configurtion in the plugin
*/
protected void restoreExtendedPaletteToDefault() {
- IStructuredSelection selection = (IStructuredSelection)availablePalettesTableViewer.getSelection();
- if(selection == null || !(selection.getFirstElement() instanceof PapyrusPaletteService.ExtendedProviderDescriptor)) {
+ IStructuredSelection selection = (IStructuredSelection) availablePalettesTableViewer.getSelection();
+ if (selection == null || !(selection.getFirstElement() instanceof PapyrusPaletteService.ExtendedProviderDescriptor)) {
MessageDialog.openError(getShell(), Messages.Dialog_Not_Extended_Palette_Title, Messages.Dialog_Not_Extended_Palette_Message);
} else {
- PapyrusPaletteService.ExtendedProviderDescriptor descriptor = ((PapyrusPaletteService.ExtendedProviderDescriptor)selection.getFirstElement());
+ PapyrusPaletteService.ExtendedProviderDescriptor descriptor = ((PapyrusPaletteService.ExtendedProviderDescriptor) selection.getFirstElement());
String id = descriptor.getContributionID();
PapyrusPalettePreferences.unregisterLocalRedefinition(id);
}
@@ -528,16 +529,16 @@ public class PapyrusPaletteCustomizerDialog extends PaletteCustomizerDialogEx im
/**
* Method to launch edition dialog according to selection.
- *
+ *
* @param selection
- * Selection which determine kind of edition
+ * Selection which determine kind of edition
*/
protected void editSelectedPalette(IStructuredSelection selection) {
- if(selection != null) {
- if((selection.getFirstElement() instanceof PapyrusPaletteService.LocalProviderDescriptor)) {
- editLocalPalette((PapyrusPaletteService.LocalProviderDescriptor)selection.getFirstElement());
- } else if(selection.getFirstElement() instanceof PapyrusPaletteService.ExtendedProviderDescriptor) {
- editExtendedPalette((PapyrusPaletteService.ExtendedProviderDescriptor)selection.getFirstElement());
+ if (selection != null) {
+ if ((selection.getFirstElement() instanceof PapyrusPaletteService.LocalProviderDescriptor)) {
+ editLocalPalette((PapyrusPaletteService.LocalProviderDescriptor) selection.getFirstElement());
+ } else if (selection.getFirstElement() instanceof PapyrusPaletteService.ExtendedProviderDescriptor) {
+ editExtendedPalette((PapyrusPaletteService.ExtendedProviderDescriptor) selection.getFirstElement());
}
}
@@ -560,7 +561,7 @@ public class PapyrusPaletteCustomizerDialog extends PaletteCustomizerDialogEx im
String contributionID = descriptor.getContributionID();
String paletteRedefinition = PapyrusPalettePreferences.getPaletteRedefinition(contributionID);
- if(paletteRedefinition == null) {
+ if (paletteRedefinition == null) {
// create a local redefinition of this palette contribution
PapyrusPalettePreferences.createPaletteRedefinition(descriptor);
}
@@ -574,11 +575,11 @@ public class PapyrusPaletteCustomizerDialog extends PaletteCustomizerDialogEx im
/**
* Changes the visibility of the given provider
- *
+ *
* @param descriptor
- * the provider to hide/show
+ * the provider to hide/show
* @param isChecked
- * <code>true</code> if the descriptor should be visible
+ * <code>true</code> if the descriptor should be visible
*/
protected void changeProviderVisibility(PapyrusPaletteService.ProviderDescriptor descriptor, boolean isChecked) {
PapyrusPalettePreferences.changePaletteVisibility(descriptor.getContributionID(), getActiveSashPage().getClass().getName(), isChecked);
@@ -586,9 +587,9 @@ public class PapyrusPaletteCustomizerDialog extends PaletteCustomizerDialogEx im
/**
* Creates the main composite for the dialog area
- *
+ *
* @param parent
- * the parent of the createrd composite
+ * the parent of the createrd composite
* @return the newly created Composite
*/
protected Composite createMainComposite(Composite parent) {
@@ -617,9 +618,9 @@ public class PapyrusPaletteCustomizerDialog extends PaletteCustomizerDialogEx im
/**
* Constructor
- *
+ *
* @param tableViewer
- * The TableViewer whose ContentProvider this PaletteTreeProvider is
+ * The TableViewer whose ContentProvider this PaletteTreeProvider is
*/
public PalettesTableContentProvider(TableViewer tableViewer) {
this.viewer = tableViewer;
@@ -636,8 +637,8 @@ public class PapyrusPaletteCustomizerDialog extends PaletteCustomizerDialogEx im
* {@inheritDoc}
*/
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- if(newInput != null) {
- paletteService = (PapyrusPaletteService)newInput;
+ if (newInput != null) {
+ paletteService = (PapyrusPaletteService) newInput;
}
}
@@ -645,8 +646,8 @@ public class PapyrusPaletteCustomizerDialog extends PaletteCustomizerDialogEx im
* {@inheritDoc}
*/
public Object[] getElements(Object inputElement) {
- if(inputElement instanceof PapyrusPaletteService) {
- List<PapyrusPaletteService.ProviderDescriptor> providers = ((PapyrusPaletteService)inputElement).getContributingProviders(getActiveSashPage(), getPaletteRoot());
+ if (inputElement instanceof PapyrusPaletteService) {
+ List<PapyrusPaletteService.ProviderDescriptor> providers = ((PapyrusPaletteService) inputElement).getContributingProviders(getActiveSashPage(), getPaletteRoot());
return providers.toArray();
}
@@ -656,7 +657,7 @@ public class PapyrusPaletteCustomizerDialog extends PaletteCustomizerDialogEx im
/**
* Returns the current active sash page
- *
+ *
* @return the current active sash page
*/
protected IEditorPart getActiveSashPage() {
@@ -664,8 +665,8 @@ public class PapyrusPaletteCustomizerDialog extends PaletteCustomizerDialogEx im
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IEditorPart editorPart = page.getActiveEditor();
assert editorPart != null;
- ISashWindowsContainer sashWindowsContainer = (ISashWindowsContainer)editorPart.getAdapter(ISashWindowsContainer.class);
- if(sashWindowsContainer != null) {
+ ISashWindowsContainer sashWindowsContainer = (ISashWindowsContainer) editorPart.getAdapter(ISashWindowsContainer.class);
+ if (sashWindowsContainer != null) {
return sashWindowsContainer.getActiveEditor();
}
return null;
@@ -680,8 +681,8 @@ public class PapyrusPaletteCustomizerDialog extends PaletteCustomizerDialogEx im
* {@inheritDoc}
*/
public boolean isChecked(Object element) {
- if(element instanceof PapyrusPaletteService.ProviderDescriptor) {
- return !PapyrusPalettePreferences.getHiddenPalettes(getActiveSashPage()).contains(((PapyrusPaletteService.ProviderDescriptor)element).getContributionID());
+ if (element instanceof PapyrusPaletteService.ProviderDescriptor) {
+ return !PapyrusPalettePreferences.getHiddenPalettes(getActiveSashPage()).contains(((PapyrusPaletteService.ProviderDescriptor) element).getContributionID());
}
return false;
}
@@ -702,9 +703,9 @@ public class PapyrusPaletteCustomizerDialog extends PaletteCustomizerDialogEx im
/**
* Creates a new PaletteLabelProvider.
- *
+ *
* @param viewer
- * the table viewer where the labels are displayed
+ * the table viewer where the labels are displayed
*/
public PaletteLabelProvider(TableViewer viewer) {
}
@@ -715,12 +716,12 @@ public class PapyrusPaletteCustomizerDialog extends PaletteCustomizerDialogEx im
* {@inheritDoc}
*/
public Image getImage(Object element) {
- if(element instanceof PapyrusPaletteService.LocalProviderDescriptor) {
+ if (element instanceof PapyrusPaletteService.LocalProviderDescriptor) {
return Activator.getImage(LOCAL_DESCRIPTOR);
- } else if(element instanceof PapyrusPaletteService.ExtendedProviderDescriptor) {
+ } else if (element instanceof PapyrusPaletteService.ExtendedProviderDescriptor) {
// icon should be decorated if it is already defined in a local way or not.
return Activator.getImage(EXTENDED_PLUGIN_DESCRIPTOR);
- } else if(element instanceof PapyrusPaletteService.ProviderDescriptor) {
+ } else if (element instanceof PapyrusPaletteService.ProviderDescriptor) {
return Activator.getImage(PLUGIN_DESCRIPTOR);
}
return Activator.getImage(Activator.DEFAULT_IMAGE);
@@ -730,8 +731,8 @@ public class PapyrusPaletteCustomizerDialog extends PaletteCustomizerDialogEx im
* {@inheritDoc}
*/
public String getText(Object element) {
- if(element instanceof PapyrusPaletteService.ProviderDescriptor) {
- return ((PapyrusPaletteService.ProviderDescriptor)element).getContributionName();
+ if (element instanceof PapyrusPaletteService.ProviderDescriptor) {
+ return ((PapyrusPaletteService.ProviderDescriptor) element).getContributionName();
}
return "<undefined>";
}
@@ -747,7 +748,7 @@ public class PapyrusPaletteCustomizerDialog extends PaletteCustomizerDialogEx im
*/
public void dispose() {
Iterator<Image> images = imageCache.values().iterator();
- while(images.hasNext()) {
+ while (images.hasNext()) {
images.next().dispose();
}
imageCache = null;
@@ -773,7 +774,7 @@ public class PapyrusPaletteCustomizerDialog extends PaletteCustomizerDialogEx im
*/
public void preferenceChange(PreferenceChangeEvent event) {
String id = event.getKey();
- if(PapyrusPalettePreferences.PALETTE_CUSTOMIZATIONS_ID.equals(id) || PapyrusPalettePreferences.PALETTE_LOCAL_DEFINITIONS.equals(id)) {
+ if (IPapyrusPaletteConstant.PALETTE_CUSTOMIZATIONS_ID.equals(id) || IPapyrusPaletteConstant.PALETTE_LOCAL_DEFINITIONS.equals(id)) {
// refresh available palette table viewer
availablePalettesTableViewer.setInput(PapyrusPaletteService.getInstance());
}
diff --git a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/UpdateExtendedPaletteWizard.java b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/UpdateExtendedPaletteWizard.java
index d2a1672b4bc..20e85c407da 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/UpdateExtendedPaletteWizard.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/UpdateExtendedPaletteWizard.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2009 CEA LIST.
- *
+ *
* 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
@@ -42,11 +42,11 @@ public class UpdateExtendedPaletteWizard extends Wizard {
/**
* Creates a NewLocalPaletteWizard.
- *
+ *
* @param part
- * the editor part where the palette is available
+ * the editor part where the palette is available
* @param descriptor
- * the descriptor to edit
+ * the descriptor to edit
*/
public UpdateExtendedPaletteWizard(IEditorPart part, PapyrusPaletteService.ExtendedProviderDescriptor descriptor, PaletteCustomizer customizer) {
this.editorPart = part;
@@ -82,13 +82,13 @@ public class UpdateExtendedPaletteWizard extends Wizard {
// file has been created or updated
contentPage.performFinish(PapyrusPalettePreferences.getPalettePathFromID(infoPage.getPaletteID()));
- //PapyrusPalettePreferences.unregisterLocalRedefinition(infoPage.getPaletteID());
+ // PapyrusPalettePreferences.unregisterLocalRedefinition(infoPage.getPaletteID());
// generate the preference for local palette
String path = PapyrusPalettePreferences.getPaletteRedefinition(infoPage.getPaletteID());
- PapyrusPalettePreferences.registerLocalRedefinition(infoPage.getPaletteID(), path); // if already exists: removes, then add
+ PapyrusPalettePreferences.registerLocalRedefinition(infoPage.getPaletteID(), path); // if already exists: removes, then add
// toggle visiblity to refresh the content
- if(editorPart instanceof DiagramEditorWithFlyOutPalette) {
+ if (editorPart instanceof DiagramEditorWithFlyOutPalette) {
PapyrusPalettePreferences.changePaletteVisibility(infoPage.getPaletteID(), editorPart, false);
PapyrusPalettePreferences.changePaletteVisibility(infoPage.getPaletteID(), editorPart, true);
}
diff --git a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/UpdateLocalDrawerWizard.java b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/UpdateLocalDrawerWizard.java
index 39e92b2e158..78da5caae2e 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/UpdateLocalDrawerWizard.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/UpdateLocalDrawerWizard.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2009 CEA LIST.
- *
+ *
* 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
@@ -31,9 +31,9 @@ public class UpdateLocalDrawerWizard extends Wizard {
/**
* Creates a NewDrawerWizard.
- *
+ *
* @param paletteContainerProxy
- * the element where to add the new drawer
+ * the element where to add the new drawer
*/
public UpdateLocalDrawerWizard(PaletteContainerProxy paletteContainerProxy, PaletteLocalDrawerProxy drawerProxy) {
this.paletteContainerProxy = paletteContainerProxy;
diff --git a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/UpdateLocalPaletteWizard.java b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/UpdateLocalPaletteWizard.java
index e1e834135c0..fe527ed86c5 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/UpdateLocalPaletteWizard.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/dialog/UpdateLocalPaletteWizard.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2009 CEA LIST.
- *
+ *
* 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
@@ -41,11 +41,11 @@ public class UpdateLocalPaletteWizard extends Wizard {
/**
* Creates a NewLocalPaletteWizard.
- *
+ *
* @param part
- * the editor part where the palette is available
+ * the editor part where the palette is available
* @param descriptor
- * the descriptor to edit
+ * the descriptor to edit
*/
public UpdateLocalPaletteWizard(IEditorPart part, PapyrusPaletteService.LocalProviderDescriptor descriptor, PaletteCustomizer customizer) {
this.editorPart = part;
diff --git a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/handler/AbstractDeployPaletteConfigurationHandler.java b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/handler/AbstractDeployPaletteConfigurationHandler.java
index 15cf50a7430..e781bd0ece7 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/handler/AbstractDeployPaletteConfigurationHandler.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/handler/AbstractDeployPaletteConfigurationHandler.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* 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
@@ -32,6 +32,7 @@ import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.dialogs.TrayDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.window.Window;
import org.eclipse.papyrus.uml.diagram.common.Activator;
import org.eclipse.papyrus.uml.diagram.common.part.PaletteUtil;
import org.eclipse.papyrus.uml.diagram.common.part.PapyrusPalettePreferences;
@@ -57,19 +58,19 @@ public abstract class AbstractDeployPaletteConfigurationHandler extends Abstract
public String paletteName;
public ProviderPriority priority;
public String editorID;
- public String requiredProfiles ;
+ public String requiredProfiles;
public String fileName;
private Text nameText;
private Text editorText;
private Text profilesText;
- private CCombo priorityCombo;
-
-
+ private CCombo priorityCombo;
+
+
/**
* @param shell
- * @param priority
- * @param editorID
- * @param requiredProfiles
+ * @param priority
+ * @param editorID
+ * @param requiredProfiles
*/
protected UpdateContentDialog(Shell shell, String fileName, String paletteName, ProviderPriority priority, String editorID, Set<String> requiredProfiles) {
super(shell);
@@ -77,23 +78,23 @@ public abstract class AbstractDeployPaletteConfigurationHandler extends Abstract
this.paletteName = paletteName;
this.priority = priority;
this.editorID = editorID;
- if(requiredProfiles !=null) {
- this.requiredProfiles = PaletteUtil.getSerializedProfileList(requiredProfiles);
+ if (requiredProfiles != null) {
+ this.requiredProfiles = PaletteUtil.getSerializedProfileList(requiredProfiles);
}
}
-
+
/**
* {@inheritDoc}
*/
@Override
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
- if(newShell!=null) {
+ if (newShell != null) {
newShell.setText("Configure Deployment of the palette");
newShell.setSize(600, 400);
}
}
-
+
/**
* {@inheritDoc}
*/
@@ -103,84 +104,84 @@ public abstract class AbstractDeployPaletteConfigurationHandler extends Abstract
Composite composite = new Composite(superComposite, SWT.NONE);
composite.setLayout(new GridLayout(2, false));
composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
-
+
// new grid data will all necessary info
Label nameLabel = new Label(composite, SWT.NONE);
nameLabel.setText("Name:");
nameText = new Text(composite, SWT.BORDER);
- if(paletteName == null) {
+ if (paletteName == null) {
paletteName = fileName;
}
nameText.setText(paletteName);
nameText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
-
+
Label priorityLabel = new Label(composite, SWT.NONE);
priorityLabel.setText("Priority:");
priorityCombo = new CCombo(composite, SWT.BORDER);
priorityCombo.setEditable(false);
- priorityCombo.setItems(new String[] {ProviderPriority.LOWEST.getName(), ProviderPriority.LOW.getName(), ProviderPriority.MEDIUM.getName(), ProviderPriority.HIGH.getName(), ProviderPriority.HIGHEST.getName()});
- if(ProviderPriority.LOWEST.equals(priority)) {
+ priorityCombo.setItems(new String[] { ProviderPriority.LOWEST.getName(), ProviderPriority.LOW.getName(), ProviderPriority.MEDIUM.getName(), ProviderPriority.HIGH.getName(), ProviderPriority.HIGHEST.getName() });
+ if (ProviderPriority.LOWEST.equals(priority)) {
priorityCombo.select(0);
- } else if(ProviderPriority.LOW.equals(priority)) {
+ } else if (ProviderPriority.LOW.equals(priority)) {
priorityCombo.select(1);
- } else if(ProviderPriority.MEDIUM.equals(priority)) {
+ } else if (ProviderPriority.MEDIUM.equals(priority)) {
priorityCombo.select(2);
- } else if(ProviderPriority.HIGH.equals(priority)) {
+ } else if (ProviderPriority.HIGH.equals(priority)) {
priorityCombo.select(3);
- } else if(ProviderPriority.HIGHEST.equals(priority)) {
+ } else if (ProviderPriority.HIGHEST.equals(priority)) {
priorityCombo.select(4);
- } else {
+ } else {
priorityCombo.select(2); // default = medium
}
priorityCombo.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
-
+
Label editorLabel = new Label(composite, SWT.NONE);
editorLabel.setText("Editor:");
editorText = new Text(composite, SWT.BORDER);
- if(editorID == null) {
+ if (editorID == null) {
// TODO: try to see if a Papyrus editor is currently opened?
editorID = "";
}
editorText.setText(editorID);
editorText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
-
+
// list of profiles
Label profilesLabel = new Label(composite, SWT.NONE);
profilesLabel.setText("Profiles:");
profilesText = new Text(composite, SWT.BORDER);
- if(requiredProfiles != null) {
+ if (requiredProfiles != null) {
profilesText.setText(requiredProfiles);
}
profilesText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
-
+
return superComposite;
}
-
+
/**
* {@inheritDoc}
*/
@Override
protected void okPressed() {
// updates values
- if(nameText!=null && ! nameText.isDisposed()) {
- paletteName = nameText.getText();
+ if (nameText != null && !nameText.isDisposed()) {
+ paletteName = nameText.getText();
}
-
- if(editorText!=null && ! editorText.isDisposed()) {
- editorID = editorText.getText();
+
+ if (editorText != null && !editorText.isDisposed()) {
+ editorID = editorText.getText();
}
-
- if(priorityCombo!=null && ! priorityCombo.isDisposed()) {
+
+ if (priorityCombo != null && !priorityCombo.isDisposed()) {
priority = ProviderPriority.parse(priorityCombo.getText());
}
-
- if(profilesText!=null && ! profilesText.isDisposed()) {
- requiredProfiles = profilesText.getText();
+
+ if (profilesText != null && !profilesText.isDisposed()) {
+ requiredProfiles = profilesText.getText();
}
-
+
super.okPressed();
}
-
+
}
/**
@@ -188,119 +189,119 @@ public abstract class AbstractDeployPaletteConfigurationHandler extends Abstract
*/
public Object execute(ExecutionEvent event) throws ExecutionException {
ISelection currentSelection = HandlerUtil.getCurrentSelection(event);
- if(!(currentSelection instanceof IStructuredSelection) || currentSelection.isEmpty()) {
+ if (!(currentSelection instanceof IStructuredSelection) || currentSelection.isEmpty()) {
return null;
}
-
- final IStructuredSelection selection = (IStructuredSelection)currentSelection;
-
+
+ final IStructuredSelection selection = (IStructuredSelection) currentSelection;
+
final Shell activeShell = HandlerUtil.getActiveShell(event);
-
-
+
+
doExecute(selection, activeShell, new NullProgressMonitor());
return null;
-
+
}
protected void doExecute(IStructuredSelection selection, Shell activeShell, IProgressMonitor monitor) {
-
+
Iterator<?> selectionIterator = selection.iterator();
-
+
MultiStatus result = new MultiStatus(Activator.ID, IStatus.OK, "The palette configuration has been successfully deployed and activated", null);
-
- while(selectionIterator.hasNext()) {
+
+ while (selectionIterator.hasNext()) {
Object selectedElement = selectionIterator.next();
- if(selectedElement instanceof IAdaptable) {
- IFile selectedFile = (IFile)((IAdaptable)selectedElement).getAdapter(IFile.class);
- if(selectedFile == null) {
+ if (selectedElement instanceof IAdaptable) {
+ IFile selectedFile = (IFile) ((IAdaptable) selectedElement).getAdapter(IFile.class);
+ if (selectedFile == null) {
monitor.worked(1);
result.add(new Status(IStatus.ERROR, Activator.ID, "The selected element is not a file"));
continue;
}
-
-
+
+
String fileName = selectedFile.getFullPath().removeFileExtension().lastSegment();
monitor.subTask("Deploy " + fileName);
boolean alreadyDeployed = false;
// retrieve info => open a dialog, filled by current opened editor ?
ProviderPriority priority = getPriority(fileName);
- if(priority ==null) {
+ if (priority == null) {
priority = ProviderPriority.MEDIUM;
} else {
alreadyDeployed = true;
}
-
+
String editorID = getEditorID(fileName);
- if(editorID !=null) {
+ if (editorID != null) {
alreadyDeployed = true;
}
-
+
String paletteName = getPaletteName(fileName);
- if(paletteName !=null) {
+ if (paletteName != null) {
alreadyDeployed = true;
}
- Set<String> requiredProfiles = getRequiredProfiles(fileName);
- if(requiredProfiles !=null && requiredProfiles.size() > 0) {
+ Set<String> requiredProfiles = getRequiredProfiles(fileName);
+ if (requiredProfiles != null && requiredProfiles.size() > 0) {
alreadyDeployed = true;
}
String path = selectedFile.getFullPath().toString();
-
-
+
+
UpdateContentDialog dialog = new UpdateContentDialog(activeShell, fileName, paletteName, priority, editorID, requiredProfiles);
int returnCode = dialog.open();
- if(Dialog.OK==returnCode) {
+ if (Window.OK == returnCode) {
boolean validUpdate = true;
-
+
// update values from the editor
- if(dialog.paletteName !=null && dialog.paletteName.length()>0) {
- paletteName = dialog.paletteName;
+ if (dialog.paletteName != null && dialog.paletteName.length() > 0) {
+ paletteName = dialog.paletteName;
} else {
validUpdate = false;
}
-
- if(dialog.priority !=null ) {
- priority = dialog.priority;
+
+ if (dialog.priority != null) {
+ priority = dialog.priority;
} else {
validUpdate = false;
}
-
- if(dialog.editorID !=null && dialog.editorID.length()>0) {
- editorID = dialog.editorID;
- }else {
+
+ if (dialog.editorID != null && dialog.editorID.length() > 0) {
+ editorID = dialog.editorID;
+ } else {
validUpdate = false;
}
-
- if(dialog.requiredProfiles !=null && dialog.requiredProfiles.length()>0) {
+
+ if (dialog.requiredProfiles != null && dialog.requiredProfiles.length() > 0) {
requiredProfiles = PaletteUtil.getProfileSetFromString(dialog.requiredProfiles);
- }else {
+ } else {
requiredProfiles = Collections.emptySet();
}
-
- if(validUpdate) {
- if(alreadyDeployed) {
+
+ if (validUpdate) {
+ if (alreadyDeployed) {
// update values and set visible again
result.add(activatePalette(fileName, paletteName, path, priority, editorID, requiredProfiles));
} else {
result.add(deployPalette(fileName, paletteName, path, priority, editorID, requiredProfiles));
}
} else {
- result.add(new Status(IStatus.ERROR, Activator.ID, "The palette configuration was not deployed, because dialog content was not valid"));
+ result.add(new Status(IStatus.ERROR, Activator.ID, "The palette configuration was not deployed, because dialog content was not valid"));
}
} else {
result.add(new Status(IStatus.ERROR, Activator.ID, "The palette configuration was not deployed, because user did cancel the dialog"));
}
-
+
}
}
-
- if(result.getChildren().length == 1) {
- if(result.isOK()) {
+
+ if (result.getChildren().length == 1) {
+ if (result.isOK()) {
MessageDialog.openInformation(activeShell, "Success", result.getMessage());
- } else if(result.getSeverity() < IStatus.ERROR) { //Errors are already logged
+ } else if (result.getSeverity() < IStatus.ERROR) { // Errors are already logged
StatusManager.getManager().handle(result, StatusManager.SHOW);
}
- } else { //Merge the result and specify an appropriate message based on the result
- if(result.isOK()) {
+ } else { // Merge the result and specify an appropriate message based on the result
+ if (result.isOK()) {
MessageDialog.openInformation(activeShell, "Success", result.getMessage());
} else {
MultiStatus actualResult = new MultiStatus(Activator.ID, result.getCode(), "Some errors occurred during the deployment", result.getException());
@@ -335,6 +336,7 @@ public abstract class AbstractDeployPaletteConfigurationHandler extends Abstract
/**
* Warning. Can be <code>null</code>!
+ *
* @param identifier
* @return
*/
@@ -343,7 +345,7 @@ public abstract class AbstractDeployPaletteConfigurationHandler extends Abstract
}
protected abstract XMLMemento getMemento();
-
+
/**
* @param fileName
* @param paletteName
@@ -364,6 +366,6 @@ public abstract class AbstractDeployPaletteConfigurationHandler extends Abstract
* @param requiredProfiles
* @return
*/
- protected abstract IStatus activatePalette(String fileName, String paletteName, String path, ProviderPriority priority, String editorID, Set<String> requiredProfiles) ;
+ protected abstract IStatus activatePalette(String fileName, String paletteName, String path, ProviderPriority priority, String editorID, Set<String> requiredProfiles);
}
diff --git a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/handler/AbstractUndeployPaletteConfigurationHandler.java b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/handler/AbstractUndeployPaletteConfigurationHandler.java
index df4cd6079ce..43aea9e6f54 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/handler/AbstractUndeployPaletteConfigurationHandler.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/handler/AbstractUndeployPaletteConfigurationHandler.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* 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
@@ -40,7 +40,7 @@ import org.eclipse.ui.statushandlers.StatusManager;
public abstract class AbstractUndeployPaletteConfigurationHandler extends AbstractHandler {
/**
- *
+ *
*/
public AbstractUndeployPaletteConfigurationHandler() {
super();
@@ -51,62 +51,62 @@ public abstract class AbstractUndeployPaletteConfigurationHandler extends Abstra
*/
public Object execute(ExecutionEvent event) throws ExecutionException {
ISelection currentSelection = HandlerUtil.getCurrentSelection(event);
- if(!(currentSelection instanceof IStructuredSelection) || currentSelection.isEmpty()) {
+ if (!(currentSelection instanceof IStructuredSelection) || currentSelection.isEmpty()) {
return null;
}
-
- final IStructuredSelection selection = (IStructuredSelection)currentSelection;
-
+
+ final IStructuredSelection selection = (IStructuredSelection) currentSelection;
+
final Shell activeShell = HandlerUtil.getActiveShell(event);
-
-
- doExecute(selection,activeShell, new NullProgressMonitor());
+
+
+ doExecute(selection, activeShell, new NullProgressMonitor());
return null;
}
protected void doExecute(IStructuredSelection selection, Shell activeShell, IProgressMonitor monitor) {
Iterator<?> selectionIterator = selection.iterator();
-
+
MultiStatus result = new MultiStatus(Activator.ID, IStatus.OK, "The palette configuration has been successfully deactivated and undeployed", null);
-
- while(selectionIterator.hasNext()) {
+
+ while (selectionIterator.hasNext()) {
Object selectedElement = selectionIterator.next();
- if(selectedElement instanceof IAdaptable) {
- IFile selectedFile = (IFile)((IAdaptable)selectedElement).getAdapter(IFile.class);
- if(selectedFile == null) {
+ if (selectedElement instanceof IAdaptable) {
+ IFile selectedFile = (IFile) ((IAdaptable) selectedElement).getAdapter(IFile.class);
+ if (selectedFile == null) {
monitor.worked(1);
result.add(new Status(IStatus.ERROR, Activator.ID, "The selected element is not a file"));
continue;
}
-
-
+
+
String fileName = selectedFile.getFullPath().removeFileExtension().lastSegment();
monitor.subTask("Undeploy " + fileName);
-
+
// do not delete.
// PapyrusPalettePreferences.deleteWorkspacePalette(fileName);
-
+
// if not deploy, do nothing and onlyh warn
String editorId = getEditorID(fileName);
- if(editorId == null) {
+ if (editorId == null) {
// not deployed: cancel the undeploy action
MessageDialog.openInformation(activeShell, "Not deployed", "This palette is currently not deployed");
- result.add(new Status(IStatus.ERROR, Activator.ID, "The palette configuration "+fileName+" was not undeployed already"));
+ result.add(new Status(IStatus.ERROR, Activator.ID, "The palette configuration " + fileName + " was not undeployed already"));
} else {
result.add(deactivatePalette(fileName, editorId));
}
-
+
}
}
-
- if(result.getChildren().length == 1) {
- if(result.isOK()) {
+
+ if (result.getChildren().length == 1) {
+ if (result.isOK()) {
MessageDialog.openInformation(activeShell, "Success", result.getMessage());
- } else if(result.getSeverity() < IStatus.ERROR) { //Errors are already logged
+ } else if (result.getSeverity() < IStatus.ERROR) { // Errors are already logged
StatusManager.getManager().handle(result, StatusManager.SHOW);
}
- } else { //Merge the result and specify an appropriate message based on the result
- if(result.isOK()) {
+ } else { // Merge the result and specify an appropriate message based on the result
+ if (result.isOK()) {
MessageDialog.openInformation(activeShell, "Success", result.getMessage());
} else {
MultiStatus actualResult = new MultiStatus(Activator.ID, result.getCode(), "Some errors occurred during the deployment", result.getException());
@@ -124,7 +124,7 @@ public abstract class AbstractUndeployPaletteConfigurationHandler extends Abstra
* @param fileName
* @return
*/
- protected abstract IStatus deactivatePalette(String identifier, String editorId);
+ protected abstract IStatus deactivatePalette(String identifier, String editorId);
/**
* @param identifier
diff --git a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/handler/DeployExtendedPaletteConfigurationHandler.java b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/handler/DeployExtendedPaletteConfigurationHandler.java
index f3c0c17ed6a..c835025cff3 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/handler/DeployExtendedPaletteConfigurationHandler.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/handler/DeployExtendedPaletteConfigurationHandler.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2014 CEA LIST.
- *
+ *
* 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
@@ -35,7 +35,7 @@ public class DeployExtendedPaletteConfigurationHandler extends AbstractDeployPal
protected IStatus deployPalette(String fileName, String paletteName, String path, ProviderPriority priority, String editorID, Set<String> requiredProfiles) {
// just add the palette
PapyrusPalettePreferences.addWorkspaceExtendedPalette(fileName, paletteName, path, priority, editorID, requiredProfiles);
- return new Status(IStatus.OK, Activator.ID, "The palette configuration has been successfully deployed and activated");
+ return new Status(IStatus.OK, Activator.ID, "The palette configuration has been successfully deployed and activated");
}
/**
@@ -47,7 +47,7 @@ public class DeployExtendedPaletteConfigurationHandler extends AbstractDeployPal
PapyrusPalettePreferences.changePaletteVisibility(fileName, editorID, true);
return new Status(IStatus.OK, Activator.ID, "The palette configuration was already deployed, it has just been activated");
}
-
+
/**
* {@inheritDoc}
*/
diff --git a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/handler/DeployPaletteConfigurationHandler.java b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/handler/DeployPaletteConfigurationHandler.java
index 699d6e9c33e..99e3ae2afd6 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/handler/DeployPaletteConfigurationHandler.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/handler/DeployPaletteConfigurationHandler.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* 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
@@ -47,7 +47,7 @@ public class DeployPaletteConfigurationHandler extends AbstractDeployPaletteConf
PapyrusPalettePreferences.changePaletteVisibility(fileName, editorID, true);
return new Status(IStatus.OK, Activator.ID, "The palette configuration was already deployed, it has just been activated");
}
-
+
/**
* {@inheritDoc}
*/
diff --git a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/handler/UndeployExtendedPaletteConfigurationHandler.java b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/handler/UndeployExtendedPaletteConfigurationHandler.java
index 1b53065728e..7e7a6d61c0c 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/handler/UndeployExtendedPaletteConfigurationHandler.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/handler/UndeployExtendedPaletteConfigurationHandler.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* 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
@@ -31,9 +31,9 @@ public class UndeployExtendedPaletteConfigurationHandler extends AbstractUndeplo
@Override
protected IStatus deactivatePalette(String identifier, String editorId) {
PapyrusPalettePreferences.changePaletteVisibility(identifier, editorId, false);
- return new Status(IStatus.OK, Activator.ID, "The palette configuration "+identifier+" has been successfully deactivated and undeployed");
+ return new Status(IStatus.OK, Activator.ID, "The palette configuration " + identifier + " has been successfully deactivated and undeployed");
}
-
+
/**
* {@inheritDoc}
*/
diff --git a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/handler/UndeployPaletteConfigurationHandler.java b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/handler/UndeployPaletteConfigurationHandler.java
index 0b305a57c18..40b1be5b983 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/handler/UndeployPaletteConfigurationHandler.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/handler/UndeployPaletteConfigurationHandler.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* 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
diff --git a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/proxies/XMLPaletteDefinitionProxyFactory.java b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/proxies/XMLPaletteDefinitionProxyFactory.java
index ac6c4819534..452d383170b 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/proxies/XMLPaletteDefinitionProxyFactory.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.palette/src/org/eclipse/papyrus/customization/palette/proxies/XMLPaletteDefinitionProxyFactory.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2009 CEA LIST.
- *
+ *
* 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
@@ -47,26 +47,26 @@ public class XMLPaletteDefinitionProxyFactory implements XMLPaletteDefinitionVis
/**
* Creates a new XMLDefinitionPaletteFactory
- *
+ *
* @param root
- * the palette root to fill
+ * the palette root to fill
* @param predefinedEntries
- * existing predefined entries
+ * existing predefined entries
*/
public XMLPaletteDefinitionProxyFactory(Map<String, PaletteEntry> predefinedEntries) {
this.predefinedEntries = predefinedEntries;
registry = new HashMap<Node, IPaletteEntryProxy>();
}
-
+
/**
* Returns the parent proxy for the given node
- *
+ *
* @param node
- * the node for which the parent is searched
+ * the node for which the parent is searched
* @return the parent of this node
*/
protected PaletteContainerProxy getParentProxy(Node node) {
- return (PaletteContainerProxy)registry.get(node.getParentNode());
+ return (PaletteContainerProxy) registry.get(node.getParentNode());
}
/**
@@ -85,12 +85,13 @@ public class XMLPaletteDefinitionProxyFactory implements XMLPaletteDefinitionVis
PaletteEntry entry = predefinedEntries.get(id);
PaletteContainerProxy proxy;
Node descriptionNode = node.getAttributes().getNamedItem(DESCRIPTION);
- proxy = new PaletteLocalDrawerProxy(node.getAttributes().getNamedItem(NAME).getNodeValue(), node.getAttributes().getNamedItem(ID).getNodeValue(), node.getAttributes().getNamedItem(ICON_PATH).getNodeValue(), (descriptionNode != null) ? descriptionNode.getNodeValue() : "");
+ proxy = new PaletteLocalDrawerProxy(node.getAttributes().getNamedItem(NAME).getNodeValue(), node.getAttributes().getNamedItem(ID).getNodeValue(), node.getAttributes().getNamedItem(ICON_PATH).getNodeValue(),
+ (descriptionNode != null) ? descriptionNode.getNodeValue() : "");
getParentProxy(node).addChild(proxy);
registry.put(node, proxy);
}
-
+
/**
* {@inheritDoc}
*/
@@ -130,8 +131,8 @@ public class XMLPaletteDefinitionProxyFactory implements XMLPaletteDefinitionVis
String id = node.getAttributes().getNamedItem(ID).getNodeValue();
PaletteEntry entry = predefinedEntries.get(id);
- if(entry instanceof AspectCreationEntry) {
- PaletteAspectToolEntryProxy proxy = new PaletteAspectToolEntryProxy((AspectCreationEntry)entry);
+ if (entry instanceof AspectCreationEntry) {
+ PaletteAspectToolEntryProxy proxy = new PaletteAspectToolEntryProxy((AspectCreationEntry) entry);
getParentProxy(node).addChild(proxy);
registry.put(node, proxy);
} else {
@@ -141,7 +142,7 @@ public class XMLPaletteDefinitionProxyFactory implements XMLPaletteDefinitionVis
/**
* Returns the root proxy for the created element
- *
+ *
* @return the container proxy
*/
public PaletteContainerProxy getRootProxy() {
diff --git a/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/Activator.java b/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/Activator.java
index 2c057e3642e..62eb33f12fc 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/Activator.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/Activator.java
@@ -22,6 +22,7 @@ public class Activator extends AbstractUIPlugin {
/*
* (non-Javadoc)
+ *
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
@Override
@@ -32,6 +33,7 @@ public class Activator extends AbstractUIPlugin {
/*
* (non-Javadoc)
+ *
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
@Override
diff --git a/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/queries/GetDrawerLabelQuery.java b/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/queries/GetDrawerLabelQuery.java
index 445f31d6b1d..c9b8c917a35 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/queries/GetDrawerLabelQuery.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/queries/GetDrawerLabelQuery.java
@@ -10,6 +10,6 @@ import org.eclipse.papyrus.uml.diagram.paletteconfiguration.DrawerConfiguration;
public class GetDrawerLabelQuery implements IJavaQuery2<DrawerConfiguration, String> {
public String evaluate(DrawerConfiguration source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
- return (source.getLabel() !=null ? source.getLabel() : "<>");
+ return (source.getLabel() != null ? source.getLabel() : "<>");
}
}
diff --git a/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/queries/GetIconQuery.java b/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/queries/GetIconQuery.java
index 2240764d22f..f9b91839b54 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/queries/GetIconQuery.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/queries/GetIconQuery.java
@@ -14,14 +14,14 @@ public class GetIconQuery implements IJavaQuery2<Configuration, String> {
public String evaluate(Configuration source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
// retrieves icon descriptor
IconDescriptor descriptor = source.getIcon();
- if(descriptor == null) {
+ if (descriptor == null) {
return "";
}
String bundleID = descriptor.getPluginID();
String iconPath = descriptor.getIconPath();
- if(bundleID == null || iconPath == null) {
+ if (bundleID == null || iconPath == null) {
return "";
}
diff --git a/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/queries/GetToolLabelQuery.java b/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/queries/GetToolLabelQuery.java
index 422d537080d..28af93ff21c 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/queries/GetToolLabelQuery.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/queries/GetToolLabelQuery.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2010 CEA LIST.
*
- *
+ *
* 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
@@ -25,7 +25,7 @@ public class GetToolLabelQuery implements IJavaQuery2<ToolConfiguration, String>
public String evaluate(ToolConfiguration source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
StringBuffer buffer = new StringBuffer();
buffer.append('[');
- switch(source.getKind()) {
+ switch (source.getKind()) {
case CONNECTION_TOOL:
buffer.append("Connection Tool");
break;
diff --git a/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/queries/HasIconQuery.java b/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/queries/HasIconQuery.java
index bbd4e0b801a..15a8fcfda5b 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/queries/HasIconQuery.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.paletteconfiguration/src/org/eclipse/papyrus/customization/paletteconfiguration/queries/HasIconQuery.java
@@ -1,4 +1,5 @@
package org.eclipse.papyrus.customization.paletteconfiguration.queries;
+
import org.eclipse.papyrus.emf.facet.efacet.core.IFacetManager;
import org.eclipse.papyrus.emf.facet.efacet.core.exception.DerivedTypedElementException;
import org.eclipse.papyrus.emf.facet.query.java.core.IJavaQuery2;
@@ -7,13 +8,13 @@ import org.eclipse.papyrus.uml.diagram.paletteconfiguration.Configuration;
/** Returns <code>true</code> if the element has a specific icon to display */
public class HasIconQuery implements IJavaQuery2<Configuration, Boolean> {
-
+
public Boolean evaluate(Configuration source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
IJavaQuery2<Configuration, String> getImageQuery = new GetIconQuery();
String imagePath = getImageQuery.evaluate(source, parameterValues, facetManager);
- if(imagePath!=null && imagePath.length() > 0) {
+ if (imagePath != null && imagePath.length() > 0) {
return true;
}
return false;
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/ContextElement.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/ContextElement.java
index 2d04fdc1017..c36fde86b8a 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/ContextElement.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/ContextElement.java
@@ -17,9 +17,9 @@ import org.eclipse.emf.ecore.EObject;
* <p>
* The following features are supported:
* <ul>
- * <li>{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.ContextElement#getElements <em>Elements</em>}</li>
- * <li>{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.ContextElement#getProperties <em>Properties</em>}</li>
- * <li>{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.ContextElement#getName <em>Name</em>}</li>
+ * <li>{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.ContextElement#getElements <em>Elements</em>}</li>
+ * <li>{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.ContextElement#getProperties <em>Properties</em>}</li>
+ * <li>{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.ContextElement#getName <em>Name</em>}</li>
* </ul>
* </p>
*
@@ -37,6 +37,7 @@ public interface ContextElement extends EObject {
* If the meaning of the '<em>Elements</em>' containment reference list isn't clear, there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
+ *
* @return the value of the '<em>Elements</em>' containment reference list.
* @see org.eclipse.papyrus.customization.properties.generation.fieldselection.FieldSelectionPackage#getContextElement_Elements()
* @model containment="true"
@@ -52,6 +53,7 @@ public interface ContextElement extends EObject {
* If the meaning of the '<em>Properties</em>' containment reference list isn't clear, there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
+ *
* @return the value of the '<em>Properties</em>' containment reference list.
* @see org.eclipse.papyrus.customization.properties.generation.fieldselection.FieldSelectionPackage#getContextElement_Properties()
* @model containment="true"
@@ -66,6 +68,7 @@ public interface ContextElement extends EObject {
* If the meaning of the '<em>Name</em>' attribute isn't clear, there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
+ *
* @return the value of the '<em>Name</em>' attribute.
* @see #setName(String)
* @see org.eclipse.papyrus.customization.properties.generation.fieldselection.FieldSelectionPackage#getContextElement_Name()
@@ -78,7 +81,9 @@ public interface ContextElement extends EObject {
* Sets the value of the '{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.ContextElement#getName <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
+ *
+ * @param value
+ * the new value of the '<em>Name</em>' attribute.
* @see #getName()
* @generated
*/
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/FieldSelection.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/FieldSelection.java
index 312b4c6ed36..d6833824e70 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/FieldSelection.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/FieldSelection.java
@@ -17,8 +17,8 @@ import org.eclipse.emf.ecore.EObject;
* <p>
* The following features are supported:
* <ul>
- * <li>{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.FieldSelection#getFields <em>Fields</em>}</li>
- * <li>{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.FieldSelection#getContextElements <em>Context Elements</em>}</li>
+ * <li>{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.FieldSelection#getFields <em>Fields</em>}</li>
+ * <li>{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.FieldSelection#getContextElements <em>Context Elements</em>}</li>
* </ul>
* </p>
*
@@ -36,6 +36,7 @@ public interface FieldSelection extends EObject {
* If the meaning of the '<em>Fields</em>' containment reference list isn't clear, there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
+ *
* @return the value of the '<em>Fields</em>' containment reference list.
* @see org.eclipse.papyrus.customization.properties.generation.fieldselection.FieldSelectionPackage#getFieldSelection_Fields()
* @model containment="true"
@@ -51,6 +52,7 @@ public interface FieldSelection extends EObject {
* If the meaning of the '<em>Context Elements</em>' containment reference list isn't clear, there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
+ *
* @return the value of the '<em>Context Elements</em>' containment reference list.
* @see org.eclipse.papyrus.customization.properties.generation.fieldselection.FieldSelectionPackage#getFieldSelection_ContextElements()
* @model containment="true"
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/FieldSelectionFactory.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/FieldSelectionFactory.java
index b1a8ef9499b..9a561af4710 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/FieldSelectionFactory.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/FieldSelectionFactory.java
@@ -13,6 +13,7 @@ import org.eclipse.emf.ecore.EFactory;
* The <b>Factory</b> for the model.
* It provides a create method for each non-abstract class of the model.
* <!-- end-user-doc -->
+ *
* @see org.eclipse.papyrus.customization.properties.generation.fieldselection.FieldSelectionPackage
* @generated
*/
@@ -22,6 +23,7 @@ public interface FieldSelectionFactory extends EFactory {
* The singleton instance of the factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
FieldSelectionFactory eINSTANCE = org.eclipse.papyrus.customization.properties.generation.fieldselection.impl.FieldSelectionFactoryImpl.init();
@@ -30,6 +32,7 @@ public interface FieldSelectionFactory extends EFactory {
* Returns a new object of class '<em>Field Selection</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @return a new object of class '<em>Field Selection</em>'.
* @generated
*/
@@ -39,6 +42,7 @@ public interface FieldSelectionFactory extends EFactory {
* Returns a new object of class '<em>Property Definition</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @return a new object of class '<em>Property Definition</em>'.
* @generated
*/
@@ -48,6 +52,7 @@ public interface FieldSelectionFactory extends EFactory {
* Returns a new object of class '<em>Context Element</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @return a new object of class '<em>Context Element</em>'.
* @generated
*/
@@ -57,9 +62,10 @@ public interface FieldSelectionFactory extends EFactory {
* Returns the package supported by this factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @return the package supported by this factory.
* @generated
*/
FieldSelectionPackage getFieldSelectionPackage();
-} //FieldSelectionFactory
+} // FieldSelectionFactory
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/FieldSelectionPackage.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/FieldSelectionPackage.java
index c4e9152ec0d..f9cfaec3eb9 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/FieldSelectionPackage.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/FieldSelectionPackage.java
@@ -23,6 +23,7 @@ import org.eclipse.emf.ecore.EReference;
* <li>and each data type</li>
* </ul>
* <!-- end-user-doc -->
+ *
* @see org.eclipse.papyrus.customization.properties.generation.fieldselection.FieldSelectionFactory
* @model kind="package"
* @generated
@@ -33,6 +34,7 @@ public interface FieldSelectionPackage extends EPackage {
* The package name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
String eNAME = "fieldselection";
@@ -41,6 +43,7 @@ public interface FieldSelectionPackage extends EPackage {
* The package namespace URI.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
String eNS_URI = "http://www.eclipse.org/papyrus/properties/fieldSelection";
@@ -49,6 +52,7 @@ public interface FieldSelectionPackage extends EPackage {
* The package namespace name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
String eNS_PREFIX = "fs";
@@ -57,6 +61,7 @@ public interface FieldSelectionPackage extends EPackage {
* The singleton instance of the package.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
FieldSelectionPackage eINSTANCE = org.eclipse.papyrus.customization.properties.generation.fieldselection.impl.FieldSelectionPackageImpl.init();
@@ -65,6 +70,7 @@ public interface FieldSelectionPackage extends EPackage {
* The meta object id for the '{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.impl.FieldSelectionImpl <em>Field Selection</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @see org.eclipse.papyrus.customization.properties.generation.fieldselection.impl.FieldSelectionImpl
* @see org.eclipse.papyrus.customization.properties.generation.fieldselection.impl.FieldSelectionPackageImpl#getFieldSelection()
* @generated
@@ -75,6 +81,7 @@ public interface FieldSelectionPackage extends EPackage {
* The feature id for the '<em><b>Fields</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
* @ordered
*/
@@ -84,6 +91,7 @@ public interface FieldSelectionPackage extends EPackage {
* The feature id for the '<em><b>Context Elements</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
* @ordered
*/
@@ -93,6 +101,7 @@ public interface FieldSelectionPackage extends EPackage {
* The number of structural features of the '<em>Field Selection</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
* @ordered
*/
@@ -102,6 +111,7 @@ public interface FieldSelectionPackage extends EPackage {
* The meta object id for the '{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.impl.PropertyDefinitionImpl <em>Property Definition</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @see org.eclipse.papyrus.customization.properties.generation.fieldselection.impl.PropertyDefinitionImpl
* @see org.eclipse.papyrus.customization.properties.generation.fieldselection.impl.FieldSelectionPackageImpl#getPropertyDefinition()
* @generated
@@ -112,6 +122,7 @@ public interface FieldSelectionPackage extends EPackage {
* The feature id for the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
* @ordered
*/
@@ -121,6 +132,7 @@ public interface FieldSelectionPackage extends EPackage {
* The feature id for the '<em><b>Value Single</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
* @ordered
*/
@@ -130,6 +142,7 @@ public interface FieldSelectionPackage extends EPackage {
* The feature id for the '<em><b>Value Multiple</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
* @ordered
*/
@@ -139,6 +152,7 @@ public interface FieldSelectionPackage extends EPackage {
* The number of structural features of the '<em>Property Definition</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
* @ordered
*/
@@ -148,6 +162,7 @@ public interface FieldSelectionPackage extends EPackage {
* The meta object id for the '{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.impl.ContextElementImpl <em>Context Element</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @see org.eclipse.papyrus.customization.properties.generation.fieldselection.impl.ContextElementImpl
* @see org.eclipse.papyrus.customization.properties.generation.fieldselection.impl.FieldSelectionPackageImpl#getContextElement()
* @generated
@@ -158,6 +173,7 @@ public interface FieldSelectionPackage extends EPackage {
* The feature id for the '<em><b>Elements</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
* @ordered
*/
@@ -167,6 +183,7 @@ public interface FieldSelectionPackage extends EPackage {
* The feature id for the '<em><b>Properties</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
* @ordered
*/
@@ -176,6 +193,7 @@ public interface FieldSelectionPackage extends EPackage {
* The feature id for the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
* @ordered
*/
@@ -185,6 +203,7 @@ public interface FieldSelectionPackage extends EPackage {
* The number of structural features of the '<em>Context Element</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
* @ordered
*/
@@ -194,6 +213,7 @@ public interface FieldSelectionPackage extends EPackage {
* The meta object id for the '<em>Value</em>' data type.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @see org.eclipse.papyrus.customization.properties.generation.wizard.widget.TernaryButton.State
* @see org.eclipse.papyrus.customization.properties.generation.fieldselection.impl.FieldSelectionPackageImpl#getValue()
* @generated
@@ -205,6 +225,7 @@ public interface FieldSelectionPackage extends EPackage {
* Returns the meta object for class '{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.FieldSelection <em>Field Selection</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @return the meta object for class '<em>Field Selection</em>'.
* @see org.eclipse.papyrus.customization.properties.generation.fieldselection.FieldSelection
* @generated
@@ -215,6 +236,7 @@ public interface FieldSelectionPackage extends EPackage {
* Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.FieldSelection#getFields <em>Fields</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @return the meta object for the containment reference list '<em>Fields</em>'.
* @see org.eclipse.papyrus.customization.properties.generation.fieldselection.FieldSelection#getFields()
* @see #getFieldSelection()
@@ -226,6 +248,7 @@ public interface FieldSelectionPackage extends EPackage {
* Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.FieldSelection#getContextElements <em>Context Elements</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @return the meta object for the containment reference list '<em>Context Elements</em>'.
* @see org.eclipse.papyrus.customization.properties.generation.fieldselection.FieldSelection#getContextElements()
* @see #getFieldSelection()
@@ -237,6 +260,7 @@ public interface FieldSelectionPackage extends EPackage {
* Returns the meta object for class '{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.PropertyDefinition <em>Property Definition</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @return the meta object for class '<em>Property Definition</em>'.
* @see org.eclipse.papyrus.customization.properties.generation.fieldselection.PropertyDefinition
* @generated
@@ -247,6 +271,7 @@ public interface FieldSelectionPackage extends EPackage {
* Returns the meta object for the attribute '{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.PropertyDefinition#getName <em>Name</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @return the meta object for the attribute '<em>Name</em>'.
* @see org.eclipse.papyrus.customization.properties.generation.fieldselection.PropertyDefinition#getName()
* @see #getPropertyDefinition()
@@ -258,6 +283,7 @@ public interface FieldSelectionPackage extends EPackage {
* Returns the meta object for the attribute '{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.PropertyDefinition#getValueSingle <em>Value Single</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @return the meta object for the attribute '<em>Value Single</em>'.
* @see org.eclipse.papyrus.customization.properties.generation.fieldselection.PropertyDefinition#getValueSingle()
* @see #getPropertyDefinition()
@@ -269,6 +295,7 @@ public interface FieldSelectionPackage extends EPackage {
* Returns the meta object for the attribute '{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.PropertyDefinition#getValueMultiple <em>Value Multiple</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @return the meta object for the attribute '<em>Value Multiple</em>'.
* @see org.eclipse.papyrus.customization.properties.generation.fieldselection.PropertyDefinition#getValueMultiple()
* @see #getPropertyDefinition()
@@ -280,6 +307,7 @@ public interface FieldSelectionPackage extends EPackage {
* Returns the meta object for class '{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.ContextElement <em>Context Element</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @return the meta object for class '<em>Context Element</em>'.
* @see org.eclipse.papyrus.customization.properties.generation.fieldselection.ContextElement
* @generated
@@ -290,6 +318,7 @@ public interface FieldSelectionPackage extends EPackage {
* Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.ContextElement#getElements <em>Elements</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @return the meta object for the containment reference list '<em>Elements</em>'.
* @see org.eclipse.papyrus.customization.properties.generation.fieldselection.ContextElement#getElements()
* @see #getContextElement()
@@ -301,6 +330,7 @@ public interface FieldSelectionPackage extends EPackage {
* Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.ContextElement#getProperties <em>Properties</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @return the meta object for the containment reference list '<em>Properties</em>'.
* @see org.eclipse.papyrus.customization.properties.generation.fieldselection.ContextElement#getProperties()
* @see #getContextElement()
@@ -312,6 +342,7 @@ public interface FieldSelectionPackage extends EPackage {
* Returns the meta object for the attribute '{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.ContextElement#getName <em>Name</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @return the meta object for the attribute '<em>Name</em>'.
* @see org.eclipse.papyrus.customization.properties.generation.fieldselection.ContextElement#getName()
* @see #getContextElement()
@@ -323,6 +354,7 @@ public interface FieldSelectionPackage extends EPackage {
* Returns the meta object for data type '{@link org.eclipse.papyrus.customization.properties.generation.wizard.widget.TernaryButton.State <em>Value</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @return the meta object for data type '<em>Value</em>'.
* @see org.eclipse.papyrus.customization.properties.generation.wizard.widget.TernaryButton.State
* @model instanceClass="org.eclipse.papyrus.customization.properties.generation.wizard.widget.TernaryButton.State"
@@ -334,6 +366,7 @@ public interface FieldSelectionPackage extends EPackage {
* Returns the factory that creates the instances of the model.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @return the factory that creates the instances of the model.
* @generated
*/
@@ -349,6 +382,7 @@ public interface FieldSelectionPackage extends EPackage {
* <li>and each data type</li>
* </ul>
* <!-- end-user-doc -->
+ *
* @generated
*/
interface Literals {
@@ -357,6 +391,7 @@ public interface FieldSelectionPackage extends EPackage {
* The meta object literal for the '{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.impl.FieldSelectionImpl <em>Field Selection</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @see org.eclipse.papyrus.customization.properties.generation.fieldselection.impl.FieldSelectionImpl
* @see org.eclipse.papyrus.customization.properties.generation.fieldselection.impl.FieldSelectionPackageImpl#getFieldSelection()
* @generated
@@ -367,6 +402,7 @@ public interface FieldSelectionPackage extends EPackage {
* The meta object literal for the '<em><b>Fields</b></em>' containment reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
EReference FIELD_SELECTION__FIELDS = eINSTANCE.getFieldSelection_Fields();
@@ -375,6 +411,7 @@ public interface FieldSelectionPackage extends EPackage {
* The meta object literal for the '<em><b>Context Elements</b></em>' containment reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
EReference FIELD_SELECTION__CONTEXT_ELEMENTS = eINSTANCE.getFieldSelection_ContextElements();
@@ -383,6 +420,7 @@ public interface FieldSelectionPackage extends EPackage {
* The meta object literal for the '{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.impl.PropertyDefinitionImpl <em>Property Definition</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @see org.eclipse.papyrus.customization.properties.generation.fieldselection.impl.PropertyDefinitionImpl
* @see org.eclipse.papyrus.customization.properties.generation.fieldselection.impl.FieldSelectionPackageImpl#getPropertyDefinition()
* @generated
@@ -393,6 +431,7 @@ public interface FieldSelectionPackage extends EPackage {
* The meta object literal for the '<em><b>Name</b></em>' attribute feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
EAttribute PROPERTY_DEFINITION__NAME = eINSTANCE.getPropertyDefinition_Name();
@@ -401,6 +440,7 @@ public interface FieldSelectionPackage extends EPackage {
* The meta object literal for the '<em><b>Value Single</b></em>' attribute feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
EAttribute PROPERTY_DEFINITION__VALUE_SINGLE = eINSTANCE.getPropertyDefinition_ValueSingle();
@@ -409,6 +449,7 @@ public interface FieldSelectionPackage extends EPackage {
* The meta object literal for the '<em><b>Value Multiple</b></em>' attribute feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
EAttribute PROPERTY_DEFINITION__VALUE_MULTIPLE = eINSTANCE.getPropertyDefinition_ValueMultiple();
@@ -417,6 +458,7 @@ public interface FieldSelectionPackage extends EPackage {
* The meta object literal for the '{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.impl.ContextElementImpl <em>Context Element</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @see org.eclipse.papyrus.customization.properties.generation.fieldselection.impl.ContextElementImpl
* @see org.eclipse.papyrus.customization.properties.generation.fieldselection.impl.FieldSelectionPackageImpl#getContextElement()
* @generated
@@ -427,6 +469,7 @@ public interface FieldSelectionPackage extends EPackage {
* The meta object literal for the '<em><b>Elements</b></em>' containment reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
EReference CONTEXT_ELEMENT__ELEMENTS = eINSTANCE.getContextElement_Elements();
@@ -435,6 +478,7 @@ public interface FieldSelectionPackage extends EPackage {
* The meta object literal for the '<em><b>Properties</b></em>' containment reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
EReference CONTEXT_ELEMENT__PROPERTIES = eINSTANCE.getContextElement_Properties();
@@ -443,6 +487,7 @@ public interface FieldSelectionPackage extends EPackage {
* The meta object literal for the '<em><b>Name</b></em>' attribute feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
EAttribute CONTEXT_ELEMENT__NAME = eINSTANCE.getContextElement_Name();
@@ -451,6 +496,7 @@ public interface FieldSelectionPackage extends EPackage {
* The meta object literal for the '<em>Value</em>' data type.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @see org.eclipse.papyrus.customization.properties.generation.wizard.widget.TernaryButton.State
* @see org.eclipse.papyrus.customization.properties.generation.fieldselection.impl.FieldSelectionPackageImpl#getValue()
* @generated
@@ -459,4 +505,4 @@ public interface FieldSelectionPackage extends EPackage {
}
-} //FieldSelectionPackage
+} // FieldSelectionPackage
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/PropertyDefinition.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/PropertyDefinition.java
index eee0a1a686b..499f8da30df 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/PropertyDefinition.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/PropertyDefinition.java
@@ -17,9 +17,9 @@ import org.eclipse.papyrus.customization.properties.generation.wizard.widget.Ter
* <p>
* The following features are supported:
* <ul>
- * <li>{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.PropertyDefinition#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.PropertyDefinition#getValueSingle <em>Value Single</em>}</li>
- * <li>{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.PropertyDefinition#getValueMultiple <em>Value Multiple</em>}</li>
+ * <li>{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.PropertyDefinition#getName <em>Name</em>}</li>
+ * <li>{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.PropertyDefinition#getValueSingle <em>Value Single</em>}</li>
+ * <li>{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.PropertyDefinition#getValueMultiple <em>Value Multiple</em>}</li>
* </ul>
* </p>
*
@@ -36,6 +36,7 @@ public interface PropertyDefinition extends EObject {
* If the meaning of the '<em>Name</em>' attribute isn't clear, there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
+ *
* @return the value of the '<em>Name</em>' attribute.
* @see #setName(String)
* @see org.eclipse.papyrus.customization.properties.generation.fieldselection.FieldSelectionPackage#getPropertyDefinition_Name()
@@ -48,7 +49,9 @@ public interface PropertyDefinition extends EObject {
* Sets the value of the '{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.PropertyDefinition#getName <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
+ *
+ * @param value
+ * the new value of the '<em>Name</em>' attribute.
* @see #getName()
* @generated
*/
@@ -62,6 +65,7 @@ public interface PropertyDefinition extends EObject {
* If the meaning of the '<em>Value Single</em>' attribute isn't clear, there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
+ *
* @return the value of the '<em>Value Single</em>' attribute.
* @see #setValueSingle(State)
* @see org.eclipse.papyrus.customization.properties.generation.fieldselection.FieldSelectionPackage#getPropertyDefinition_ValueSingle()
@@ -74,7 +78,9 @@ public interface PropertyDefinition extends EObject {
* Sets the value of the '{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.PropertyDefinition#getValueSingle <em>Value Single</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @param value the new value of the '<em>Value Single</em>' attribute.
+ *
+ * @param value
+ * the new value of the '<em>Value Single</em>' attribute.
* @see #getValueSingle()
* @generated
*/
@@ -88,6 +94,7 @@ public interface PropertyDefinition extends EObject {
* If the meaning of the '<em>Value Multiple</em>' attribute isn't clear, there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
+ *
* @return the value of the '<em>Value Multiple</em>' attribute.
* @see #setValueMultiple(State)
* @see org.eclipse.papyrus.customization.properties.generation.fieldselection.FieldSelectionPackage#getPropertyDefinition_ValueMultiple()
@@ -100,7 +107,9 @@ public interface PropertyDefinition extends EObject {
* Sets the value of the '{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.PropertyDefinition#getValueMultiple <em>Value Multiple</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @param value the new value of the '<em>Value Multiple</em>' attribute.
+ *
+ * @param value
+ * the new value of the '<em>Value Multiple</em>' attribute.
* @see #getValueMultiple()
* @generated
*/
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/impl/ContextElementImpl.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/impl/ContextElementImpl.java
index b7784a2e275..2f4d9149af1 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/impl/ContextElementImpl.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/impl/ContextElementImpl.java
@@ -28,9 +28,9 @@ import org.eclipse.papyrus.customization.properties.generation.fieldselection.Pr
* <p>
* The following features are implemented:
* <ul>
- * <li>{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.impl.ContextElementImpl#getElements <em>Elements</em>}</li>
- * <li>{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.impl.ContextElementImpl#getProperties <em>Properties</em>}</li>
- * <li>{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.impl.ContextElementImpl#getName <em>Name</em>}</li>
+ * <li>{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.impl.ContextElementImpl#getElements <em>Elements</em>}</li>
+ * <li>{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.impl.ContextElementImpl#getProperties <em>Properties</em>}</li>
+ * <li>{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.impl.ContextElementImpl#getName <em>Name</em>}</li>
* </ul>
* </p>
*
@@ -42,6 +42,7 @@ public class ContextElementImpl extends EObjectImpl implements ContextElement {
* The cached value of the '{@link #getElements() <em>Elements</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @see #getElements()
* @generated
* @ordered
@@ -52,6 +53,7 @@ public class ContextElementImpl extends EObjectImpl implements ContextElement {
* The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @see #getProperties()
* @generated
* @ordered
@@ -62,6 +64,7 @@ public class ContextElementImpl extends EObjectImpl implements ContextElement {
* The default value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @see #getName()
* @generated
* @ordered
@@ -72,6 +75,7 @@ public class ContextElementImpl extends EObjectImpl implements ContextElement {
* The cached value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @see #getName()
* @generated
* @ordered
@@ -81,6 +85,7 @@ public class ContextElementImpl extends EObjectImpl implements ContextElement {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
protected ContextElementImpl() {
@@ -90,6 +95,7 @@ public class ContextElementImpl extends EObjectImpl implements ContextElement {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
@Override
@@ -100,6 +106,7 @@ public class ContextElementImpl extends EObjectImpl implements ContextElement {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public EList<ContextElement> getElements() {
@@ -112,6 +119,7 @@ public class ContextElementImpl extends EObjectImpl implements ContextElement {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public EList<PropertyDefinition> getProperties() {
@@ -124,6 +132,7 @@ public class ContextElementImpl extends EObjectImpl implements ContextElement {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public String getName() {
@@ -133,27 +142,30 @@ public class ContextElementImpl extends EObjectImpl implements ContextElement {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public void setName(String newName) {
String oldName = name;
name = newName;
- if (eNotificationRequired())
+ if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, FieldSelectionPackage.CONTEXT_ELEMENT__NAME, oldName, name));
+ }
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
- case FieldSelectionPackage.CONTEXT_ELEMENT__ELEMENTS:
- return ((InternalEList<?>)getElements()).basicRemove(otherEnd, msgs);
- case FieldSelectionPackage.CONTEXT_ELEMENT__PROPERTIES:
- return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
+ case FieldSelectionPackage.CONTEXT_ELEMENT__ELEMENTS:
+ return ((InternalEList<?>) getElements()).basicRemove(otherEnd, msgs);
+ case FieldSelectionPackage.CONTEXT_ELEMENT__PROPERTIES:
+ return ((InternalEList<?>) getProperties()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
@@ -161,17 +173,18 @@ public class ContextElementImpl extends EObjectImpl implements ContextElement {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
- case FieldSelectionPackage.CONTEXT_ELEMENT__ELEMENTS:
- return getElements();
- case FieldSelectionPackage.CONTEXT_ELEMENT__PROPERTIES:
- return getProperties();
- case FieldSelectionPackage.CONTEXT_ELEMENT__NAME:
- return getName();
+ case FieldSelectionPackage.CONTEXT_ELEMENT__ELEMENTS:
+ return getElements();
+ case FieldSelectionPackage.CONTEXT_ELEMENT__PROPERTIES:
+ return getProperties();
+ case FieldSelectionPackage.CONTEXT_ELEMENT__NAME:
+ return getName();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -179,23 +192,24 @@ public class ContextElementImpl extends EObjectImpl implements ContextElement {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
- case FieldSelectionPackage.CONTEXT_ELEMENT__ELEMENTS:
- getElements().clear();
- getElements().addAll((Collection<? extends ContextElement>)newValue);
- return;
- case FieldSelectionPackage.CONTEXT_ELEMENT__PROPERTIES:
- getProperties().clear();
- getProperties().addAll((Collection<? extends PropertyDefinition>)newValue);
- return;
- case FieldSelectionPackage.CONTEXT_ELEMENT__NAME:
- setName((String)newValue);
- return;
+ case FieldSelectionPackage.CONTEXT_ELEMENT__ELEMENTS:
+ getElements().clear();
+ getElements().addAll((Collection<? extends ContextElement>) newValue);
+ return;
+ case FieldSelectionPackage.CONTEXT_ELEMENT__PROPERTIES:
+ getProperties().clear();
+ getProperties().addAll((Collection<? extends PropertyDefinition>) newValue);
+ return;
+ case FieldSelectionPackage.CONTEXT_ELEMENT__NAME:
+ setName((String) newValue);
+ return;
}
super.eSet(featureID, newValue);
}
@@ -203,20 +217,21 @@ public class ContextElementImpl extends EObjectImpl implements ContextElement {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
- case FieldSelectionPackage.CONTEXT_ELEMENT__ELEMENTS:
- getElements().clear();
- return;
- case FieldSelectionPackage.CONTEXT_ELEMENT__PROPERTIES:
- getProperties().clear();
- return;
- case FieldSelectionPackage.CONTEXT_ELEMENT__NAME:
- setName(NAME_EDEFAULT);
- return;
+ case FieldSelectionPackage.CONTEXT_ELEMENT__ELEMENTS:
+ getElements().clear();
+ return;
+ case FieldSelectionPackage.CONTEXT_ELEMENT__PROPERTIES:
+ getProperties().clear();
+ return;
+ case FieldSelectionPackage.CONTEXT_ELEMENT__NAME:
+ setName(NAME_EDEFAULT);
+ return;
}
super.eUnset(featureID);
}
@@ -224,17 +239,18 @@ public class ContextElementImpl extends EObjectImpl implements ContextElement {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
- case FieldSelectionPackage.CONTEXT_ELEMENT__ELEMENTS:
- return elements != null && !elements.isEmpty();
- case FieldSelectionPackage.CONTEXT_ELEMENT__PROPERTIES:
- return properties != null && !properties.isEmpty();
- case FieldSelectionPackage.CONTEXT_ELEMENT__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
+ case FieldSelectionPackage.CONTEXT_ELEMENT__ELEMENTS:
+ return elements != null && !elements.isEmpty();
+ case FieldSelectionPackage.CONTEXT_ELEMENT__PROPERTIES:
+ return properties != null && !properties.isEmpty();
+ case FieldSelectionPackage.CONTEXT_ELEMENT__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
}
return super.eIsSet(featureID);
}
@@ -242,11 +258,14 @@ public class ContextElementImpl extends EObjectImpl implements ContextElement {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
@Override
public String toString() {
- if (eIsProxy()) return super.toString();
+ if (eIsProxy()) {
+ return super.toString();
+ }
StringBuffer result = new StringBuffer(super.toString());
result.append(" (name: ");
@@ -255,4 +274,4 @@ public class ContextElementImpl extends EObjectImpl implements ContextElement {
return result.toString();
}
-} //ContextElementImpl
+} // ContextElementImpl
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/impl/FieldSelectionFactoryImpl.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/impl/FieldSelectionFactoryImpl.java
index b50ec82357b..3f31b0f8904 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/impl/FieldSelectionFactoryImpl.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/impl/FieldSelectionFactoryImpl.java
@@ -24,6 +24,7 @@ import org.eclipse.papyrus.customization.properties.generation.wizard.widget.Ter
* <!-- begin-user-doc -->
* An implementation of the model <b>Factory</b>.
* <!-- end-user-doc -->
+ *
* @generated
*/
public class FieldSelectionFactoryImpl extends EFactoryImpl implements FieldSelectionFactory {
@@ -32,16 +33,16 @@ public class FieldSelectionFactoryImpl extends EFactoryImpl implements FieldSele
* Creates the default factory implementation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public static FieldSelectionFactory init() {
try {
- FieldSelectionFactory theFieldSelectionFactory = (FieldSelectionFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.eclipse.org/papyrus/properties/fieldSelection");
+ FieldSelectionFactory theFieldSelectionFactory = (FieldSelectionFactory) EPackage.Registry.INSTANCE.getEFactory("http://www.eclipse.org/papyrus/properties/fieldSelection");
if (theFieldSelectionFactory != null) {
return theFieldSelectionFactory;
}
- }
- catch (Exception exception) {
+ } catch (Exception exception) {
EcorePlugin.INSTANCE.log(exception);
}
return new FieldSelectionFactoryImpl();
@@ -51,6 +52,7 @@ public class FieldSelectionFactoryImpl extends EFactoryImpl implements FieldSele
* Creates an instance of the factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public FieldSelectionFactoryImpl() {
@@ -60,52 +62,59 @@ public class FieldSelectionFactoryImpl extends EFactoryImpl implements FieldSele
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
@Override
public EObject create(EClass eClass) {
switch (eClass.getClassifierID()) {
- case FieldSelectionPackage.FIELD_SELECTION: return createFieldSelection();
- case FieldSelectionPackage.PROPERTY_DEFINITION: return createPropertyDefinition();
- case FieldSelectionPackage.CONTEXT_ELEMENT: return createContextElement();
- default:
- throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
+ case FieldSelectionPackage.FIELD_SELECTION:
+ return createFieldSelection();
+ case FieldSelectionPackage.PROPERTY_DEFINITION:
+ return createPropertyDefinition();
+ case FieldSelectionPackage.CONTEXT_ELEMENT:
+ return createContextElement();
+ default:
+ throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
@Override
public Object createFromString(EDataType eDataType, String initialValue) {
switch (eDataType.getClassifierID()) {
- case FieldSelectionPackage.VALUE:
- return createValueFromString(eDataType, initialValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
+ case FieldSelectionPackage.VALUE:
+ return createValueFromString(eDataType, initialValue);
+ default:
+ throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
@Override
public String convertToString(EDataType eDataType, Object instanceValue) {
switch (eDataType.getClassifierID()) {
- case FieldSelectionPackage.VALUE:
- return convertValueToString(eDataType, instanceValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
+ case FieldSelectionPackage.VALUE:
+ return convertValueToString(eDataType, instanceValue);
+ default:
+ throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public FieldSelection createFieldSelection() {
@@ -116,6 +125,7 @@ public class FieldSelectionFactoryImpl extends EFactoryImpl implements FieldSele
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public PropertyDefinition createPropertyDefinition() {
@@ -126,6 +136,7 @@ public class FieldSelectionFactoryImpl extends EFactoryImpl implements FieldSele
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public ContextElement createContextElement() {
@@ -136,15 +147,17 @@ public class FieldSelectionFactoryImpl extends EFactoryImpl implements FieldSele
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public State createValueFromString(EDataType eDataType, String initialValue) {
- return (State)super.createFromString(eDataType, initialValue);
+ return (State) super.createFromString(eDataType, initialValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public String convertValueToString(EDataType eDataType, Object instanceValue) {
@@ -154,15 +167,17 @@ public class FieldSelectionFactoryImpl extends EFactoryImpl implements FieldSele
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public FieldSelectionPackage getFieldSelectionPackage() {
- return (FieldSelectionPackage)getEPackage();
+ return (FieldSelectionPackage) getEPackage();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @deprecated
* @generated
*/
@@ -171,4 +186,4 @@ public class FieldSelectionFactoryImpl extends EFactoryImpl implements FieldSele
return FieldSelectionPackage.eINSTANCE;
}
-} //FieldSelectionFactoryImpl
+} // FieldSelectionFactoryImpl
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/impl/FieldSelectionImpl.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/impl/FieldSelectionImpl.java
index d17bb45e72d..0de6551bf86 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/impl/FieldSelectionImpl.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/impl/FieldSelectionImpl.java
@@ -27,8 +27,8 @@ import org.eclipse.papyrus.customization.properties.generation.fieldselection.Pr
* <p>
* The following features are implemented:
* <ul>
- * <li>{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.impl.FieldSelectionImpl#getFields <em>Fields</em>}</li>
- * <li>{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.impl.FieldSelectionImpl#getContextElements <em>Context Elements</em>}</li>
+ * <li>{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.impl.FieldSelectionImpl#getFields <em>Fields</em>}</li>
+ * <li>{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.impl.FieldSelectionImpl#getContextElements <em>Context Elements</em>}</li>
* </ul>
* </p>
*
@@ -40,6 +40,7 @@ public class FieldSelectionImpl extends EObjectImpl implements FieldSelection {
* The cached value of the '{@link #getFields() <em>Fields</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @see #getFields()
* @generated
* @ordered
@@ -50,6 +51,7 @@ public class FieldSelectionImpl extends EObjectImpl implements FieldSelection {
* The cached value of the '{@link #getContextElements() <em>Context Elements</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @see #getContextElements()
* @generated
* @ordered
@@ -59,6 +61,7 @@ public class FieldSelectionImpl extends EObjectImpl implements FieldSelection {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
protected FieldSelectionImpl() {
@@ -68,6 +71,7 @@ public class FieldSelectionImpl extends EObjectImpl implements FieldSelection {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
@Override
@@ -78,6 +82,7 @@ public class FieldSelectionImpl extends EObjectImpl implements FieldSelection {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public EList<PropertyDefinition> getFields() {
@@ -90,6 +95,7 @@ public class FieldSelectionImpl extends EObjectImpl implements FieldSelection {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public EList<ContextElement> getContextElements() {
@@ -102,15 +108,16 @@ public class FieldSelectionImpl extends EObjectImpl implements FieldSelection {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
- case FieldSelectionPackage.FIELD_SELECTION__FIELDS:
- return ((InternalEList<?>)getFields()).basicRemove(otherEnd, msgs);
- case FieldSelectionPackage.FIELD_SELECTION__CONTEXT_ELEMENTS:
- return ((InternalEList<?>)getContextElements()).basicRemove(otherEnd, msgs);
+ case FieldSelectionPackage.FIELD_SELECTION__FIELDS:
+ return ((InternalEList<?>) getFields()).basicRemove(otherEnd, msgs);
+ case FieldSelectionPackage.FIELD_SELECTION__CONTEXT_ELEMENTS:
+ return ((InternalEList<?>) getContextElements()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
@@ -118,15 +125,16 @@ public class FieldSelectionImpl extends EObjectImpl implements FieldSelection {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
- case FieldSelectionPackage.FIELD_SELECTION__FIELDS:
- return getFields();
- case FieldSelectionPackage.FIELD_SELECTION__CONTEXT_ELEMENTS:
- return getContextElements();
+ case FieldSelectionPackage.FIELD_SELECTION__FIELDS:
+ return getFields();
+ case FieldSelectionPackage.FIELD_SELECTION__CONTEXT_ELEMENTS:
+ return getContextElements();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -134,20 +142,21 @@ public class FieldSelectionImpl extends EObjectImpl implements FieldSelection {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
- case FieldSelectionPackage.FIELD_SELECTION__FIELDS:
- getFields().clear();
- getFields().addAll((Collection<? extends PropertyDefinition>)newValue);
- return;
- case FieldSelectionPackage.FIELD_SELECTION__CONTEXT_ELEMENTS:
- getContextElements().clear();
- getContextElements().addAll((Collection<? extends ContextElement>)newValue);
- return;
+ case FieldSelectionPackage.FIELD_SELECTION__FIELDS:
+ getFields().clear();
+ getFields().addAll((Collection<? extends PropertyDefinition>) newValue);
+ return;
+ case FieldSelectionPackage.FIELD_SELECTION__CONTEXT_ELEMENTS:
+ getContextElements().clear();
+ getContextElements().addAll((Collection<? extends ContextElement>) newValue);
+ return;
}
super.eSet(featureID, newValue);
}
@@ -155,17 +164,18 @@ public class FieldSelectionImpl extends EObjectImpl implements FieldSelection {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
- case FieldSelectionPackage.FIELD_SELECTION__FIELDS:
- getFields().clear();
- return;
- case FieldSelectionPackage.FIELD_SELECTION__CONTEXT_ELEMENTS:
- getContextElements().clear();
- return;
+ case FieldSelectionPackage.FIELD_SELECTION__FIELDS:
+ getFields().clear();
+ return;
+ case FieldSelectionPackage.FIELD_SELECTION__CONTEXT_ELEMENTS:
+ getContextElements().clear();
+ return;
}
super.eUnset(featureID);
}
@@ -173,17 +183,18 @@ public class FieldSelectionImpl extends EObjectImpl implements FieldSelection {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
- case FieldSelectionPackage.FIELD_SELECTION__FIELDS:
- return fields != null && !fields.isEmpty();
- case FieldSelectionPackage.FIELD_SELECTION__CONTEXT_ELEMENTS:
- return contextElements != null && !contextElements.isEmpty();
+ case FieldSelectionPackage.FIELD_SELECTION__FIELDS:
+ return fields != null && !fields.isEmpty();
+ case FieldSelectionPackage.FIELD_SELECTION__CONTEXT_ELEMENTS:
+ return contextElements != null && !contextElements.isEmpty();
}
return super.eIsSet(featureID);
}
-} //FieldSelectionImpl
+} // FieldSelectionImpl
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/impl/FieldSelectionPackageImpl.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/impl/FieldSelectionPackageImpl.java
index e7d47b0e850..9f855d71590 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/impl/FieldSelectionPackageImpl.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/impl/FieldSelectionPackageImpl.java
@@ -24,6 +24,7 @@ import org.eclipse.papyrus.customization.properties.generation.wizard.widget.Ter
* <!-- begin-user-doc -->
* An implementation of the model <b>Package</b>.
* <!-- end-user-doc -->
+ *
* @generated
*/
public class FieldSelectionPackageImpl extends EPackageImpl implements FieldSelectionPackage {
@@ -31,6 +32,7 @@ public class FieldSelectionPackageImpl extends EPackageImpl implements FieldSele
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
private EClass fieldSelectionEClass = null;
@@ -38,6 +40,7 @@ public class FieldSelectionPackageImpl extends EPackageImpl implements FieldSele
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
private EClass propertyDefinitionEClass = null;
@@ -45,6 +48,7 @@ public class FieldSelectionPackageImpl extends EPackageImpl implements FieldSele
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
private EClass contextElementEClass = null;
@@ -52,19 +56,17 @@ public class FieldSelectionPackageImpl extends EPackageImpl implements FieldSele
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
private EDataType valueEDataType = null;
/**
- * Creates an instance of the model <b>Package</b>, registered with
- * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
+ * Creates an instance of the model <b>Package</b>, registered with {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
* package URI value.
- * <p>Note: the correct way to create the package is via the static
- * factory method {@link #init init()}, which also performs
- * initialization of the package, or returns the registered package,
- * if one already exists.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <p>
+ * Note: the correct way to create the package is via the static factory method {@link #init init()}, which also performs initialization of the package, or returns the registered package, if one already exists. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
* @see org.eclipse.emf.ecore.EPackage.Registry
* @see org.eclipse.papyrus.customization.properties.generation.fieldselection.FieldSelectionPackage#eNS_URI
* @see #init()
@@ -77,26 +79,30 @@ public class FieldSelectionPackageImpl extends EPackageImpl implements FieldSele
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
private static boolean isInited = false;
/**
* Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
+ *
+ * <p>
+ * This method is used to initialize {@link FieldSelectionPackage#eINSTANCE} when that field is accessed. Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
*
- * <p>This method is used to initialize {@link FieldSelectionPackage#eINSTANCE} when that field is accessed.
- * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
* @see #eNS_URI
* @see #createPackageContents()
* @see #initializePackageContents()
* @generated
*/
public static FieldSelectionPackage init() {
- if (isInited) return (FieldSelectionPackage)EPackage.Registry.INSTANCE.getEPackage(FieldSelectionPackage.eNS_URI);
+ if (isInited) {
+ return (FieldSelectionPackage) EPackage.Registry.INSTANCE.getEPackage(FieldSelectionPackage.eNS_URI);
+ }
// Obtain or create and register package
- FieldSelectionPackageImpl theFieldSelectionPackage = (FieldSelectionPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof FieldSelectionPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new FieldSelectionPackageImpl());
+ FieldSelectionPackageImpl theFieldSelectionPackage = (FieldSelectionPackageImpl) (EPackage.Registry.INSTANCE.get(eNS_URI) instanceof FieldSelectionPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new FieldSelectionPackageImpl());
isInited = true;
@@ -109,7 +115,7 @@ public class FieldSelectionPackageImpl extends EPackageImpl implements FieldSele
// Mark meta-data to indicate it can't be changed
theFieldSelectionPackage.freeze();
-
+
// Update the registry and return the package
EPackage.Registry.INSTANCE.put(FieldSelectionPackage.eNS_URI, theFieldSelectionPackage);
return theFieldSelectionPackage;
@@ -118,6 +124,7 @@ public class FieldSelectionPackageImpl extends EPackageImpl implements FieldSele
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public EClass getFieldSelection() {
@@ -127,24 +134,27 @@ public class FieldSelectionPackageImpl extends EPackageImpl implements FieldSele
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public EReference getFieldSelection_Fields() {
- return (EReference)fieldSelectionEClass.getEStructuralFeatures().get(0);
+ return (EReference) fieldSelectionEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public EReference getFieldSelection_ContextElements() {
- return (EReference)fieldSelectionEClass.getEStructuralFeatures().get(1);
+ return (EReference) fieldSelectionEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public EClass getPropertyDefinition() {
@@ -154,33 +164,37 @@ public class FieldSelectionPackageImpl extends EPackageImpl implements FieldSele
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public EAttribute getPropertyDefinition_Name() {
- return (EAttribute)propertyDefinitionEClass.getEStructuralFeatures().get(0);
+ return (EAttribute) propertyDefinitionEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public EAttribute getPropertyDefinition_ValueSingle() {
- return (EAttribute)propertyDefinitionEClass.getEStructuralFeatures().get(1);
+ return (EAttribute) propertyDefinitionEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public EAttribute getPropertyDefinition_ValueMultiple() {
- return (EAttribute)propertyDefinitionEClass.getEStructuralFeatures().get(2);
+ return (EAttribute) propertyDefinitionEClass.getEStructuralFeatures().get(2);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public EClass getContextElement() {
@@ -190,33 +204,37 @@ public class FieldSelectionPackageImpl extends EPackageImpl implements FieldSele
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public EReference getContextElement_Elements() {
- return (EReference)contextElementEClass.getEStructuralFeatures().get(0);
+ return (EReference) contextElementEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public EReference getContextElement_Properties() {
- return (EReference)contextElementEClass.getEStructuralFeatures().get(1);
+ return (EReference) contextElementEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public EAttribute getContextElement_Name() {
- return (EAttribute)contextElementEClass.getEStructuralFeatures().get(2);
+ return (EAttribute) contextElementEClass.getEStructuralFeatures().get(2);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public EDataType getValue() {
@@ -226,28 +244,33 @@ public class FieldSelectionPackageImpl extends EPackageImpl implements FieldSele
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public FieldSelectionFactory getFieldSelectionFactory() {
- return (FieldSelectionFactory)getEFactoryInstance();
+ return (FieldSelectionFactory) getEFactoryInstance();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
private boolean isCreated = false;
/**
- * Creates the meta-model objects for the package. This method is
+ * Creates the meta-model objects for the package. This method is
* guarded to have no affect on any invocation but its first.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public void createPackageContents() {
- if (isCreated) return;
+ if (isCreated) {
+ return;
+ }
isCreated = true;
// Create classes and their features
@@ -272,19 +295,23 @@ public class FieldSelectionPackageImpl extends EPackageImpl implements FieldSele
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
private boolean isInitialized = false;
/**
- * Complete the initialization of the package and its meta-model. This
+ * Complete the initialization of the package and its meta-model. This
* method is guarded to have no affect on any invocation but its first.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public void initializePackageContents() {
- if (isInitialized) return;
+ if (isInitialized) {
+ return;
+ }
isInitialized = true;
// Initialize package
@@ -300,8 +327,10 @@ public class FieldSelectionPackageImpl extends EPackageImpl implements FieldSele
// Initialize classes and features; add operations and parameters
initEClass(fieldSelectionEClass, FieldSelection.class, "FieldSelection", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getFieldSelection_Fields(), this.getPropertyDefinition(), null, "fields", null, 0, -1, FieldSelection.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getFieldSelection_ContextElements(), this.getContextElement(), null, "contextElements", null, 0, -1, FieldSelection.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getFieldSelection_Fields(), this.getPropertyDefinition(), null, "fields", null, 0, -1, FieldSelection.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED,
+ IS_ORDERED);
+ initEReference(getFieldSelection_ContextElements(), this.getContextElement(), null, "contextElements", null, 0, -1, FieldSelection.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
+ !IS_DERIVED, IS_ORDERED);
initEClass(propertyDefinitionEClass, PropertyDefinition.class, "PropertyDefinition", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getPropertyDefinition_Name(), ecorePackage.getEString(), "name", null, 1, 1, PropertyDefinition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
@@ -309,8 +338,10 @@ public class FieldSelectionPackageImpl extends EPackageImpl implements FieldSele
initEAttribute(getPropertyDefinition_ValueMultiple(), this.getValue(), "valueMultiple", "DEFAULT", 1, 1, PropertyDefinition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(contextElementEClass, ContextElement.class, "ContextElement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getContextElement_Elements(), this.getContextElement(), null, "elements", null, 0, -1, ContextElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getContextElement_Properties(), this.getPropertyDefinition(), null, "properties", null, 0, -1, ContextElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getContextElement_Elements(), this.getContextElement(), null, "elements", null, 0, -1, ContextElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED,
+ IS_ORDERED);
+ initEReference(getContextElement_Properties(), this.getPropertyDefinition(), null, "properties", null, 0, -1, ContextElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED,
+ IS_ORDERED);
initEAttribute(getContextElement_Name(), ecorePackage.getEString(), "name", null, 1, 1, ContextElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
// Initialize data types
@@ -320,4 +351,4 @@ public class FieldSelectionPackageImpl extends EPackageImpl implements FieldSele
createResource(eNS_URI);
}
-} //FieldSelectionPackageImpl
+} // FieldSelectionPackageImpl
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/impl/PropertyDefinitionImpl.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/impl/PropertyDefinitionImpl.java
index 754e3aff874..9bead7b1bef 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/impl/PropertyDefinitionImpl.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/impl/PropertyDefinitionImpl.java
@@ -23,9 +23,9 @@ import org.eclipse.papyrus.customization.properties.generation.wizard.widget.Ter
* <p>
* The following features are implemented:
* <ul>
- * <li>{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.impl.PropertyDefinitionImpl#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.impl.PropertyDefinitionImpl#getValueSingle <em>Value Single</em>}</li>
- * <li>{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.impl.PropertyDefinitionImpl#getValueMultiple <em>Value Multiple</em>}</li>
+ * <li>{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.impl.PropertyDefinitionImpl#getName <em>Name</em>}</li>
+ * <li>{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.impl.PropertyDefinitionImpl#getValueSingle <em>Value Single</em>}</li>
+ * <li>{@link org.eclipse.papyrus.customization.properties.generation.fieldselection.impl.PropertyDefinitionImpl#getValueMultiple <em>Value Multiple</em>}</li>
* </ul>
* </p>
*
@@ -37,6 +37,7 @@ public class PropertyDefinitionImpl extends EObjectImpl implements PropertyDefin
* The default value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @see #getName()
* @generated
* @ordered
@@ -47,6 +48,7 @@ public class PropertyDefinitionImpl extends EObjectImpl implements PropertyDefin
* The cached value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @see #getName()
* @generated
* @ordered
@@ -57,16 +59,18 @@ public class PropertyDefinitionImpl extends EObjectImpl implements PropertyDefin
* The default value of the '{@link #getValueSingle() <em>Value Single</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @see #getValueSingle()
* @generated
* @ordered
*/
- protected static final State VALUE_SINGLE_EDEFAULT = (State)FieldSelectionFactory.eINSTANCE.createFromString(FieldSelectionPackage.eINSTANCE.getValue(), "DEFAULT");
+ protected static final State VALUE_SINGLE_EDEFAULT = (State) FieldSelectionFactory.eINSTANCE.createFromString(FieldSelectionPackage.eINSTANCE.getValue(), "DEFAULT");
/**
* The cached value of the '{@link #getValueSingle() <em>Value Single</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @see #getValueSingle()
* @generated
* @ordered
@@ -77,16 +81,18 @@ public class PropertyDefinitionImpl extends EObjectImpl implements PropertyDefin
* The default value of the '{@link #getValueMultiple() <em>Value Multiple</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @see #getValueMultiple()
* @generated
* @ordered
*/
- protected static final State VALUE_MULTIPLE_EDEFAULT = (State)FieldSelectionFactory.eINSTANCE.createFromString(FieldSelectionPackage.eINSTANCE.getValue(), "DEFAULT");
+ protected static final State VALUE_MULTIPLE_EDEFAULT = (State) FieldSelectionFactory.eINSTANCE.createFromString(FieldSelectionPackage.eINSTANCE.getValue(), "DEFAULT");
/**
* The cached value of the '{@link #getValueMultiple() <em>Value Multiple</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @see #getValueMultiple()
* @generated
* @ordered
@@ -96,6 +102,7 @@ public class PropertyDefinitionImpl extends EObjectImpl implements PropertyDefin
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
protected PropertyDefinitionImpl() {
@@ -105,6 +112,7 @@ public class PropertyDefinitionImpl extends EObjectImpl implements PropertyDefin
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
@Override
@@ -115,6 +123,7 @@ public class PropertyDefinitionImpl extends EObjectImpl implements PropertyDefin
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public String getName() {
@@ -124,18 +133,21 @@ public class PropertyDefinitionImpl extends EObjectImpl implements PropertyDefin
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public void setName(String newName) {
String oldName = name;
name = newName;
- if (eNotificationRequired())
+ if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, FieldSelectionPackage.PROPERTY_DEFINITION__NAME, oldName, name));
+ }
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public State getValueSingle() {
@@ -145,18 +157,21 @@ public class PropertyDefinitionImpl extends EObjectImpl implements PropertyDefin
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public void setValueSingle(State newValueSingle) {
State oldValueSingle = valueSingle;
valueSingle = newValueSingle;
- if (eNotificationRequired())
+ if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, FieldSelectionPackage.PROPERTY_DEFINITION__VALUE_SINGLE, oldValueSingle, valueSingle));
+ }
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public State getValueMultiple() {
@@ -166,29 +181,32 @@ public class PropertyDefinitionImpl extends EObjectImpl implements PropertyDefin
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public void setValueMultiple(State newValueMultiple) {
State oldValueMultiple = valueMultiple;
valueMultiple = newValueMultiple;
- if (eNotificationRequired())
+ if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, FieldSelectionPackage.PROPERTY_DEFINITION__VALUE_MULTIPLE, oldValueMultiple, valueMultiple));
+ }
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
- case FieldSelectionPackage.PROPERTY_DEFINITION__NAME:
- return getName();
- case FieldSelectionPackage.PROPERTY_DEFINITION__VALUE_SINGLE:
- return getValueSingle();
- case FieldSelectionPackage.PROPERTY_DEFINITION__VALUE_MULTIPLE:
- return getValueMultiple();
+ case FieldSelectionPackage.PROPERTY_DEFINITION__NAME:
+ return getName();
+ case FieldSelectionPackage.PROPERTY_DEFINITION__VALUE_SINGLE:
+ return getValueSingle();
+ case FieldSelectionPackage.PROPERTY_DEFINITION__VALUE_MULTIPLE:
+ return getValueMultiple();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -196,20 +214,21 @@ public class PropertyDefinitionImpl extends EObjectImpl implements PropertyDefin
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
- case FieldSelectionPackage.PROPERTY_DEFINITION__NAME:
- setName((String)newValue);
- return;
- case FieldSelectionPackage.PROPERTY_DEFINITION__VALUE_SINGLE:
- setValueSingle((State)newValue);
- return;
- case FieldSelectionPackage.PROPERTY_DEFINITION__VALUE_MULTIPLE:
- setValueMultiple((State)newValue);
- return;
+ case FieldSelectionPackage.PROPERTY_DEFINITION__NAME:
+ setName((String) newValue);
+ return;
+ case FieldSelectionPackage.PROPERTY_DEFINITION__VALUE_SINGLE:
+ setValueSingle((State) newValue);
+ return;
+ case FieldSelectionPackage.PROPERTY_DEFINITION__VALUE_MULTIPLE:
+ setValueMultiple((State) newValue);
+ return;
}
super.eSet(featureID, newValue);
}
@@ -217,20 +236,21 @@ public class PropertyDefinitionImpl extends EObjectImpl implements PropertyDefin
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
- case FieldSelectionPackage.PROPERTY_DEFINITION__NAME:
- setName(NAME_EDEFAULT);
- return;
- case FieldSelectionPackage.PROPERTY_DEFINITION__VALUE_SINGLE:
- setValueSingle(VALUE_SINGLE_EDEFAULT);
- return;
- case FieldSelectionPackage.PROPERTY_DEFINITION__VALUE_MULTIPLE:
- setValueMultiple(VALUE_MULTIPLE_EDEFAULT);
- return;
+ case FieldSelectionPackage.PROPERTY_DEFINITION__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ case FieldSelectionPackage.PROPERTY_DEFINITION__VALUE_SINGLE:
+ setValueSingle(VALUE_SINGLE_EDEFAULT);
+ return;
+ case FieldSelectionPackage.PROPERTY_DEFINITION__VALUE_MULTIPLE:
+ setValueMultiple(VALUE_MULTIPLE_EDEFAULT);
+ return;
}
super.eUnset(featureID);
}
@@ -238,17 +258,18 @@ public class PropertyDefinitionImpl extends EObjectImpl implements PropertyDefin
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
- case FieldSelectionPackage.PROPERTY_DEFINITION__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case FieldSelectionPackage.PROPERTY_DEFINITION__VALUE_SINGLE:
- return VALUE_SINGLE_EDEFAULT == null ? valueSingle != null : !VALUE_SINGLE_EDEFAULT.equals(valueSingle);
- case FieldSelectionPackage.PROPERTY_DEFINITION__VALUE_MULTIPLE:
- return VALUE_MULTIPLE_EDEFAULT == null ? valueMultiple != null : !VALUE_MULTIPLE_EDEFAULT.equals(valueMultiple);
+ case FieldSelectionPackage.PROPERTY_DEFINITION__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
+ case FieldSelectionPackage.PROPERTY_DEFINITION__VALUE_SINGLE:
+ return VALUE_SINGLE_EDEFAULT == null ? valueSingle != null : !VALUE_SINGLE_EDEFAULT.equals(valueSingle);
+ case FieldSelectionPackage.PROPERTY_DEFINITION__VALUE_MULTIPLE:
+ return VALUE_MULTIPLE_EDEFAULT == null ? valueMultiple != null : !VALUE_MULTIPLE_EDEFAULT.equals(valueMultiple);
}
return super.eIsSet(featureID);
}
@@ -256,11 +277,14 @@ public class PropertyDefinitionImpl extends EObjectImpl implements PropertyDefin
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
@Override
public String toString() {
- if (eIsProxy()) return super.toString();
+ if (eIsProxy()) {
+ return super.toString();
+ }
StringBuffer result = new StringBuffer(super.toString());
result.append(" (name: ");
@@ -273,4 +297,4 @@ public class PropertyDefinitionImpl extends EObjectImpl implements PropertyDefin
return result.toString();
}
-} //PropertyDefinitionImpl
+} // PropertyDefinitionImpl
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/util/FieldSelectionAdapterFactory.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/util/FieldSelectionAdapterFactory.java
index 9204c24e039..c7cf1b7908e 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/util/FieldSelectionAdapterFactory.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/util/FieldSelectionAdapterFactory.java
@@ -20,6 +20,7 @@ import org.eclipse.papyrus.customization.properties.generation.fieldselection.Pr
* The <b>Adapter Factory</b> for the model.
* It provides an adapter <code>createXXX</code> method for each class of the model.
* <!-- end-user-doc -->
+ *
* @see org.eclipse.papyrus.customization.properties.generation.fieldselection.FieldSelectionPackage
* @generated
*/
@@ -29,6 +30,7 @@ public class FieldSelectionAdapterFactory extends AdapterFactoryImpl {
* The cached model package.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
protected static FieldSelectionPackage modelPackage;
@@ -37,6 +39,7 @@ public class FieldSelectionAdapterFactory extends AdapterFactoryImpl {
* Creates an instance of the adapter factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public FieldSelectionAdapterFactory() {
@@ -50,6 +53,7 @@ public class FieldSelectionAdapterFactory extends AdapterFactoryImpl {
* <!-- begin-user-doc -->
* This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
* <!-- end-user-doc -->
+ *
* @return whether this factory is applicable for the type of the object.
* @generated
*/
@@ -59,7 +63,7 @@ public class FieldSelectionAdapterFactory extends AdapterFactoryImpl {
return true;
}
if (object instanceof EObject) {
- return ((EObject)object).eClass().getEPackage() == modelPackage;
+ return ((EObject) object).eClass().getEPackage() == modelPackage;
}
return false;
}
@@ -68,38 +72,44 @@ public class FieldSelectionAdapterFactory extends AdapterFactoryImpl {
* The switch that delegates to the <code>createXXX</code> methods.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
protected FieldSelectionSwitch<Adapter> modelSwitch = new FieldSelectionSwitch<Adapter>() {
- @Override
- public Adapter caseFieldSelection(FieldSelection object) {
- return createFieldSelectionAdapter();
- }
- @Override
- public Adapter casePropertyDefinition(PropertyDefinition object) {
- return createPropertyDefinitionAdapter();
- }
- @Override
- public Adapter caseContextElement(ContextElement object) {
- return createContextElementAdapter();
- }
- @Override
- public Adapter defaultCase(EObject object) {
- return createEObjectAdapter();
- }
- };
+ @Override
+ public Adapter caseFieldSelection(FieldSelection object) {
+ return createFieldSelectionAdapter();
+ }
+
+ @Override
+ public Adapter casePropertyDefinition(PropertyDefinition object) {
+ return createPropertyDefinitionAdapter();
+ }
+
+ @Override
+ public Adapter caseContextElement(ContextElement object) {
+ return createContextElementAdapter();
+ }
+
+ @Override
+ public Adapter defaultCase(EObject object) {
+ return createEObjectAdapter();
+ }
+ };
/**
* Creates an adapter for the <code>target</code>.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @param target the object to adapt.
+ *
+ * @param target
+ * the object to adapt.
* @return the adapter for the <code>target</code>.
* @generated
*/
@Override
public Adapter createAdapter(Notifier target) {
- return modelSwitch.doSwitch((EObject)target);
+ return modelSwitch.doSwitch((EObject) target);
}
@@ -109,6 +119,7 @@ public class FieldSelectionAdapterFactory extends AdapterFactoryImpl {
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
+ *
* @return the new adapter.
* @see org.eclipse.papyrus.customization.properties.generation.fieldselection.FieldSelection
* @generated
@@ -123,6 +134,7 @@ public class FieldSelectionAdapterFactory extends AdapterFactoryImpl {
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
+ *
* @return the new adapter.
* @see org.eclipse.papyrus.customization.properties.generation.fieldselection.PropertyDefinition
* @generated
@@ -137,6 +149,7 @@ public class FieldSelectionAdapterFactory extends AdapterFactoryImpl {
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
+ *
* @return the new adapter.
* @see org.eclipse.papyrus.customization.properties.generation.fieldselection.ContextElement
* @generated
@@ -150,6 +163,7 @@ public class FieldSelectionAdapterFactory extends AdapterFactoryImpl {
* <!-- begin-user-doc -->
* This default implementation returns null.
* <!-- end-user-doc -->
+ *
* @return the new adapter.
* @generated
*/
@@ -157,4 +171,4 @@ public class FieldSelectionAdapterFactory extends AdapterFactoryImpl {
return null;
}
-} //FieldSelectionAdapterFactory
+} // FieldSelectionAdapterFactory
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/util/FieldSelectionSwitch.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/util/FieldSelectionSwitch.java
index 4eef47e2de0..dda26c2a29d 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/util/FieldSelectionSwitch.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src-gen/org/eclipse/papyrus/customization/properties/generation/fieldselection/util/FieldSelectionSwitch.java
@@ -23,16 +23,18 @@ import org.eclipse.papyrus.customization.properties.generation.fieldselection.Pr
* until a non-null result is returned,
* which is the result of the switch.
* <!-- end-user-doc -->
+ *
* @see org.eclipse.papyrus.customization.properties.generation.fieldselection.FieldSelectionPackage
* @generated
*/
-public class FieldSelectionSwitch<T> extends
-Switch<T> {
+public class FieldSelectionSwitch<T> extends
+ Switch<T> {
/**
* The cached model package
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
protected static FieldSelectionPackage modelPackage;
@@ -41,6 +43,7 @@ Switch<T> {
* Creates an instance of the switch.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @generated
*/
public FieldSelectionSwitch() {
@@ -53,6 +56,7 @@ Switch<T> {
* Checks whether this is a switch for the given package.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @parameter ePackage the package in question.
* @return whether this is a switch for the given package.
* @generated
@@ -66,31 +70,39 @@ Switch<T> {
* Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ *
* @return the first non-null result returned by a <code>caseXXX</code> call.
* @generated
*/
@Override
protected T doSwitch(int classifierID, EObject theEObject) {
switch (classifierID) {
- case FieldSelectionPackage.FIELD_SELECTION: {
- FieldSelection fieldSelection = (FieldSelection)theEObject;
- T result = caseFieldSelection(fieldSelection);
- if (result == null) result = defaultCase(theEObject);
- return result;
+ case FieldSelectionPackage.FIELD_SELECTION: {
+ FieldSelection fieldSelection = (FieldSelection) theEObject;
+ T result = caseFieldSelection(fieldSelection);
+ if (result == null) {
+ result = defaultCase(theEObject);
}
- case FieldSelectionPackage.PROPERTY_DEFINITION: {
- PropertyDefinition propertyDefinition = (PropertyDefinition)theEObject;
- T result = casePropertyDefinition(propertyDefinition);
- if (result == null) result = defaultCase(theEObject);
- return result;
+ return result;
+ }
+ case FieldSelectionPackage.PROPERTY_DEFINITION: {
+ PropertyDefinition propertyDefinition = (PropertyDefinition) theEObject;
+ T result = casePropertyDefinition(propertyDefinition);
+ if (result == null) {
+ result = defaultCase(theEObject);
}
- case FieldSelectionPackage.CONTEXT_ELEMENT: {
- ContextElement contextElement = (ContextElement)theEObject;
- T result = caseContextElement(contextElement);
- if (result == null) result = defaultCase(theEObject);
- return result;
+ return result;
+ }
+ case FieldSelectionPackage.CONTEXT_ELEMENT: {
+ ContextElement contextElement = (ContextElement) theEObject;
+ T result = caseContextElement(contextElement);
+ if (result == null) {
+ result = defaultCase(theEObject);
}
- default: return defaultCase(theEObject);
+ return result;
+ }
+ default:
+ return defaultCase(theEObject);
}
}
@@ -100,7 +112,9 @@ Switch<T> {
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
- * @param object the target of the switch.
+ *
+ * @param object
+ * the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Field Selection</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
@@ -115,7 +129,9 @@ Switch<T> {
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
- * @param object the target of the switch.
+ *
+ * @param object
+ * the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Property Definition</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
@@ -130,7 +146,9 @@ Switch<T> {
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
- * @param object the target of the switch.
+ *
+ * @param object
+ * the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Context Element</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
@@ -145,7 +163,9 @@ Switch<T> {
* This implementation returns null;
* returning a non-null result will terminate the switch, but this is the last case anyway.
* <!-- end-user-doc -->
- * @param object the target of the switch.
+ *
+ * @param object
+ * the target of the switch.
* @return the result of interpreting the object as an instance of '<em>EObject</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject)
* @generated
@@ -155,4 +175,4 @@ Switch<T> {
return null;
}
-} //FieldSelectionSwitch
+} // FieldSelectionSwitch
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/Activator.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/Activator.java
index 078ad73abe4..8b0c4fdf072 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/Activator.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/Activator.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2010 CEA LIST.
- *
+ *
* 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
@@ -50,7 +50,7 @@ public class Activator extends AbstractUIPlugin {
/**
* Returns the shared instance
- *
+ *
* @return the shared instance
*/
public static Activator getDefault() {
@@ -59,9 +59,9 @@ public class Activator extends AbstractUIPlugin {
/**
* Returns the image at the given path from this plugin
- *
+ *
* @param path
- * the path of the image to be displayed
+ * the path of the image to be displayed
* @return The Image at the given location, or null if it couldn't be found
*/
public Image getImage(String path) {
@@ -70,16 +70,16 @@ public class Activator extends AbstractUIPlugin {
/**
* Returns the image descriptor at the given path from this plugin
- *
+ *
* @param path
- * the path of the image to be displayed
+ * the path of the image to be displayed
* @return The Image Descriptor at the given location, or null if it couldn't be found
*/
public ImageDescriptor getImageDescriptor(String path) {
final ImageRegistry registry = getImageRegistry();
String key = PLUGIN_ID + "/" + path; //$NON-NLS-1$
ImageDescriptor descriptor = registry.getDescriptor(key);
- if(descriptor == null) {
+ if (descriptor == null) {
registry.put(key, AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path));
descriptor = registry.getDescriptor(key);
}
@@ -88,11 +88,11 @@ public class Activator extends AbstractUIPlugin {
/**
* Returns the image from the given image descriptor
- *
+ *
* @param pluginId
- * The plugin in which the image is located
+ * The plugin in which the image is located
* @param path
- * The path to the image from the plugin
+ * The path to the image from the plugin
* @return
* The Image at the given location, or null if it couldn't be found
*/
@@ -100,7 +100,7 @@ public class Activator extends AbstractUIPlugin {
final ImageRegistry registry = getImageRegistry();
String key = pluginId + "/" + path; //$NON-NLS-1$
Image image = registry.get(key);
- if(image == null) {
+ if (image == null) {
registry.put(key, AbstractUIPlugin.imageDescriptorFromPlugin(pluginId, path));
image = registry.get(key);
}
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/extensionpoint/GeneratorExtensionPoint.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/extensionpoint/GeneratorExtensionPoint.java
index 5141bdaa53d..8a7a011a201 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/extensionpoint/GeneratorExtensionPoint.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/extensionpoint/GeneratorExtensionPoint.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2010, 2014 CEA LIST 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
@@ -9,7 +9,7 @@
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Christian W. Damus (CEA) - bug 422257
- *
+ *
*****************************************************************************/
package org.eclipse.papyrus.customization.properties.generation.extensionpoint;
@@ -26,7 +26,7 @@ import org.eclipse.papyrus.infra.tools.util.ClassLoaderHelper;
/**
* Handles the extension point org.eclipse.papyrus.customization.properties.generation.generator
* Registers the given Generator to the Property view generation wizard
- *
+ *
* @author Camille Letavernier
*/
public class GeneratorExtensionPoint {
@@ -43,10 +43,10 @@ public class GeneratorExtensionPoint {
IConfigurationElement[] config = Platform.getExtensionRegistry().getConfigurationElementsFor(EXTENSION_ID);
List<IGenerator> generators = new ArrayList<IGenerator>(2);
- for(IConfigurationElement e : config) {
+ for (IConfigurationElement e : config) {
String generatorClassName = e.getAttribute("generator"); //$NON-NLS-1$
IGenerator generator = ClassLoaderHelper.newInstance(generatorClassName, IGenerator.class);
- if(generator == null) {
+ if (generator == null) {
Activator.log.warn("Cannot instantiate the generator : " + generatorClassName); //$NON-NLS-1$
continue;
}
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/extensionpoint/LayoutExtensionPoint.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/extensionpoint/LayoutExtensionPoint.java
index 6ac14193e7c..a04720cdf5e 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/extensionpoint/LayoutExtensionPoint.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/extensionpoint/LayoutExtensionPoint.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2010, 2014 CEA LIST 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
@@ -9,7 +9,7 @@
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Christian W. Damus (CEA) - bug 422257
- *
+ *
*****************************************************************************/
package org.eclipse.papyrus.customization.properties.generation.extensionpoint;
@@ -26,7 +26,7 @@ import org.eclipse.papyrus.infra.tools.util.ClassLoaderHelper;
/**
* Handles the extension point org.eclipse.papyrus.customization.properties.generation.layout
* Registers the given layout Generator to the Property view generation wizard
- *
+ *
* @author Camille Letavernier
*/
public class LayoutExtensionPoint {
@@ -42,10 +42,10 @@ public class LayoutExtensionPoint {
IConfigurationElement[] config = Platform.getExtensionRegistry().getConfigurationElementsFor(EXTENSION_ID);
List<ILayoutGenerator> generators = new ArrayList<ILayoutGenerator>(2);
- for(IConfigurationElement e : config) {
+ for (IConfigurationElement e : config) {
String generatorClassName = e.getAttribute("generator"); //$NON-NLS-1$
ILayoutGenerator generator = ClassLoaderHelper.newInstance(generatorClassName, ILayoutGenerator.class);
- if(generator == null) {
+ if (generator == null) {
Activator.log.warn("Cannot instantiate the layout generator : " + generatorClassName); //$NON-NLS-1$
continue;
}
@@ -54,7 +54,7 @@ public class LayoutExtensionPoint {
this.generators = Collections.unmodifiableList(generators);
}
-
+
public List<ILayoutGenerator> getGenerators() {
return generators;
}
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/AbstractQVTGenerator.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/AbstractQVTGenerator.java
index a1e7e5ca3f5..c2082f9fe1e 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/AbstractQVTGenerator.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/AbstractQVTGenerator.java
@@ -10,7 +10,7 @@
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Thibault Le Ouay t.leouay@sherpa-eng.com - Strategy improvement of generated files
* Christian W. Damus (CEA) - bug 422257
- *
+ *
*****************************************************************************/
package org.eclipse.papyrus.customization.properties.generation.generators;
@@ -66,12 +66,12 @@ public abstract class AbstractQVTGenerator implements IGenerator, Listener {
private Set<Listener> listeners = new HashSet<Listener>();
private int strategy;
-
+
private Collection<ResourceSet> scratchResourceSets;
public List<Context> generate(List<URI> targetURI) {
- switch(strategy) {
+ switch (strategy) {
case 0:
generatedContexts = generateSameFile(targetURI);
break;
@@ -88,8 +88,8 @@ public abstract class AbstractQVTGenerator implements IGenerator, Listener {
}
public void dispose() {
- if(scratchResourceSets != null) {
- for(ResourceSet next : scratchResourceSets) {
+ if (scratchResourceSets != null) {
+ for (ResourceSet next : scratchResourceSets) {
EMFHelper.unload(next);
}
scratchResourceSets = null;
@@ -108,7 +108,7 @@ public abstract class AbstractQVTGenerator implements IGenerator, Listener {
* @return the ModelExtent containing the generated context
*/
protected ModelExtent getOutContextExtent() {
- if(out == null) {
+ if (out == null) {
out = new BasicModelExtent();
}
@@ -124,18 +124,18 @@ public abstract class AbstractQVTGenerator implements IGenerator, Listener {
* Loads the EObject from the given URI.
*
* @param uri
- * The URI from which the EObject is loaded
+ * The URI from which the EObject is loaded
* @return
* The loaded EObject, or null if an error occured
* @throws IOException
- * If the URI isn't a valid EObject
+ * If the URI isn't a valid EObject
*/
protected EObject loadEMFModel(URI uri) throws IOException {
ResourceSet resourceSet = createResourceSet();
try {
Resource resource = resourceSet.getResource(uri, true);
- if(resource != null) {
- if(!resource.getContents().isEmpty()) {
+ if (resource != null) {
+ if (!resource.getContents().isEmpty()) {
return resource.getContents().get(0);
}
}
@@ -145,10 +145,10 @@ public abstract class AbstractQVTGenerator implements IGenerator, Listener {
return null;
}
-
+
protected final ResourceSet createResourceSet() {
ResourceSet result = new ResourceSetImpl();
- if(scratchResourceSets == null) {
+ if (scratchResourceSets == null) {
scratchResourceSets = new ArrayList<ResourceSet>();
}
scratchResourceSets.add(result);
@@ -164,7 +164,7 @@ public abstract class AbstractQVTGenerator implements IGenerator, Listener {
}
public void handleEvent(Event event) {
- for(Listener listener : listeners) {
+ for (Listener listener : listeners) {
listener.handleEvent(event);
}
}
@@ -173,16 +173,16 @@ public abstract class AbstractQVTGenerator implements IGenerator, Listener {
* Return the generated Context from a list of EObjects
*
* @param outObjects
- * The list of EObjects from which the context will be retrieved
+ * The list of EObjects from which the context will be retrieved
* @return
* The main generated context
*/
protected List<Context> getContexts(List<EObject> outObjects) {
List<Context> result = new LinkedList<Context>();
- for(Object objectResult : outObjects) {
- if(objectResult instanceof Context) {
- result.add((Context)objectResult);
+ for (Object objectResult : outObjects) {
+ if (objectResult instanceof Context) {
+ result.add((Context) objectResult);
}
}
@@ -202,7 +202,7 @@ public abstract class AbstractQVTGenerator implements IGenerator, Listener {
TransformationExecutor executor = new TransformationExecutor(transformationURI);
Diagnostic diagnostic = executor.loadTransformation();
- if(diagnostic.getSeverity() != Diagnostic.OK) {
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
Activator.log.warn("Cannot load the transformation : " + transformationURI);
return generatedContexts = null;
}
@@ -215,10 +215,10 @@ public abstract class AbstractQVTGenerator implements IGenerator, Listener {
ExecutionDiagnostic result = executor.execute(context, extents.toArray(new ModelExtent[0]));
- if(result.getSeverity() == org.eclipse.emf.common.util.Diagnostic.OK) {
+ if (result.getSeverity() == org.eclipse.emf.common.util.Diagnostic.OK) {
List<EObject> outObjects = getOutContextExtent().getContents();
Object objectResult = outObjects.get(0);
- if(!(objectResult instanceof Context)) {
+ if (!(objectResult instanceof Context)) {
return null;
}
@@ -246,7 +246,7 @@ public abstract class AbstractQVTGenerator implements IGenerator, Listener {
TransformationExecutor executor = new TransformationExecutor(transformationURI);
Diagnostic diagnostic = executor.loadTransformation();
- if(diagnostic.getSeverity() != Diagnostic.OK) {
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
Activator.log.warn("Cannot load the transformation : " + transformationURI);
return generatedContexts = null;
}
@@ -256,17 +256,17 @@ public abstract class AbstractQVTGenerator implements IGenerator, Listener {
context.setLog(new WriterLog(new OutputStreamWriter(System.out)));
List<Context> temp = new LinkedList<Context>();
- for(int i = 0; i < targetURI.size(); i++) {
+ for (int i = 0; i < targetURI.size(); i++) {
extents = getModelExtents(i);
ExecutionDiagnostic result = executor.execute(context, extents.toArray(new ModelExtent[0]));
- if(result.getSeverity() == org.eclipse.emf.common.util.Diagnostic.OK) {
+ if (result.getSeverity() == org.eclipse.emf.common.util.Diagnostic.OK) {
List<EObject> outObjects = getOutContextExtent().getContents();
Object objectResult = outObjects.get(0);
- if(!(objectResult instanceof Context)) {
+ if (!(objectResult instanceof Context)) {
return null;
}
ResourceSet resourceSet = createResourceSet();
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/EcoreGenerator.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/EcoreGenerator.java
index 6ce5928da4a..f55725e948a 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/EcoreGenerator.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/EcoreGenerator.java
@@ -74,7 +74,7 @@ public class EcoreGenerator extends AbstractQVTGenerator {
sourceLabel.setLayoutData(data);
sourceFileChooser = new FileChooser(root, false);
- sourceFileChooser.setFilterExtensions(new String[]{ "ecore" }); //$NON-NLS-1$
+ sourceFileChooser.setFilterExtensions(new String[] { "ecore" }); //$NON-NLS-1$
sourceFileChooser.addListener(this);
listEPackages = new ArrayList<EPackage>();
@@ -95,21 +95,21 @@ public class EcoreGenerator extends AbstractQVTGenerator {
public boolean isSelectedSingle(Property property) {
EStructuralFeature feature = getFeature(property);
- if(feature == null) {
+ if (feature == null) {
return false;
}
- if(feature.isDerived()) {
+ if (feature.isDerived()) {
return false;
}
- if(!feature.isChangeable()) {
+ if (!feature.isChangeable()) {
return false;
}
- if(feature instanceof EReference) {
- EReference reference = (EReference)feature;
- if(reference.isContainer() || reference.isContainment()) {
+ if (feature instanceof EReference) {
+ EReference reference = (EReference) feature;
+ if (reference.isContainer() || reference.isContainment()) {
return false;
}
}
@@ -130,15 +130,15 @@ public class EcoreGenerator extends AbstractQVTGenerator {
EPackage currentPackage = ecorePackage;
EClassifier classifier = findClassifier(path, currentPackage);
- if(classifier == null) {
+ if (classifier == null) {
return null;
}
- if(!(classifier instanceof EClass)) {
+ if (!(classifier instanceof EClass)) {
return null;
}
- EClass eClass = (EClass)classifier;
+ EClass eClass = (EClass) classifier;
return eClass.getEStructuralFeature(property.getName());
}
@@ -147,20 +147,20 @@ public class EcoreGenerator extends AbstractQVTGenerator {
* EPackage
*
* @param path
- * The list of package and subpackages names, and the classifier
- * name, i.e. the list of segments in the classifier's qualified
- * name
+ * The list of package and subpackages names, and the classifier
+ * name, i.e. the list of segments in the classifier's qualified
+ * name
* @param source
- * The root EPackage in which the classifier should be retrieved
+ * The root EPackage in which the classifier should be retrieved
* @return The corresponding EClassifier, or null if it couldn't be
* retrieved
*/
protected EClassifier findClassifier(List<String> path, EPackage source) {
String qualifier = path.get(0);
EClassifier classifier = source.getEClassifier(qualifier);
- if(classifier == null) {
+ if (classifier == null) {
source = findSubPackage(source, qualifier);
- if(source == null) {
+ if (source == null) {
return null;
}
path.remove(0);
@@ -175,14 +175,14 @@ public class EcoreGenerator extends AbstractQVTGenerator {
* given package
*
* @param currentPackage
- * The EPackage in which the subpackage should be found
+ * The EPackage in which the subpackage should be found
* @param packageName
- * The name of the EPackage to find
+ * The name of the EPackage to find
* @return The corresponding EPackage, or null if it couldn't be found
*/
protected EPackage findSubPackage(EPackage currentPackage, String packageName) {
- for(EPackage pack : currentPackage.getESubpackages()) {
- if(pack.getName().equals(packageName)) {
+ for (EPackage pack : currentPackage.getESubpackages()) {
+ if (pack.getName().equals(packageName)) {
return pack;
}
}
@@ -196,7 +196,7 @@ public class EcoreGenerator extends AbstractQVTGenerator {
private List<String> getPath(DataContextElement element) {
List<String> result;
- if(element.getPackage() == null) {
+ if (element.getPackage() == null) {
result = new LinkedList<String>();
} else {
result = getPath(element.getPackage());
@@ -207,21 +207,21 @@ public class EcoreGenerator extends AbstractQVTGenerator {
}
public boolean isSelectedMultiple(Property property) {
- if(!isSelectedSingle(property)) {
+ if (!isSelectedSingle(property)) {
return false;
}
EStructuralFeature feature = getFeature(property);
- Set<String> validDataTypes = new HashSet<String>(Arrays.asList(new String[]{ "int", "boolean", "float", "double" })); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ Set<String> validDataTypes = new HashSet<String>(Arrays.asList(new String[] { "int", "boolean", "float", "double" })); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- if(feature.getEType() instanceof EDataType) {
- if(validDataTypes.contains(((EDataType)feature.getEType()).getInstanceTypeName())) {
+ if (feature.getEType() instanceof EDataType) {
+ if (validDataTypes.contains(((EDataType) feature.getEType()).getInstanceTypeName())) {
return true;
}
}
- if(feature.getEType() instanceof EEnum) {
+ if (feature.getEType() instanceof EEnum) {
return true;
}
@@ -252,17 +252,17 @@ public class EcoreGenerator extends AbstractQVTGenerator {
PropertiesRoot root = ConfigurationManager.getInstance().getPropertiesRoot();
ModelExtent inRoot = new BasicModelExtent(Collections.singletonList(root));
- if(!listEPackages.isEmpty()) {
+ if (!listEPackages.isEmpty()) {
temp.setContents(listEPackages);
- if(!listEPackages.contains(ecorePackage)) {
- result.add(temp); //if the root package isnt selected
+ if (!listEPackages.contains(ecorePackage)) {
+ result.add(temp); // if the root package isnt selected
} else {
result.add(inPackage);
}
result.add(temp);
} else {
- //Basic Method
+ // Basic Method
result.add(inPackage);
result.add(inPackage);
}
@@ -282,30 +282,30 @@ public class EcoreGenerator extends AbstractQVTGenerator {
URI packageURI = URI.createPlatformResourceURI(sourceFileChooser.getFilePath(), true);
try {
- ecorePackage = (EPackage)loadEMFModel(packageURI);
+ ecorePackage = (EPackage) loadEMFModel(packageURI);
} catch (IOException e) {
// nothing
}
new ArrayList<Object>();
List<Object> listePackage = new ArrayList<Object>();
- if(!listePackage.contains(ecorePackage)) {
+ if (!listePackage.contains(ecorePackage)) {
listePackage.add(ecorePackage);
}
TreeIterator<EObject> tree = ecorePackage.eAllContents();
- while(tree.hasNext()) {
+ while (tree.hasNext()) {
EObject obj = tree.next();
- if(obj instanceof EStructuralFeature) {
- EStructuralFeature feature = (EStructuralFeature)obj;
+ if (obj instanceof EStructuralFeature) {
+ EStructuralFeature feature = (EStructuralFeature) obj;
EClass eClass = feature.getEContainingClass();
- if(eClass != null) {
+ if (eClass != null) {
EClassifier classifier = feature.getEType();
EPackage targetPackage = null;
- if(classifier != null) {
+ if (classifier != null) {
targetPackage = classifier.getEPackage();
}
- if(targetPackage != null) {
- if(!ecorePackage.equals(targetPackage)) {
- if(!listePackage.contains(targetPackage)) {
+ if (targetPackage != null) {
+ if (!ecorePackage.equals(targetPackage)) {
+ if (!listePackage.contains(targetPackage)) {
listePackage.add(targetPackage);
}
@@ -313,12 +313,12 @@ public class EcoreGenerator extends AbstractQVTGenerator {
}
}
}
- if(obj instanceof EClass) {
+ if (obj instanceof EClass) {
- EClass eclass = (EClass)obj;
+ EClass eclass = (EClass) obj;
List<EClass> liste = eclass.getESuperTypes();
- for(EClass item : liste) {
- if(!listePackage.contains(item.getEPackage())) {
+ for (EClass item : liste) {
+ if (!listePackage.contains(item.getEPackage())) {
listePackage.add(item.getEPackage());
}
@@ -332,8 +332,8 @@ public class EcoreGenerator extends AbstractQVTGenerator {
public void addCheckElement(Object obj) {
- if(obj instanceof EPackage) {
- EPackage pack = (EPackage)obj;
+ if (obj instanceof EPackage) {
+ EPackage pack = (EPackage) obj;
listEPackages.add(pack);
}
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/EditContextGenerator.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/EditContextGenerator.java
index 70533dfb552..52e9a1047f3 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/EditContextGenerator.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/EditContextGenerator.java
@@ -10,7 +10,7 @@
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Thibault Le Ouay t.leouay@sherpa-eng.com
* Christian W. Damus (CEA) - bug 422257
- *
+ *
*****************************************************************************/
package org.eclipse.papyrus.customization.properties.generation.generators;
@@ -38,9 +38,9 @@ public class EditContextGenerator implements IGenerator {
public void dispose() {
// TODO Auto-generated method stub
-
+
}
-
+
public List<Context> generate(List<URI> targetURI) {
// TODO Auto-generated method stub
return null;
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/IGenerator.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/IGenerator.java
index 1450b85be98..5d71b90e995 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/IGenerator.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/IGenerator.java
@@ -10,7 +10,7 @@
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Thibault Le Ouay t.leouay@sherpa-eng.com - Strategy improvement of generated files
* Christian W. Damus (CEA) - bug 422257
- *
+ *
*****************************************************************************/
package org.eclipse.papyrus.customization.properties.generation.generators;
@@ -51,7 +51,7 @@ public interface IGenerator {
* for changes on them.
*
* @param parent
- * The Composite in which the controls will be displayed
+ * The Composite in which the controls will be displayed
*/
public void createControls(Composite parent);
@@ -140,7 +140,7 @@ public interface IGenerator {
public void setStrategy(int strategy);
public void addCheckElement(Object obj);
-
+
/**
* Disposes of any resources allocated by me when I am no longer needed.
*/
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/ProfileGenerator.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/ProfileGenerator.java
index 2ea5d2cc1ef..736253e9af7 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/ProfileGenerator.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/generators/ProfileGenerator.java
@@ -55,7 +55,7 @@ import org.eclipse.uml2.uml.Profile;
* @author Camille Letavernier
*/
-//FIXME warning if all profiles have the same name overwrite the same file
+// FIXME warning if all profiles have the same name overwrite the same file
public class ProfileGenerator extends AbstractQVTGenerator {
private FileChooser sourceFileChooser;
@@ -80,7 +80,7 @@ public class ProfileGenerator extends AbstractQVTGenerator {
sourceLabel.setLayoutData(data);
sourceFileChooser = new FileChooser(root, false);
- sourceFileChooser.setFilterExtensions(new String[]{ "profile.uml" }); //$NON-NLS-1$
+ sourceFileChooser.setFilterExtensions(new String[] { "profile.uml" }); //$NON-NLS-1$
sourceFileChooser.addListener(this);
listEObject = new ArrayList<EObject>();
}
@@ -102,8 +102,8 @@ public class ProfileGenerator extends AbstractQVTGenerator {
LinkedList<ModelExtent> result = new LinkedList<ModelExtent>();
ModelExtent inPackage = new BasicModelExtent();
List<EObject> liste = new ArrayList<EObject>();
- if(!listEObject.isEmpty()) {
- for(EObject currentEObject : listEObject) {
+ if (!listEObject.isEmpty()) {
+ for (EObject currentEObject : listEObject) {
EObject tempEObject = null;
try {
tempEObject = loadEMFModel(currentEObject.eResource().getURI());
@@ -122,11 +122,11 @@ public class ProfileGenerator extends AbstractQVTGenerator {
URI umlURI = URI.createURI("ppe:/context/org.eclipse.papyrus.uml.properties/Model/UML/UML.ctx", true);
Context umlContext = null;
try {
- umlContext = (Context)loadEMFModel(umlURI);
+ umlContext = (Context) loadEMFModel(umlURI);
} catch (IOException e) {
e.printStackTrace();
}
- if(umlContext == null) {
+ if (umlContext == null) {
Activator.log.warn("Cannot find the UML Property View configuration");
}
@@ -154,24 +154,24 @@ public class ProfileGenerator extends AbstractQVTGenerator {
* Package
*
* @param path
- * The list of package and subpackages names, and the classifier
- * name, i.e. the list of segments in the classifier qualified
- * name e.g. : SysML::Blocks::Block : ["SysML", "Blocks",
- * "Block"]
+ * The list of package and subpackages names, and the classifier
+ * name, i.e. the list of segments in the classifier qualified
+ * name e.g. : SysML::Blocks::Block : ["SysML", "Blocks",
+ * "Block"]
* @param rootPackage
- * The root Package in which the stereotype should be retrieved
+ * The root Package in which the stereotype should be retrieved
* @return The corresponding Classifier, or null if it couldn't be retrieved
*/
protected Classifier findClassifier(List<String> path, Package rootPackage) {
NamedElement element = rootPackage.getOwnedMember(path.get(0));
path.remove(0);
- if(path.size() == 0) {
- if(element instanceof Classifier) {
- return (Classifier)element;
+ if (path.size() == 0) {
+ if (element instanceof Classifier) {
+ return (Classifier) element;
}
} else {
- if(element instanceof Package) {
- return findClassifier(path, (Package)element);
+ if (element instanceof Package) {
+ return findClassifier(path, (Package) element);
}
}
return null;
@@ -184,7 +184,7 @@ public class ProfileGenerator extends AbstractQVTGenerator {
private List<String> getPath(DataContextElement element) {
List<String> result;
- if(element.getPackage() == null) {
+ if (element.getPackage() == null) {
result = new LinkedList<String>();
} else {
result = getPath(element.getPackage());
@@ -205,12 +205,12 @@ public class ProfileGenerator extends AbstractQVTGenerator {
List<String> path = getPath(property);
Package propertyRootPackage = findPackage(path.remove(0));
- if(propertyRootPackage == null) {
+ if (propertyRootPackage == null) {
return null;
}
Classifier classifier = findClassifier(path, propertyRootPackage);
- if(classifier == null) {
+ if (classifier == null) {
return null;
}
@@ -219,11 +219,11 @@ public class ProfileGenerator extends AbstractQVTGenerator {
}
public Package findPackage(String name) {
- for(Resource resource : umlProfile.eResource().getResourceSet().getResources()) {
- for(Object rootElement : resource.getContents()) {
- if(rootElement instanceof Package) {
- Package rootPackage = (Package)rootElement;
- if(name.equals(rootPackage.getName())) {
+ for (Resource resource : umlProfile.eResource().getResourceSet().getResources()) {
+ for (Object rootElement : resource.getContents()) {
+ if (rootElement instanceof Package) {
+ Package rootPackage = (Package) rootElement;
+ if (name.equals(rootPackage.getName())) {
return rootPackage;
}
}
@@ -234,16 +234,16 @@ public class ProfileGenerator extends AbstractQVTGenerator {
public boolean isSelectedSingle(Property property) {
org.eclipse.uml2.uml.Property attribute = getAttribute(property);
- if(attribute == null) {
+ if (attribute == null) {
Activator.log.warn("Cannot find the Property corresponding to " + getPath(property)); //$NON-NLS-1$
return false;
}
- if(attribute.isDerived()) {
+ if (attribute.isDerived()) {
return false;
}
- if(attribute.isReadOnly()) {
+ if (attribute.isReadOnly()) {
return false;
}
@@ -251,19 +251,19 @@ public class ProfileGenerator extends AbstractQVTGenerator {
}
public boolean isSelectedMultiple(Property property) {
- if(!isSelectedSingle(property)) {
+ if (!isSelectedSingle(property)) {
return false;
}
org.eclipse.uml2.uml.Property attribute = getAttribute(property);
- Set<String> validDataTypes = new HashSet<String>(Arrays.asList(new String[]{ "Integer", "Boolean", "Float", "Double" })); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ Set<String> validDataTypes = new HashSet<String>(Arrays.asList(new String[] { "Integer", "Boolean", "Float", "Double" })); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- if(attribute.getType() instanceof PrimitiveType) {
- return validDataTypes.contains(((PrimitiveType)attribute.getType()).getName());
+ if (attribute.getType() instanceof PrimitiveType) {
+ return validDataTypes.contains(((PrimitiveType) attribute.getType()).getName());
}
- if(attribute.getType() instanceof Enumeration) {
+ if (attribute.getType() instanceof Enumeration) {
return true;
}
@@ -286,19 +286,19 @@ public class ProfileGenerator extends AbstractQVTGenerator {
public List<Object> getExternalReference() {
URI packageURI = URI.createPlatformResourceURI(sourceFileChooser.getFilePath(), true);
try {
- umlProfile = (Profile)loadEMFModel(packageURI);
+ umlProfile = (Profile) loadEMFModel(packageURI);
} catch (IOException e) {
- //nothing
+ // nothing
}
list = new ArrayList<Object>();
list.add(umlProfile);
TreeIterator<EObject> tree = umlProfile.eAllContents();
- while(tree.hasNext()) {
+ while (tree.hasNext()) {
Object obj = tree.next();
- if(obj instanceof PackageImport) {
- PackageImport currentPackage = (PackageImport)obj;
- if(!list.contains(currentPackage.getImportedPackage())) {
+ if (obj instanceof PackageImport) {
+ PackageImport currentPackage = (PackageImport) obj;
+ if (!list.contains(currentPackage.getImportedPackage())) {
list.add(currentPackage.getImportedPackage());
}
}
@@ -311,9 +311,9 @@ public class ProfileGenerator extends AbstractQVTGenerator {
public void addCheckElement(Object obj) {
- if(obj instanceof EObject) {
- EObject current = (EObject)obj;
- if(!listEObject.contains(current)) {
+ if (obj instanceof EObject) {
+ EObject current = (EObject) obj;
+ if (!listEObject.contains(current)) {
listEObject.add(current);
}
}
@@ -328,15 +328,15 @@ public class ProfileGenerator extends AbstractQVTGenerator {
try {
ModelExtent inProfile = null;
- if(listEObject.get(i) instanceof Package) {
- Package currentPackage = (Package)listEObject.get(i);
- umlProfile = (Profile)loadEMFModel(currentPackage.eResource().getURI());
+ if (listEObject.get(i) instanceof Package) {
+ Package currentPackage = (Package) listEObject.get(i);
+ umlProfile = (Profile) loadEMFModel(currentPackage.eResource().getURI());
inProfile = new BasicModelExtent(Collections.singletonList(umlProfile));
}
URI umlURI = URI.createURI("ppe:/context/org.eclipse.papyrus.uml.properties/Model/UML/UML.ctx", true);
- Context umlContext = (Context)loadEMFModel(umlURI);
- if(umlContext == null) {
+ Context umlContext = (Context) loadEMFModel(umlURI);
+ if (umlContext == null) {
Activator.log.warn("Cannot find the UML Property View configuration");
}
ModelExtent inUml = new BasicModelExtent(Collections.singletonList(umlContext));
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/layout/ILayoutGenerator.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/layout/ILayoutGenerator.java
index 930dae9353a..3868477323e 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/layout/ILayoutGenerator.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/layout/ILayoutGenerator.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2010 CEA LIST.
- *
+ *
* 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
@@ -22,7 +22,7 @@ import org.eclipse.papyrus.views.properties.ui.PropertyEditor;
* An interface for defining Layout generators.
* Layout generators are responsible for building a List of sections from a list
* of Property editors.
- *
+ *
* @author Camille Letavernier
*/
public interface ILayoutGenerator {
@@ -30,11 +30,11 @@ public interface ILayoutGenerator {
/**
* Return a list of Sections from a list of property editors.
* Each section should be placed in the parent's resourceSet
- *
+ *
* @param editors
- * The list of editors to layout
+ * The list of editors to layout
* @param parent
- * The view owning the resulting list of sections
+ * The view owning the resulting list of sections
* @return
* The list of sections owning the input editors
*/
@@ -47,11 +47,11 @@ public interface ILayoutGenerator {
/**
* Sets the generator used to generate the Property view configuration
- *
+ *
* @param generator
*/
- //TODO : This method has been added for a specific case (Profile layout).
- //It should be removed when we have a better way to retrieve the source
- //profile
+ // TODO : This method has been added for a specific case (Profile layout).
+ // It should be removed when we have a better way to retrieve the source
+ // profile
public void setGenerator(IGenerator generator);
}
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/layout/ProfileWithDatatypes.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/layout/ProfileWithDatatypes.java
index 40bb1b8af93..1404c570371 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/layout/ProfileWithDatatypes.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/layout/ProfileWithDatatypes.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2012 CEA LIST.
- *
+ *
* 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
@@ -44,11 +44,11 @@ public class ProfileWithDatatypes extends StandardLayoutGenerator {
@Override
protected void sortEditors(List<PropertyEditor> editors) {
- for(PropertyEditor editor : editors) {
+ for (PropertyEditor editor : editors) {
Category category = new TypeCategory(editor.getProperty());
getByCategory(category).add(editor);
- if(editor.getWidgetType() == null) {
+ if (editor.getWidgetType() == null) {
Activator.log.warn(String.format("Editor for property %s doesn't have a WidgetType", editor.getProperty().getName())); //$NON-NLS-1$
continue;
}
@@ -59,7 +59,7 @@ public class ProfileWithDatatypes extends StandardLayoutGenerator {
@Override
protected CompositeWidget layoutCategorizedEditors(Category category, List<PropertyEditor> editors) {
- if(((TypeCategory)category).isDatatype) {
+ if (((TypeCategory) category).isDatatype) {
CompositeWidgetType compositeType = ConfigurationManager.getInstance().getDefaultCompositeType();
CompositeWidget container = UiFactory.eINSTANCE.createCompositeWidget();
@@ -68,7 +68,7 @@ public class ProfileWithDatatypes extends StandardLayoutGenerator {
Layout layout = createLayout(category.getNumColumns());
container.setLayout(layout);
- for(PropertyEditor editor : editors) {
+ for (PropertyEditor editor : editors) {
CompositeWidget group = createDataTypeGroup(editor.getProperty());
PropertyEditor viewEditor = UiFactory.eINSTANCE.createPropertyEditor();
@@ -91,28 +91,28 @@ public class ProfileWithDatatypes extends StandardLayoutGenerator {
}
protected String getViewName(Property property) {
- if(!(generator instanceof ProfileGenerator)) {
+ if (!(generator instanceof ProfileGenerator)) {
return "";
}
- org.eclipse.uml2.uml.Property attribute = ((ProfileGenerator)generator).getAttribute(property);
+ org.eclipse.uml2.uml.Property attribute = ((ProfileGenerator) generator).getAttribute(property);
Package nearestPackage = attribute.getType().getNearestPackage();
Package rootPackage = nearestPackage;
- while(rootPackage.getNestingPackage() != null) {
+ while (rootPackage.getNestingPackage() != null) {
rootPackage = rootPackage.getNestingPackage();
}
- //TODO : We're assuming the rootPackage has the same name as the context...
- //This layout generator is really only compatible with ProfileGenerator
+ // TODO : We're assuming the rootPackage has the same name as the context...
+ // This layout generator is really only compatible with ProfileGenerator
return rootPackage.getName() + ":Single " + attribute.getType().getName();
}
protected Context findContext(Property property) {
DataContextElement element = property.getContextElement();
- if(element instanceof DataContextRoot) {
- //TODO : Add a container reference to Context
- return (Context)element.eContainer();
+ if (element instanceof DataContextRoot) {
+ // TODO : Add a container reference to Context
+ return (Context) element.eContainer();
}
return findContext(element);
@@ -120,8 +120,8 @@ public class ProfileWithDatatypes extends StandardLayoutGenerator {
protected Context findContext(DataContextElement element) {
DataContextPackage dataContextPackage = element.getPackage();
- if(dataContextPackage instanceof DataContextRoot) {
- return (Context)dataContextPackage.eContainer();
+ if (dataContextPackage instanceof DataContextRoot) {
+ return (Context) dataContextPackage.eContainer();
}
return findContext(dataContextPackage);
}
@@ -162,9 +162,9 @@ public class ProfileWithDatatypes extends StandardLayoutGenerator {
}
protected CompositeWidgetType getGroupComposite() {
- for(Environment environment : ConfigurationManager.getInstance().getPropertiesRoot().getEnvironments()) {
- for(CompositeWidgetType widgetType : environment.getCompositeWidgetTypes()) {
- if(widgetType.getNamespace() == null && widgetType.getWidgetClass().equals("Group")) {
+ for (Environment environment : ConfigurationManager.getInstance().getPropertiesRoot().getEnvironments()) {
+ for (CompositeWidgetType widgetType : environment.getCompositeWidgetTypes()) {
+ if (widgetType.getNamespace() == null && widgetType.getWidgetClass().equals("Group")) {
return widgetType;
}
}
@@ -175,9 +175,9 @@ public class ProfileWithDatatypes extends StandardLayoutGenerator {
}
protected PropertyEditorType getViewEditor() {
- for(Environment environment : ConfigurationManager.getInstance().getPropertiesRoot().getEnvironments()) {
- for(PropertyEditorType widgetType : environment.getPropertyEditorTypes()) {
- if(widgetType.getNamespace() != null && "ppe".equals(widgetType.getNamespace().getName()) && widgetType.getWidgetClass().equals("ViewEditor")) {
+ for (Environment environment : ConfigurationManager.getInstance().getPropertiesRoot().getEnvironments()) {
+ for (PropertyEditorType widgetType : environment.getPropertyEditorTypes()) {
+ if (widgetType.getNamespace() != null && "ppe".equals(widgetType.getNamespace().getName()) && widgetType.getWidgetClass().equals("ViewEditor")) {
return widgetType;
}
}
@@ -199,15 +199,15 @@ public class ProfileWithDatatypes extends StandardLayoutGenerator {
public TypeCategory(Property property) {
super(property);
org.eclipse.uml2.uml.Property attribute = resolveProperty(property);
- if(attribute != null) {
+ if (attribute != null) {
isDatatype = attribute.getType().eClass() == UMLPackage.eINSTANCE.getDataType();
}
}
protected org.eclipse.uml2.uml.Property resolveProperty(Property property) {
- //TODO : We should not have to rely on the IGenerator to retrieve the property...
- if(generator instanceof ProfileGenerator) {
- ProfileGenerator profileGenerator = (ProfileGenerator)generator;
+ // TODO : We should not have to rely on the IGenerator to retrieve the property...
+ if (generator instanceof ProfileGenerator) {
+ ProfileGenerator profileGenerator = (ProfileGenerator) generator;
return profileGenerator.getAttribute(property);
}
@@ -216,7 +216,7 @@ public class ProfileWithDatatypes extends StandardLayoutGenerator {
@Override
public Integer getNumColumns() {
- if(isDatatype) {
+ if (isDatatype) {
return 1;
}
return super.getNumColumns();
@@ -233,20 +233,20 @@ public class ProfileWithDatatypes extends StandardLayoutGenerator {
@Override
public boolean equals(Object obj) {
- if(this == obj) {
+ if (this == obj) {
return true;
}
- if(!super.equals(obj)) {
+ if (!super.equals(obj)) {
return false;
}
- if(!(obj instanceof TypeCategory)) {
+ if (!(obj instanceof TypeCategory)) {
return false;
}
- TypeCategory other = (TypeCategory)obj;
- if(!getOuterType().equals(other.getOuterType())) {
+ TypeCategory other = (TypeCategory) obj;
+ if (!getOuterType().equals(other.getOuterType())) {
return false;
}
- if(isDatatype != other.isDatatype) {
+ if (isDatatype != other.isDatatype) {
return false;
}
return true;
@@ -254,7 +254,7 @@ public class ProfileWithDatatypes extends StandardLayoutGenerator {
@Override
public Integer getTypeIndex() {
- if(isDatatype) {
+ if (isDatatype) {
return orderedTypes.length + 1;
}
return super.getTypeIndex();
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/layout/StandardLayoutGenerator.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/layout/StandardLayoutGenerator.java
index b1805b0001e..225a0f40ae5 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/layout/StandardLayoutGenerator.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/layout/StandardLayoutGenerator.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2010 CEA LIST.
- *
+ *
* 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
@@ -45,9 +45,9 @@ import org.eclipse.papyrus.views.properties.util.PropertiesUtil;
* Default implementation for ILayoutGenerator
* PropertyEditors are grouped by their property type (Strings, booleans, ...)
* Boolean and integer sections have two columns, while the other ones have only one columns
- *
+ *
* All multiple value editors are displayed after all the single value editors.
- *
+ *
* @author Camille Letavernier
*/
public class StandardLayoutGenerator implements ILayoutGenerator {
@@ -67,7 +67,7 @@ public class StandardLayoutGenerator implements ILayoutGenerator {
Section section = createSection(parent);
- for(Map.Entry<Category, List<PropertyEditor>> mapping : editorsByCategory.entrySet()) {
+ for (Map.Entry<Category, List<PropertyEditor>> mapping : editorsByCategory.entrySet()) {
Category category = mapping.getKey();
List<PropertyEditor> categorizedEditors = mapping.getValue();
@@ -98,11 +98,11 @@ public class StandardLayoutGenerator implements ILayoutGenerator {
}
protected void sortEditors(List<PropertyEditor> editors) {
- for(PropertyEditor editor : editors) {
+ for (PropertyEditor editor : editors) {
Category category = new Category(editor.getProperty());
getByCategory(category).add(editor);
- if(editor.getWidgetType() == null) {
+ if (editor.getWidgetType() == null) {
Activator.log.warn(String.format("Editor for property %s doesn't have a WidgetType", editor.getProperty().getName())); //$NON-NLS-1$
continue;
}
@@ -116,7 +116,7 @@ public class StandardLayoutGenerator implements ILayoutGenerator {
Section section = ContextsFactory.eINSTANCE.createSection();
section.setName(parent.getName());
- section.setSectionFile(String.format("ui/%s.xwt", section.getName().replaceAll(" ", ""))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ section.setSectionFile(String.format("ui/%s.xwt", section.getName().replaceAll(" ", ""))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
URI compositeURI = URI.createURI(section.getSectionFile());
compositeURI = compositeURI.resolve(parent.eResource().getURI());
@@ -147,8 +147,8 @@ public class StandardLayoutGenerator implements ILayoutGenerator {
protected List<ValueAttribute> createNamespaces(Collection<Namespace> namespaces) {
List<ValueAttribute> xmlNamespaces = new LinkedList<ValueAttribute>();
- for(Namespace namespace : namespaces) {
- if(namespace == null) {
+ for (Namespace namespace : namespaces) {
+ if (namespace == null) {
continue;
}
@@ -161,7 +161,7 @@ public class StandardLayoutGenerator implements ILayoutGenerator {
}
protected List<PropertyEditor> getByCategory(Category category) {
- if(!editorsByCategory.containsKey(category)) {
+ if (!editorsByCategory.containsKey(category)) {
editorsByCategory.put(category, new LinkedList<PropertyEditor>());
}
return editorsByCategory.get(category);
@@ -174,7 +174,7 @@ public class StandardLayoutGenerator implements ILayoutGenerator {
public int multiplicity;
public Integer getNumColumns() {
- switch(editorType) {
+ switch (editorType) {
case BOOLEAN:
return 2;
case ENUMERATION:
@@ -186,7 +186,7 @@ public class StandardLayoutGenerator implements ILayoutGenerator {
case STRING:
return 1;
}
- return 1; //Cannot happen
+ return 1; // Cannot happen
}
public Category(Property property) {
@@ -206,34 +206,34 @@ public class StandardLayoutGenerator implements ILayoutGenerator {
@Override
public boolean equals(Object obj) {
- if(this == obj) {
+ if (this == obj) {
return true;
}
- if(obj == null) {
+ if (obj == null) {
return false;
}
- if(!(obj instanceof Category)) {
+ if (!(obj instanceof Category)) {
return false;
}
- Category other = (Category)obj;
- if(!getOuterType().equals(other.getOuterType())) {
+ Category other = (Category) obj;
+ if (!getOuterType().equals(other.getOuterType())) {
return false;
}
- if(editorType != other.editorType) {
+ if (editorType != other.editorType) {
return false;
}
- if(multiplicity != other.multiplicity) {
+ if (multiplicity != other.multiplicity) {
return false;
}
return true;
}
public int compareTo(Category category) {
- if(category == null) {
+ if (category == null) {
return -1;
}
- if(category.multiplicity != multiplicity) {
+ if (category.multiplicity != multiplicity) {
return multiplicity == 1 ? -1 : 1;
}
@@ -243,8 +243,8 @@ public class StandardLayoutGenerator implements ILayoutGenerator {
public Integer getTypeIndex() {
int i = 0;
- for(Type type : orderedTypes) {
- if(type == editorType) {
+ for (Type type : orderedTypes) {
+ if (type == editorType) {
return i;
}
i++;
@@ -265,13 +265,13 @@ public class StandardLayoutGenerator implements ILayoutGenerator {
/**
* The order in which the types are displayed
*/
- public static Type[] orderedTypes = new Type[]{ Type.STRING, Type.BOOLEAN, Type.INTEGER, Type.ENUMERATION, Type.REFERENCE };
+ public static Type[] orderedTypes = new Type[] { Type.STRING, Type.BOOLEAN, Type.INTEGER, Type.ENUMERATION, Type.REFERENCE };
public String getName() {
return Messages.StandardLayoutGenerator_name;
}
public void setGenerator(IGenerator generator) {
- //Ignored
+ // Ignored
}
}
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/messages/Messages.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/messages/Messages.java
index 588c983d528..8ee5b92666d 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/messages/Messages.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/messages/Messages.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2011 CEA LIST.
- *
+ *
* 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
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/providers/DataContextPropertiesContentProvider.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/providers/DataContextPropertiesContentProvider.java
index 85a55864949..4a5a3b35626 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/providers/DataContextPropertiesContentProvider.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/providers/DataContextPropertiesContentProvider.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2012 CEA LIST.
- *
+ *
* 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
@@ -28,7 +28,7 @@ public class DataContextPropertiesContentProvider extends PropertyContentProvide
@Override
public Object[] getElements() {
- //We're only interested in the generated contexts ; not in their dependencies
+ // We're only interested in the generated contexts ; not in their dependencies
return contexts.toArray();
}
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/providers/DataContextPropertiesLabelProvider.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/providers/DataContextPropertiesLabelProvider.java
index a02107818f3..1ea93fa026c 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/providers/DataContextPropertiesLabelProvider.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/providers/DataContextPropertiesLabelProvider.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2012 CEA LIST.
- *
+ *
* 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
@@ -49,49 +49,49 @@ public class DataContextPropertiesLabelProvider extends StyledCellLabelProvider
protected StyledString getStyledText(Object element, int columnIndex) {
String text = getText(element, columnIndex);
- if(columnIndex == selectFieldsPage.fieldColumn) {
+ if (columnIndex == selectFieldsPage.fieldColumn) {
EObject eObject = EMFHelper.getEObject(element);
- if(!(eObject instanceof Property)) {
+ if (!(eObject instanceof Property)) {
StyledString styledString = new StyledString(text, StyledString.QUALIFIER_STYLER);
return styledString;
}
}
- // if(columnIndex == selectFieldsPage.selectionSingleColumn) {
- // //Nothing
- // }
+ // if(columnIndex == selectFieldsPage.selectionSingleColumn) {
+ // //Nothing
+ // }
//
- // if(columnIndex == selectFieldsPage.selectionMultipleColumn) {
- // //Nothing
- // }
+ // if(columnIndex == selectFieldsPage.selectionMultipleColumn) {
+ // //Nothing
+ // }
//
- // if(columnIndex == selectFieldsPage.descriptionColumn) {
- // //Nothing
- // }
+ // if(columnIndex == selectFieldsPage.descriptionColumn) {
+ // //Nothing
+ // }
- //Default
+ // Default
return new StyledString(text);
}
protected String getText(Object element, int columnIndex) {
- if(columnIndex == selectFieldsPage.fieldColumn) {
+ if (columnIndex == selectFieldsPage.fieldColumn) {
return labelProvider.getText(element);
}
- // if(columnIndex == selectFieldsPage.selectionSingleColumn) {
- // //Nothing
- // }
+ // if(columnIndex == selectFieldsPage.selectionSingleColumn) {
+ // //Nothing
+ // }
//
- // if(columnIndex == selectFieldsPage.selectionMultipleColumn) {
- // //Nothing
- // }
+ // if(columnIndex == selectFieldsPage.selectionMultipleColumn) {
+ // //Nothing
+ // }
- if(columnIndex == selectFieldsPage.descriptionColumn) {
+ if (columnIndex == selectFieldsPage.descriptionColumn) {
EObject eObject = EMFHelper.getEObject(element);
- if(eObject instanceof Property) {
- String description = ((Property)element).getDescription();
- if(description != null) {
+ if (eObject instanceof Property) {
+ String description = ((Property) element).getDescription();
+ if (description != null) {
return description.replaceAll("[\n\r]+", "\\\\");
}
@@ -99,28 +99,28 @@ public class DataContextPropertiesLabelProvider extends StyledCellLabelProvider
}
}
- //Default
+ // Default
return "";
}
protected Image getImage(Object element, int columnIndex) {
- if(columnIndex == selectFieldsPage.fieldColumn) {
+ if (columnIndex == selectFieldsPage.fieldColumn) {
return labelProvider.getImage(element);
}
- // if(columnIndex == selectFieldsPage.selectionSingleColumn) {
- // //Nothing
- // }
+ // if(columnIndex == selectFieldsPage.selectionSingleColumn) {
+ // //Nothing
+ // }
//
- // if(columnIndex == selectFieldsPage.selectionMultipleColumn) {
- // //Nothing
- // }
+ // if(columnIndex == selectFieldsPage.selectionMultipleColumn) {
+ // //Nothing
+ // }
//
- // if(columnIndex == selectFieldsPage.descriptionColumn) {
- // //Nothing
- // }
+ // if(columnIndex == selectFieldsPage.descriptionColumn) {
+ // //Nothing
+ // }
- //Default
+ // Default
return null;
}
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/validators/AbstractValidator.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/validators/AbstractValidator.java
index b97f6d89c24..0aa404ec6e0 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/validators/AbstractValidator.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/validators/AbstractValidator.java
@@ -1,13 +1,13 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* 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:
- * Thibault Le Ouay t.leouay@sherpa-eng.com
+ * Thibault Le Ouay t.leouay@sherpa-eng.com
*****************************************************************************/
@@ -31,7 +31,7 @@ public abstract class AbstractValidator implements IValidator {
}
public String getPluginId() {
- if(pluginId == null) {
+ if (pluginId == null) {
return Activator.PLUGIN_ID;
} else {
return pluginId;
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/validators/SourceValidator.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/validators/SourceValidator.java
index f3676793699..3273dd876dd 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/validators/SourceValidator.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/validators/SourceValidator.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* 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
@@ -48,22 +48,22 @@ public class SourceValidator extends AbstractValidator {
IWorkspaceRoot myWorkspaceRoot = ResourcesPlugin.getWorkspace()
.getRoot();
- IFile file =null;
- try{
+ IFile file = null;
+ try {
IPath path = new Path(s);
file = myWorkspaceRoot.getFile(path);
- }
- catch(IllegalArgumentException ex){
+ } catch (IllegalArgumentException ex) {
return error(ex.getMessage());
}
if (!file.exists()) {
return error(Messages.SourceValidator_5);
}
+ } else {
+ return error(Messages.SourceValidator_6);
}
- else return error(Messages.SourceValidator_6);
-
+
return Status.OK_STATUS;
}
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/validators/TargetValidator.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/validators/TargetValidator.java
index e0441c2d3c5..7aae8904862 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/validators/TargetValidator.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/validators/TargetValidator.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
- *
+ *
* 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
@@ -18,19 +18,20 @@ import org.eclipse.papyrus.customization.properties.generation.messages.Messages
public class TargetValidator extends AbstractValidator {
-
+
public IStatus validate(Object value) {
- if(value instanceof String){
+ if (value instanceof String) {
String s = (String) value;
- if(!s.equals("")){ //$NON-NLS-1$
- if(!s.endsWith("ctx")){ //$NON-NLS-1$
+ if (!s.equals("")) { //$NON-NLS-1$
+ if (!s.endsWith("ctx")) { //$NON-NLS-1$
return error(Messages.TargetValidator_2);
}
+ } else {
+ return error(Messages.TargetValidator_3);
}
- else return error(Messages.TargetValidator_3);
- }
-
- return Status.OK_STATUS;
}
+ return Status.OK_STATUS;
+ }
+
}
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/AbstractCreateContextPage.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/AbstractCreateContextPage.java
index 70360dd1701..53a460ee9d4 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/AbstractCreateContextPage.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/AbstractCreateContextPage.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2010 CEA LIST.
- *
+ *
* 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
@@ -17,7 +17,7 @@ import org.eclipse.jface.wizard.WizardPage;
/**
* An abstract WizardPage for the CreateContext wizard, providing helper
* methods to its implementers
- *
+ *
* @author Camille Letavernier
*/
public abstract class AbstractCreateContextPage extends WizardPage {
@@ -25,25 +25,25 @@ public abstract class AbstractCreateContextPage extends WizardPage {
/**
* Builds a new WizardPage with the given pageName
* Constructor.
- *
+ *
* @param pageName
- * The name of this wizard page
+ * The name of this wizard page
*/
public AbstractCreateContextPage(String pageName) {
super(pageName);
}
/**
- *
+ *
* Builds a new WizardPage with the given pageName, title and image
- *
+ *
* @param pageName
- * the name of the page
+ * the name of the page
* @param title
- * the title for this wizard page, or <code>null</code> if none
+ * the title for this wizard page, or <code>null</code> if none
* @param titleImage
- * the image descriptor for the title of this wizard page,
- * or <code>null</code> if none
+ * the image descriptor for the title of this wizard page,
+ * or <code>null</code> if none
*/
public AbstractCreateContextPage(String pageName, String title, ImageDescriptor titleImage) {
super(pageName, title, titleImage);
@@ -51,7 +51,7 @@ public abstract class AbstractCreateContextPage extends WizardPage {
@Override
public CreateContextWizard getWizard() {
- return (CreateContextWizard)super.getWizard();
+ return (CreateContextWizard) super.getWizard();
}
}
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/CreateContextMainPage.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/CreateContextMainPage.java
index abf418c0861..bffba34409c 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/CreateContextMainPage.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/CreateContextMainPage.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2010, 2014 CEA LIST 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
@@ -10,7 +10,7 @@
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Thibault Le Ouay t.leouay@sherpa-eng.com - Add SelectOutputPage
* Christian W. Damus (CEA) - bug 422257
- *
+ *
*****************************************************************************/
package org.eclipse.papyrus.customization.properties.generation.wizard;
@@ -32,9 +32,9 @@ import org.eclipse.swt.widgets.Listener;
/**
* A WizardPage for selecting the method of generation (e.g. from Ecore
* Metamodel or from Profile model)
- *
+ *
* @author Camille Letavernier
- *
+ *
*/
public class CreateContextMainPage extends AbstractCreateContextPage implements Listener {
@@ -54,7 +54,7 @@ public class CreateContextMainPage extends AbstractCreateContextPage implements
@Override
public void dispose() {
try {
- for(IGenerator next : generators) {
+ for (IGenerator next : generators) {
next.dispose();
}
} finally {
@@ -67,7 +67,7 @@ public class CreateContextMainPage extends AbstractCreateContextPage implements
root.setLayout(new GridLayout(1, false));
combo = new CCombo(root, SWT.BORDER);
- for(IGenerator generator : generators) {
+ for (IGenerator generator : generators) {
combo.add(generator.getName());
}
combo.setEditable(false);
@@ -84,7 +84,7 @@ public class CreateContextMainPage extends AbstractCreateContextPage implements
public IWizardPage getNextPage() {
int selection = combo.getSelectionIndex();
getWizard().setGenerator(generators.get(selection));
- // getWizard().generatorPage.clearTarget();
+ // getWizard().generatorPage.clearTarget();
return getWizard().generatorPage;
}
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/CreateContextWizard.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/CreateContextWizard.java
index 6c11474f5f5..f5411680e60 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/CreateContextWizard.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/CreateContextWizard.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2010, 2014 CEA LIST 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
@@ -9,7 +9,7 @@
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Christian W. Damus (CEA) - bug 422257
- *
+ *
*****************************************************************************/
package org.eclipse.papyrus.customization.properties.generation.wizard;
@@ -25,6 +25,7 @@ import java.util.Set;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.emf.ecore.xmi.XMIResource;
+import org.eclipse.emf.ecore.xmi.XMLResource;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
@@ -52,7 +53,7 @@ import org.eclipse.ui.IWorkbench;
/**
* A Wizard for generating Property view contexts
- *
+ *
* @author Camille Letavernier
*/
public class CreateContextWizard extends Wizard implements INewWizard {
@@ -60,10 +61,10 @@ public class CreateContextWizard extends Wizard implements INewWizard {
protected CreateContextMainPage mainPage;
protected GeneratorPage generatorPage;
-
+
protected SelectOutputPage selectOutputPage;
- //protected LayoutPage layout;
+ // protected LayoutPage layout;
protected SelectFieldsPage selectFieldsPage;
@@ -88,13 +89,13 @@ public class CreateContextWizard extends Wizard implements INewWizard {
@Override
public boolean performFinish() {
- if(generator == null || contexts == null || contexts.isEmpty() || layoutGenerator == null) {
+ if (generator == null || contexts == null || contexts.isEmpty() || layoutGenerator == null) {
return false;
}
ConfigurationManager configManager = ConfigurationManager.getInstance();
- for(Context context : contexts) {
+ for (Context context : contexts) {
Tab defaultTab = ContextsFactory.eINSTANCE.createTab();
defaultTab.setId(context.getName().toLowerCase());
defaultTab.setLabel(context.getName());
@@ -103,27 +104,27 @@ public class CreateContextWizard extends Wizard implements INewWizard {
FieldSelection fieldSelection = selectFieldsPage.getFieldSelection();
- // URI contextURI = context.eResource().getURI();
+ // URI contextURI = context.eResource().getURI();
// Resource selectionResource = context.eResource().getResourceSet().createResource(URI.createURI(context.getName() + "FieldSelection.xmi").resolve(contextURI)); //$NON-NLS-1$
- // selectionResource.getContents().add(fieldSelection);
- // try {
- // selectionResource.save(null);
- // } catch (IOException ex) {
+ // selectionResource.getContents().add(fieldSelection);
+ // try {
+ // selectionResource.save(null);
+ // } catch (IOException ex) {
// Activator.log.error("Couldn't persist the field selection model", ex); //$NON-NLS-1$
- // }
+ // }
layoutGenerator.setGenerator(generator);
- for(View view : context.getViews()) {
- if(view.getConstraints().size() == 0) {
+ for (View view : context.getViews()) {
+ if (view.getConstraints().size() == 0) {
continue;
}
List<PropertyEditor> editors = new LinkedList<PropertyEditor>();
- for(DataContextElement element : getAllContextElements(view.getDatacontexts())) {
- for(Property property : element.getProperties()) {
- if(isSelected(fieldSelection, property, view.getElementMultiplicity() != 1)) {
+ for (DataContextElement element : getAllContextElements(view.getDatacontexts())) {
+ for (Property property : element.getProperties()) {
+ if (isSelected(fieldSelection, property, view.getElementMultiplicity() != 1)) {
PropertyEditor editor = UiFactory.eINSTANCE.createPropertyEditor();
editor.setProperty(property);
editor.setWidgetType(configManager.getDefaultEditorType(property));
@@ -143,7 +144,7 @@ public class CreateContextWizard extends Wizard implements INewWizard {
}
int i = 1;
- for(Tab tab : context.getTabs()) {
+ for (Tab tab : context.getTabs()) {
i += tab.getSections().size();
}
final int numberOfSections = i;
@@ -152,7 +153,7 @@ public class CreateContextWizard extends Wizard implements INewWizard {
final Context currentContext = context;
final Map<String, Object> saveOptions = new HashMap<String, Object>();
- saveOptions.put(XMIResource.OPTION_PROCESS_DANGLING_HREF, XMIResource.OPTION_PROCESS_DANGLING_HREF_RECORD);
+ saveOptions.put(XMLResource.OPTION_PROCESS_DANGLING_HREF, XMLResource.OPTION_PROCESS_DANGLING_HREF_RECORD);
getContainer().run(true, true, new IRunnableWithProgress() {
@@ -163,9 +164,9 @@ public class CreateContextWizard extends Wizard implements INewWizard {
try {
currentContext.eResource().save(saveOptions);
monitor.worked(1);
- for(Tab tab : currentContext.getTabs()) {
- for(Section section : tab.getSections()) {
- if(monitor.isCanceled()) {
+ for (Tab tab : currentContext.getTabs()) {
+ for (Section section : tab.getSections()) {
+ if (monitor.isCanceled()) {
return;
}
section.getWidget().eResource().save(saveOptions);
@@ -193,11 +194,11 @@ public class CreateContextWizard extends Wizard implements INewWizard {
private boolean isSelected(FieldSelection fieldSelection, Property property, boolean multiple) {
PropertyDefinition definition = getPropertyDefinition(fieldSelection, property);
- if(definition == null) {
+ if (definition == null) {
return false;
}
TernaryButton.State value = multiple ? definition.getValueMultiple() : definition.getValueSingle();
- switch(value) {
+ switch (value) {
case TRUE:
return true;
case FALSE:
@@ -211,34 +212,34 @@ public class CreateContextWizard extends Wizard implements INewWizard {
protected PropertyDefinition getPropertyDefinition(FieldSelection fieldSelection, Property property) {
List<String> propertyPath = getPropertyPath(property.getContextElement());
- if(propertyPath.isEmpty()) {
+ if (propertyPath.isEmpty()) {
return null;
}
ContextElement currentElement = null;
- for(ContextElement contextRoot : fieldSelection.getContextElements()) {
- if(contextRoot.getName().equals(propertyPath.get(0))) {
+ for (ContextElement contextRoot : fieldSelection.getContextElements()) {
+ if (contextRoot.getName().equals(propertyPath.get(0))) {
currentElement = contextRoot;
}
}
propertyPath.remove(0);
- if(currentElement == null) {
+ if (currentElement == null) {
return null;
}
- while(propertyPath.size() > 0) {
+ while (propertyPath.size() > 0) {
String name = propertyPath.get(0);
propertyPath.remove(0);
currentElement = findByName(currentElement, name);
}
- if(currentElement == null) {
+ if (currentElement == null) {
return null;
}
- for(PropertyDefinition definition : currentElement.getProperties()) {
- if(definition.getName().equals(property.getName())) {
+ for (PropertyDefinition definition : currentElement.getProperties()) {
+ if (definition.getName().equals(property.getName())) {
return definition;
}
}
@@ -247,8 +248,8 @@ public class CreateContextWizard extends Wizard implements INewWizard {
}
protected ContextElement findByName(ContextElement source, String name) {
- for(ContextElement element : source.getElements()) {
- if(element.getName().equals(name)) {
+ for (ContextElement element : source.getElements()) {
+ if (element.getName().equals(name)) {
return element;
}
}
@@ -257,7 +258,7 @@ public class CreateContextWizard extends Wizard implements INewWizard {
protected List<String> getPropertyPath(DataContextElement element) {
List<String> result;
- if(element.getPackage() == null) {
+ if (element.getPackage() == null) {
result = new LinkedList<String>();
} else {
result = getPropertyPath(element.getPackage());
@@ -268,19 +269,19 @@ public class CreateContextWizard extends Wizard implements INewWizard {
private Set<DataContextElement> getAllContextElements(Collection<DataContextElement> source) {
Set<DataContextElement> result = new HashSet<DataContextElement>();
- for(DataContextElement element : source) {
+ for (DataContextElement element : source) {
getAllContextElements(element, result);
}
return result;
}
private void getAllContextElements(DataContextElement source, Set<DataContextElement> result) {
- if(result.contains(source)) {
+ if (result.contains(source)) {
return;
}
result.add(source);
- for(DataContextElement element : source.getSupertypes()) {
+ for (DataContextElement element : source.getSupertypes()) {
getAllContextElements(element, result);
}
}
@@ -290,7 +291,7 @@ public class CreateContextWizard extends Wizard implements INewWizard {
addPage(generatorPage = new GeneratorPage());
addPage(selectOutputPage = new SelectOutputPage());
addPage(selectFieldsPage = new SelectFieldsPage());
- //addPage(layout = new LayoutPage());
+ // addPage(layout = new LayoutPage());
setWindowTitle(Messages.CreateContextWizard_pageTitle);
@@ -303,7 +304,7 @@ public class CreateContextWizard extends Wizard implements INewWizard {
}
protected void setContexts(List<Context> contexts) {
- if(!contexts.isEmpty()) {
+ if (!contexts.isEmpty()) {
this.contexts = contexts;
}
}
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/GeneratorPage.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/GeneratorPage.java
index 1410738921f..5870cec6b0e 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/GeneratorPage.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/GeneratorPage.java
@@ -10,7 +10,7 @@
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Thibault Le Ouay t.leouay@sherpa-eng.com - Strategy improvement of generated files
* Christian W. Damus (CEA) - bug 422257
- *
+ *
*****************************************************************************/
package org.eclipse.papyrus.customization.properties.generation.wizard;
@@ -55,7 +55,7 @@ import org.eclipse.swt.widgets.Listener;
public class GeneratorPage extends AbstractCreateContextPage implements Listener {
private final List<ILayoutGenerator> layoutGenerators;
-
+
protected IGenerator generator;
private Composite root, generatorControl;
@@ -92,7 +92,7 @@ public class GeneratorPage extends AbstractCreateContextPage implements Listener
ctx = new DataBindingContext();
srcFieldStrategy = new UpdateValueStrategy();
targetFieldStrategy = new UpdateValueStrategy();
-
+
layoutGenerators = new LayoutExtensionPoint().getGenerators();
}
@@ -125,7 +125,7 @@ public class GeneratorPage extends AbstractCreateContextPage implements Listener
}
private void cleanGeneratorControl() {
- for(Control control : generatorControl.getChildren()) {
+ for (Control control : generatorControl.getChildren()) {
control.dispose();
}
}
@@ -149,7 +149,7 @@ public class GeneratorPage extends AbstractCreateContextPage implements Listener
layoutCombo.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
layoutCombo.setEditable(false);
layoutCombo.setBackground(new Color(layoutCombo.getDisplay(), 255, 255, 255));
- for(ILayoutGenerator layoutGenerator : layoutGenerators) {
+ for (ILayoutGenerator layoutGenerator : layoutGenerators) {
layoutCombo.add(layoutGenerator.getName());
}
layoutCombo.select(0);
@@ -164,8 +164,8 @@ public class GeneratorPage extends AbstractCreateContextPage implements Listener
targetFileChooser.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
targetFileChooser.addListener(this);
targetTextObservable = targetFileChooser.getObservableValue();
- targetFileChooser.setFilterExtensions(new String[]{ "ctx" });
- if(targetFieldStrategy != null) {
+ targetFileChooser.setFilterExtensions(new String[] { "ctx" });
+ if (targetFieldStrategy != null) {
targetFieldStrategy.setConverter(new IConverter() {
public Object getToType() {
@@ -178,9 +178,9 @@ public class GeneratorPage extends AbstractCreateContextPage implements Listener
}
public String convert(Object fromObject) {
- if(srcTextObservable != null) {
- return (String)srcTextObservable.getValue();
- } else if(targetFileChooser.getFilePath() != null) {
+ if (srcTextObservable != null) {
+ return (String) srcTextObservable.getValue();
+ } else if (targetFileChooser.getFilePath() != null) {
return targetFileChooser.getFilePath();
}
@@ -188,7 +188,7 @@ public class GeneratorPage extends AbstractCreateContextPage implements Listener
}
});
}
- if(srcFieldStrategy != null) {
+ if (srcFieldStrategy != null) {
srcFieldStrategy.setConverter(new IConverter() {
public Object getToType() {
@@ -201,9 +201,9 @@ public class GeneratorPage extends AbstractCreateContextPage implements Listener
public String convert(Object fromObject) {
- if(fromObject instanceof String) {
- String stringObject = (String)fromObject;
- if(stringObject.equals("")) {
+ if (fromObject instanceof String) {
+ String stringObject = (String) fromObject;
+ if (stringObject.equals("")) {
return "";
}
String[] result = stringObject.split("/");
@@ -211,12 +211,12 @@ public class GeneratorPage extends AbstractCreateContextPage implements Listener
String[] ext = filename.split("\\.");
StringBuilder builder = new StringBuilder();
- if(targetTextObservable != null) {
- String s = (String)targetTextObservable.getValue();
- if(!s.equals("")) {
+ if (targetTextObservable != null) {
+ String s = (String) targetTextObservable.getValue();
+ if (!s.equals("")) {
String original[] = s.split("/");
builder.append("/");
- for(int i = 1; i < original.length - 1; i++) {
+ for (int i = 1; i < original.length - 1; i++) {
builder.append(original[i]);
builder.append("/");
@@ -246,7 +246,7 @@ public class GeneratorPage extends AbstractCreateContextPage implements Listener
String filePath = targetFileChooser.getFilePath();
- if(filePath != null) {
+ if (filePath != null) {
super.getContainer().updateButtons();
}
@@ -264,7 +264,7 @@ public class GeneratorPage extends AbstractCreateContextPage implements Listener
}
public void doBinding() {
- if(srcTextObservable != null || targetTextObservable != null) {
+ if (srcTextObservable != null || targetTextObservable != null) {
srcValidator = new SourceValidator(generator);
targetValidator = new TargetValidator();
@@ -282,8 +282,8 @@ public class GeneratorPage extends AbstractCreateContextPage implements Listener
binding.getValidationStatus().addValueChangeListener(new IValueChangeListener() {
public void handleValueChange(ValueChangeEvent event) {
- IStatus status = (IStatus)event.diff.getNewValue();
- if(status.isOK()) {
+ IStatus status = (IStatus) event.diff.getNewValue();
+ if (status.isOK()) {
setNext(true);
} else {
setNext(false);
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/SelectFieldsPage.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/SelectFieldsPage.java
index e495e6c49a6..5c8d2bf814f 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/SelectFieldsPage.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/SelectFieldsPage.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2010 CEA LIST.
- *
+ *
* 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
@@ -53,7 +53,7 @@ import org.eclipse.swt.widgets.TreeItem;
* The visibility of properties marked as Default is decided by the Generator.
* When the context is regenerated, the visibility of properties marked as default
* may change (If the generator is changed)
- *
+ *
* @author Camille Letavernier
*/
public class SelectFieldsPage extends AbstractCreateContextPage {
@@ -69,7 +69,7 @@ public class SelectFieldsPage extends AbstractCreateContextPage {
public int fieldColumn = -1, selectionSingleColumn = -1, selectionMultipleColumn = -1, descriptionColumn = -1;
private int columnId = 0;
-
+
/**
* Constructor.
@@ -90,12 +90,12 @@ public class SelectFieldsPage extends AbstractCreateContextPage {
/**
* Sets the generated partial context
- *
+ *
* @param context
- * The partially generated context
+ * The partially generated context
*/
public void setContexts(List<Context> contexts) {
- if(contexts == null || contexts.isEmpty()) {
+ if (contexts == null || contexts.isEmpty()) {
Activator.log.warn("Generated context is null"); //$NON-NLS-1$
return;
}
@@ -141,7 +141,7 @@ public class SelectFieldsPage extends AbstractCreateContextPage {
column.setText(label);
column.setResizable(true);
- ((TableLayout)tree.getLayout()).addColumnData(new ColumnWeightData(weight, minimumWidth));
+ ((TableLayout) tree.getLayout()).addColumnData(new ColumnWeightData(weight, minimumWidth));
return columnId++;
}
@@ -149,7 +149,7 @@ public class SelectFieldsPage extends AbstractCreateContextPage {
private void installEditors(TreeViewer viewer) {
Tree tree = viewer.getTree();
- for(TreeItem treeItem : tree.getItems()) {
+ for (TreeItem treeItem : tree.getItems()) {
installEditors(treeItem);
}
}
@@ -157,8 +157,8 @@ public class SelectFieldsPage extends AbstractCreateContextPage {
private void installEditors(TreeItem treeItem) {
EObject eObject = EMFHelper.getEObject(treeItem.getData());
- if(eObject instanceof Property) {
- Property property = (Property)eObject;
+ if (eObject instanceof Property) {
+ Property property = (Property) eObject;
boolean defaultSingleValue = getGenerator().isSelectedSingle(property);
boolean defaultMultipleValue = getGenerator().isSelectedMultiple(property);
@@ -172,7 +172,7 @@ public class SelectFieldsPage extends AbstractCreateContextPage {
createTreeEditor(treeItem, selectionMultipleColumn, defaultMultipleValue, multipleValue);
}
- for(TreeItem subItem : treeItem.getItems()) {
+ for (TreeItem subItem : treeItem.getItems()) {
installEditors(subItem);
}
@@ -195,8 +195,8 @@ public class SelectFieldsPage extends AbstractCreateContextPage {
private FieldSelection createNewFieldSelection() {
FieldSelection selection = FieldSelectionFactory.eINSTANCE.createFieldSelection();
- for(Context context : contexts) {
- for(DataContextRoot dataContextRoot : context.getDataContexts()) {
+ for (Context context : contexts) {
+ for (DataContextRoot dataContextRoot : context.getDataContexts()) {
ContextElement definition = createContextPackage(dataContextRoot);
selection.getContextElements().add(definition);
}
@@ -208,10 +208,10 @@ public class SelectFieldsPage extends AbstractCreateContextPage {
private ContextElement createContextPackage(DataContextPackage sourcePackage) {
ContextElement element = createContextElement(sourcePackage);
- for(DataContextElement sourceElement : sourcePackage.getElements()) {
+ for (DataContextElement sourceElement : sourcePackage.getElements()) {
ContextElement subElement;
- if(sourceElement instanceof DataContextPackage) {
- subElement = createContextPackage((DataContextPackage)sourceElement);
+ if (sourceElement instanceof DataContextPackage) {
+ subElement = createContextPackage((DataContextPackage) sourceElement);
} else {
subElement = createContextElement(sourceElement);
}
@@ -224,7 +224,7 @@ public class SelectFieldsPage extends AbstractCreateContextPage {
ContextElement element = FieldSelectionFactory.eINSTANCE.createContextElement();
element.setName(sourceElement.getName());
- for(Property property : sourceElement.getProperties()) {
+ for (Property property : sourceElement.getProperties()) {
PropertyDefinition propertyDefinition = FieldSelectionFactory.eINSTANCE.createPropertyDefinition();
propertyDefinition.setName(property.getName());
propertyDefinition.setValueSingle(TernaryButton.State.DEFAULT);
@@ -237,69 +237,69 @@ public class SelectFieldsPage extends AbstractCreateContextPage {
private void displayFields(DataContextElement contextElement, TreeViewer treeViewer) {
- // if(contextElement.getProperties().size() > 0) {
+ // if(contextElement.getProperties().size() > 0) {
//
- // Label separator = new Label(fields, SWT.SEPARATOR | SWT.HORIZONTAL);
- // GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false, 4, 1);
- // separator.setLayoutData(data);
+ // Label separator = new Label(fields, SWT.SEPARATOR | SWT.HORIZONTAL);
+ // GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false, 4, 1);
+ // separator.setLayoutData(data);
//
- // Label elementName = new Label(fields, SWT.NONE);
- // elementName.setText(contextElement.getName());
- // FontData[] fontDatas = elementName.getFont().getFontData();
- // for(FontData fontData : fontDatas) {
- // fontData.setStyle(SWT.BOLD);
- // // fontData.setHeight(fontData.getHeight() + 2);
- // }
- // elementName.setFont(new Font(elementName.getDisplay(), fontDatas));
+ // Label elementName = new Label(fields, SWT.NONE);
+ // elementName.setText(contextElement.getName());
+ // FontData[] fontDatas = elementName.getFont().getFontData();
+ // for(FontData fontData : fontDatas) {
+ // fontData.setStyle(SWT.BOLD);
+ // // fontData.setHeight(fontData.getHeight() + 2);
+ // }
+ // elementName.setFont(new Font(elementName.getDisplay(), fontDatas));
//
- // data = new GridData(SWT.FILL, SWT.CENTER, true, false, 4, 1);
- // elementName.setLayoutData(data);
+ // data = new GridData(SWT.FILL, SWT.CENTER, true, false, 4, 1);
+ // elementName.setLayoutData(data);
//
- // Label separator2 = new Label(fields, SWT.SEPARATOR | SWT.HORIZONTAL);
- // data = new GridData(SWT.FILL, SWT.CENTER, true, false, 4, 1);
- // separator2.setLayoutData(data);
+ // Label separator2 = new Label(fields, SWT.SEPARATOR | SWT.HORIZONTAL);
+ // data = new GridData(SWT.FILL, SWT.CENTER, true, false, 4, 1);
+ // separator2.setLayoutData(data);
//
- // for(Property property : contextElement.getProperties()) {
- // Label label = new Label(fields, SWT.NONE);
- // label.setText(property.getName());
+ // for(Property property : contextElement.getProperties()) {
+ // Label label = new Label(fields, SWT.NONE);
+ // label.setText(property.getName());
//
- // TernaryButton showSingle = new TernaryButton(fields, getGenerator().isSelectedSingle(property));
- // TernaryButton showMultiple = new TernaryButton(fields, getGenerator().isSelectedMultiple(property));
+ // TernaryButton showSingle = new TernaryButton(fields, getGenerator().isSelectedSingle(property));
+ // TernaryButton showMultiple = new TernaryButton(fields, getGenerator().isSelectedMultiple(property));
//
- // PropertyDefinition propertyDefinition = getWizard().getPropertyDefinition(fieldSelection, property);
+ // PropertyDefinition propertyDefinition = getWizard().getPropertyDefinition(fieldSelection, property);
//
- // IObservableValue singleValue = EMFProperties.value(FieldSelectionPackage.eINSTANCE.getPropertyDefinition_ValueSingle()).observe(propertyDefinition);
- // IObservableValue multipleValue = EMFProperties.value(FieldSelectionPackage.eINSTANCE.getPropertyDefinition_ValueMultiple()).observe(propertyDefinition);
+ // IObservableValue singleValue = EMFProperties.value(FieldSelectionPackage.eINSTANCE.getPropertyDefinition_ValueSingle()).observe(propertyDefinition);
+ // IObservableValue multipleValue = EMFProperties.value(FieldSelectionPackage.eINSTANCE.getPropertyDefinition_ValueMultiple()).observe(propertyDefinition);
//
- // showSingle.setObservable(singleValue);
- // showMultiple.setObservable(multipleValue);
+ // showSingle.setObservable(singleValue);
+ // showMultiple.setObservable(multipleValue);
//
- // Label description = new Label(fields, SWT.WRAP);
+ // Label description = new Label(fields, SWT.WRAP);
// String propertyDescription = "";// property.getTooltipText(); //$NON-NLS-1$
// if(propertyDescription == null || propertyDescription.trim().equals("")) { //$NON-NLS-1$
- // propertyDescription = Messages.SelectFieldsPage_descriptionNotAvailable;
- // description.setAlignment(SWT.CENTER);
- // }
- // description.setText(propertyDescription);
+ // propertyDescription = Messages.SelectFieldsPage_descriptionNotAvailable;
+ // description.setAlignment(SWT.CENTER);
+ // }
+ // description.setText(propertyDescription);
//
- // data = new GridData(SWT.FILL, SWT.CENTER, true, false);
- // label.setLayoutData(data);
- // data = new GridData(SWT.FILL, SWT.CENTER, true, false);
- // showSingle.setLayoutData(data);
- // data = new GridData(SWT.FILL, SWT.CENTER, true, false);
- // showMultiple.setLayoutData(data);
- // data = new GridData(SWT.CENTER, SWT.CENTER, true, false);
- // data.widthHint = 500;
- // description.setLayoutData(data);
- // }
- // }
+ // data = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ // label.setLayoutData(data);
+ // data = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ // showSingle.setLayoutData(data);
+ // data = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ // showMultiple.setLayoutData(data);
+ // data = new GridData(SWT.CENTER, SWT.CENTER, true, false);
+ // data.widthHint = 500;
+ // description.setLayoutData(data);
+ // }
+ // }
//
- // if(contextElement instanceof DataContextPackage) {
- // DataContextPackage contextPackage = (DataContextPackage)contextElement;
- // for(DataContextElement element : contextPackage.getElements()) {
- // displayFields(element, treeViewer);
- // }
- // }
+ // if(contextElement instanceof DataContextPackage) {
+ // DataContextPackage contextPackage = (DataContextPackage)contextElement;
+ // for(DataContextElement element : contextPackage.getElements()) {
+ // displayFields(element, treeViewer);
+ // }
+ // }
}
private IGenerator getGenerator() {
@@ -308,9 +308,9 @@ public class SelectFieldsPage extends AbstractCreateContextPage {
/**
* Sets the URI of the generated context
- *
+ *
* @param uri
- * The URI of the generated context
+ * The URI of the generated context
*/
public void setTargetURI(List<URI> uri) {
this.targetURI = uri;
@@ -320,7 +320,7 @@ public class SelectFieldsPage extends AbstractCreateContextPage {
public void setVisible(boolean visible) {
super.setPageComplete(true);
super.setVisible(visible);
- if(contexts == null && visible) {
+ if (contexts == null && visible) {
setContexts(getWizard().generator.generate(targetURI));
}
}
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/SelectOutputPage.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/SelectOutputPage.java
index 076ee40edf9..3ad07dde918 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/SelectOutputPage.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/SelectOutputPage.java
@@ -84,13 +84,13 @@ public class SelectOutputPage extends AbstractCreateContextPage implements Liste
@Override
public String getText(Object element) {
- if(element instanceof EPackage) {
- EPackage p = (EPackage)element;
+ if (element instanceof EPackage) {
+ EPackage p = (EPackage) element;
return "Ecore package Name : " + p.getName(); //$NON-NLS-1$
}
- if(element instanceof Package) {
- Package p = (Package)element;
+ if (element instanceof Package) {
+ Package p = (Package) element;
return "Profile name : " + p.getName(); //$NON-NLS-1$
}
return null;
@@ -110,7 +110,7 @@ public class SelectOutputPage extends AbstractCreateContextPage implements Liste
public void handleEvent(Event event) {
- if(combo.getSelectionIndex() != 0) {
+ if (combo.getSelectionIndex() != 0) {
table.setVisible(true);
} else {
@@ -129,7 +129,7 @@ public class SelectOutputPage extends AbstractCreateContextPage implements Liste
public void setVisible(boolean visible) {
super.setVisible(visible);
- if(visible) {
+ if (visible) {
setSelectorData();
}
}
@@ -145,14 +145,14 @@ public class SelectOutputPage extends AbstractCreateContextPage implements Liste
public List<URI> getListPackage(int selection) {
List<URI> list = new ArrayList<URI>();
- if(selection == 0) {
+ if (selection == 0) {
list.add(getWizard().generatorPage.oldURI);
} else {
- for(Object o : viewer.getCheckedElements()) {
- if(o instanceof EPackage) {
- EPackage p = (EPackage)o;
- if(selection == 1) {
+ for (Object o : viewer.getCheckedElements()) {
+ if (o instanceof EPackage) {
+ EPackage p = (EPackage) o;
+ if (selection == 1) {
list.add(getWizard().generatorPage.oldURI);
} else {
String temp = getWizard().generatorPage.oldURI.toString();
@@ -162,9 +162,9 @@ public class SelectOutputPage extends AbstractCreateContextPage implements Liste
}
getWizard().generator.addCheckElement(o);
}
- if(o instanceof Package) {
- Package p = (Package)o;
- if(selection == 1) {
+ if (o instanceof Package) {
+ Package p = (Package) o;
+ if (selection == 1) {
list.add(getWizard().generatorPage.oldURI);
} else {
String temp = getWizard().generatorPage.oldURI.toString();
@@ -183,8 +183,8 @@ public class SelectOutputPage extends AbstractCreateContextPage implements Liste
@Override
public boolean canFlipToNextPage() {
- if(combo.getSelectionIndex() != 0) {
- if(viewer.getCheckedElements().length == 0) {
+ if (combo.getSelectionIndex() != 0) {
+ if (viewer.getCheckedElements().length == 0) {
return false;
}
}
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/widget/ExtensionFilter.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/widget/ExtensionFilter.java
index 6ae0b5cb716..e1fe42399ef 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/widget/ExtensionFilter.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/widget/ExtensionFilter.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2010 CEA LIST.
- *
+ *
* 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
@@ -23,7 +23,7 @@ import org.eclipse.jface.viewers.ViewerFilter;
/**
* A filter for file extensions
- *
+ *
* @author Camille Letavernier
*/
public class ExtensionFilter extends ViewerFilter {
@@ -31,12 +31,12 @@ public class ExtensionFilter extends ViewerFilter {
private Set<String> extensions;
/**
- *
+ *
* Constructs a ViewerFilter that will only accept filenames with one of the
* given extensions
- *
+ *
* @param extensions
- * The authorized extensions
+ * The authorized extensions
*/
public ExtensionFilter(String[] extensions) {
this.extensions = new HashSet<String>(Arrays.asList(extensions));
@@ -44,14 +44,14 @@ public class ExtensionFilter extends ViewerFilter {
@Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
- if(element instanceof IFile) {
- IFile file = (IFile)element;
- for(String ext : extensions) {
- if(file.getFullPath().toString().endsWith(ext)) {
+ if (element instanceof IFile) {
+ IFile file = (IFile) element;
+ for (String ext : extensions) {
+ if (file.getFullPath().toString().endsWith(ext)) {
return true;
}
}
- } else if(element instanceof IProject || element instanceof IFolder) {
+ } else if (element instanceof IProject || element instanceof IFolder) {
return true;
}
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/widget/FileChooser.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/widget/FileChooser.java
index 6fab3c41fe9..04cdd1414af 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/widget/FileChooser.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/widget/FileChooser.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2010 CEA LIST.
- *
+ *
* 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
@@ -36,7 +36,7 @@ import org.eclipse.swt.widgets.Text;
/**
* A Widget for selecting or creating a file in the workspace
- *
+ *
* @author Camille Letavernier
*/
public class FileChooser extends Composite implements SelectionListener, Listener {
@@ -55,12 +55,12 @@ public class FileChooser extends Composite implements SelectionListener, Listene
/**
* Constructs a new FileChooser in the given Composite
- *
+ *
* @param parent
- * The composite in which the FileChooser is created
+ * The composite in which the FileChooser is created
* @param newFile
- * True if the fileChooser allows the user to create a new file,
- * false if he should select an existing one
+ * True if the fileChooser allows the user to create a new file,
+ * false if he should select an existing one
*/
public FileChooser(Composite parent, boolean newFile) {
super(parent, SWT.NONE);
@@ -83,11 +83,11 @@ public class FileChooser extends Composite implements SelectionListener, Listene
* @return the selected file path
*/
public String getFilePath() {
- if(text.isDisposed()) {
+ if (text.isDisposed()) {
return null;
}
String path = text.getText();
- if(path.trim().equals("")) { //$NON-NLS-1$
+ if (path.trim().equals("")) { //$NON-NLS-1$
return null;
}
return path.trim();
@@ -96,7 +96,7 @@ public class FileChooser extends Composite implements SelectionListener, Listene
/**
* Sets the file extensions that this FileChooser accepts
* Files that don't match one of these extensions will be hidden
- *
+ *
* @param extensions
*/
public void setFilterExtensions(String[] extensions) {
@@ -112,7 +112,7 @@ public class FileChooser extends Composite implements SelectionListener, Listene
/**
* Add a listener to this widget. The listener will be notified when the user
* choose a new file
- *
+ *
* @param listener
*/
public void addListener(Listener listener) {
@@ -122,16 +122,16 @@ public class FileChooser extends Composite implements SelectionListener, Listene
public void widgetSelected(SelectionEvent e) {
IFile[] result = new IFile[0];
- if(newFile) {
+ if (newFile) {
IFile file = WorkspaceResourceDialog.openNewFile(getShell(), null, null, null, filters);
- if(file != null) {
- result = new IFile[]{ file };
+ if (file != null) {
+ result = new IFile[] { file };
}
} else {
- result = WorkspaceResourceDialog.openFileSelection(getShell(), null, null, false, new Object[]{ currentFile }, filters);
+ result = WorkspaceResourceDialog.openFileSelection(getShell(), null, null, false, new Object[] { currentFile }, filters);
}
- if(result.length >= 1) {
+ if (result.length >= 1) {
currentFile = result[0];
text.setText(currentFile.getFullPath().toString());
notifyChange();
@@ -139,22 +139,22 @@ public class FileChooser extends Composite implements SelectionListener, Listene
}
private void notifyChange() {
- for(Listener listener : listeners) {
+ for (Listener listener : listeners) {
listener.handleEvent(null);
}
}
public void widgetDefaultSelected(SelectionEvent e) {
- //Nothing
+ // Nothing
}
-
- public IObservableValue getObservableValue(){
- IWidgetValueProperty prop = WidgetProperties.text(SWT.Modify);
- return prop.observeDelayed(600, text);
+
+ public IObservableValue getObservableValue() {
+ IWidgetValueProperty prop = WidgetProperties.text(SWT.Modify);
+ return prop.observeDelayed(600, text);
}
- public void setText(String s){
+ public void setText(String s) {
text.setText(s);
-
+
}
}
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/widget/TernaryButton.java b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/widget/TernaryButton.java
index dc76fb2fb60..f6613aaa6e5 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/widget/TernaryButton.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.generation/src/org/eclipse/papyrus/customization/properties/generation/wizard/widget/TernaryButton.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2010 CEA LIST.
- *
+ *
* 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
@@ -26,11 +26,11 @@ import org.eclipse.swt.widgets.Composite;
* A 3-choices button. The three possible values are "True", "False" or "Default".
* When the choice is "Default", it can be either "Default (True)" or "Default (False)",
* depending on the default value assignated to the button.
- *
+ *
* @see State
- *
+ *
* @author Camille Letavernier
- *
+ *
*/
public class TernaryButton extends Composite implements SelectionListener {
@@ -43,13 +43,13 @@ public class TernaryButton extends Composite implements SelectionListener {
private IObservableValue observable;
/**
- *
+ *
* Constructor.
- *
+ *
* @param parent
- * The parent in which the button is created
+ * The parent in which the button is created
* @param defaultValue
- * The value returned when the "default" value is selected
+ * The value returned when the "default" value is selected
*/
public TernaryButton(Composite parent, boolean defaultValue) {
super(parent, SWT.NONE);
@@ -61,7 +61,7 @@ public class TernaryButton extends Composite implements SelectionListener {
}
public void widgetSelected(SelectionEvent e) {
- switch(state) {
+ switch (state) {
case DEFAULT:
setState(State.TRUE);
break;
@@ -80,9 +80,9 @@ public class TernaryButton extends Composite implements SelectionListener {
* Sets the ObservableValue binded to this widget. The databinding
* is only one-way : modifications on the Observable value won't be
* reflected on the widget.
- *
+ *
* @param value
- * The Observable value to link to this widget
+ * The Observable value to link to this widget
*/
public void setObservable(IObservableValue value) {
this.observable = value;
@@ -90,9 +90,9 @@ public class TernaryButton extends Composite implements SelectionListener {
/**
* Change this button's value
- *
+ *
* @param state
- * The new button's state
+ * The new button's state
*/
public void setState(State state) {
this.state = state;
@@ -116,15 +116,15 @@ public class TernaryButton extends Composite implements SelectionListener {
}
public void widgetDefaultSelected(SelectionEvent e) {
- //Nothing
+ // Nothing
}
/**
* An enum representing the three possible states of the button :
* DEFAULT, TRUE, FALSE
- *
+ *
* @author Camille Letavernier
- *
+ *
*/
public enum State {
/**
@@ -143,12 +143,12 @@ public class TernaryButton extends Composite implements SelectionListener {
/**
* @param defaultValue
- * The value to return if the state is "Default"
+ * The value to return if the state is "Default"
* @return the boolean value of this button. If the State is Default, then
* the default value will be returned.
*/
public boolean getValue(boolean defaultValue) {
- switch(this) {
+ switch (this) {
case DEFAULT:
return defaultValue;
case TRUE:
@@ -157,23 +157,23 @@ public class TernaryButton extends Composite implements SelectionListener {
return false;
}
- //Cannot happen as the switch is exhaustive
+ // Cannot happen as the switch is exhaustive
throw new RuntimeException();
}
/**
* Return the image corresponding to the current state. If the state
* is "Default", the image will depend on the given defaultValue
- *
+ *
* @param defaultValue
- * The value to use if the State is "Default"
+ * The value to use if the State is "Default"
* @return
* The image corresponding to the current State
*/
public Image getImage(boolean defaultValue) {
- switch(this) {
+ switch (this) {
case DEFAULT:
- if(defaultValue) {
+ if (defaultValue) {
return Activator.getDefault().getImage("/icons/default_true.gif"); //$NON-NLS-1$
} else {
return Activator.getDefault().getImage("/icons/default_false.gif"); //$NON-NLS-1$
@@ -184,23 +184,23 @@ public class TernaryButton extends Composite implements SelectionListener {
return Activator.getDefault().getImage("/icons/false.gif"); //$NON-NLS-1$
}
- //Cannot happen as the switch is exhaustive
+ // Cannot happen as the switch is exhaustive
throw new RuntimeException();
}
/**
* Return the text corresponding to the current state. If the state
* is "Default", the text will depend on the given defaultValue
- *
+ *
* @param defaultValue
- * The value to use if the State is "Default"
+ * The value to use if the State is "Default"
* @return
* The text corresponding to the current State
*/
public String getText(boolean defaultValue) {
- switch(this) {
+ switch (this) {
case DEFAULT:
- if(defaultValue) {
+ if (defaultValue) {
return Messages.TernaryButton_defaultTrue;
} else {
return Messages.TernaryButton_defaultFalse;
@@ -211,7 +211,7 @@ public class TernaryButton extends Composite implements SelectionListener {
return Messages.TernaryButton_false;
}
- //Cannot happen as the switch is exhaustive
+ // Cannot happen as the switch is exhaustive
throw new RuntimeException();
}
}
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src-gen/org/eclipse/papyrus/customization/properties/model/xwt/xwtxml/Attribute.java b/plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src-gen/org/eclipse/papyrus/customization/properties/model/xwt/xwtxml/Attribute.java
index eb63011f09a..286f1c57376 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src-gen/org/eclipse/papyrus/customization/properties/model/xwt/xwtxml/Attribute.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src-gen/org/eclipse/papyrus/customization/properties/model/xwt/xwtxml/Attribute.java
@@ -5,9 +5,9 @@
* 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:
- *
+ *
* Fabien Giquel (Mia-Software) - initial API and implementation
* *******************************************************************************
*
@@ -23,7 +23,7 @@ package org.eclipse.papyrus.customization.properties.model.xwt.xwtxml;
* <p>
* The following features are supported:
* <ul>
- * <li>{@link org.eclipse.papyrus.customization.properties.model.xwt.xwtxml.Attribute#getValue <em>Value</em>}</li>
+ * <li>{@link org.eclipse.papyrus.customization.properties.model.xwt.xwtxml.Attribute#getValue <em>Value</em>}</li>
* </ul>
* </p>
*
@@ -36,10 +36,10 @@ public interface Attribute extends Node {
* Returns the value of the '<em><b>Value</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
- * If the meaning of the '<em>Value</em>' attribute isn't clear,
- * there really should be more of a description here...
+ * If the meaning of the '<em>Value</em>' attribute isn't clear, there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
+ *
* @return the value of the '<em>Value</em>' attribute.
* @see #setValue(String)
* @see org.eclipse.papyrus.customization.properties.model.xwt.xwtxml.XwtxmlPackage#getAttribute_Value()
@@ -52,7 +52,9 @@ public interface Attribute extends Node {
* Sets the value of the '{@link org.eclipse.papyrus.customization.properties.model.xwt.xwtxml.Attribute#getValue <em>Value</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @param value the new value of the '<em>Value</em>' attribute.
+ *
+ * @param value
+ * the new value of the '<em>Value</em>' attribute.
* @see #getValue()
* @generated
*/
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src-gen/org/eclipse/papyrus/customization/properties/model/xwt/xwtxml/CDATA.java b/plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src-gen/org/eclipse/papyrus/customization/properties/model/xwt/xwtxml/CDATA.java
index 0249bc29e42..92c6197c520 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src-gen/org/eclipse/papyrus/customization/properties/model/xwt/xwtxml/CDATA.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src-gen/org/eclipse/papyrus/customization/properties/model/xwt/xwtxml/CDATA.java
@@ -5,9 +5,9 @@
* 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:
- *
+ *
* Fabien Giquel (Mia-Software) - initial API and implementation
* *******************************************************************************
*
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src-gen/org/eclipse/papyrus/customization/properties/model/xwt/xwtxml/Comment.java b/plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src-gen/org/eclipse/papyrus/customization/properties/model/xwt/xwtxml/Comment.java
index b00b781246c..3a8201b4aa9 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src-gen/org/eclipse/papyrus/customization/properties/model/xwt/xwtxml/Comment.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src-gen/org/eclipse/papyrus/customization/properties/model/xwt/xwtxml/Comment.java
@@ -5,9 +5,9 @@
* 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:
- *
+ *
* Fabien Giquel (Mia-Software) - initial API and implementation
* *******************************************************************************
*
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src-gen/org/eclipse/papyrus/customization/properties/model/xwt/xwtxml/DocumentTypeDeclaration.java b/plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src-gen/org/eclipse/papyrus/customization/properties/model/xwt/xwtxml/DocumentTypeDeclaration.java
index 8800e7a4535..974c33dbbe8 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src-gen/org/eclipse/papyrus/customization/properties/model/xwt/xwtxml/DocumentTypeDeclaration.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src-gen/org/eclipse/papyrus/customization/properties/model/xwt/xwtxml/DocumentTypeDeclaration.java
@@ -5,9 +5,9 @@
* 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:
- *
+ *
* Fabien Giquel (Mia-Software) - initial API and implementation
* *******************************************************************************