Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2012-01-14 10:27:01 +0000
committerEike Stepper2012-01-14 10:27:01 +0000
commit0266166cb9ff9535c150250073ea1e57b42d2693 (patch)
treec006a3bc0ba1f6e1d8a2bc032eedc346f71eab0d /plugins/org.eclipse.emf.cdo.ui.ide
parent7416443692cdda72d1f704ea4fc5ececcc669df7 (diff)
downloadcdo-0266166cb9ff9535c150250073ea1e57b42d2693.tar.gz
cdo-0266166cb9ff9535c150250073ea1e57b42d2693.tar.xz
cdo-0266166cb9ff9535c150250073ea1e57b42d2693.zip
Adjusted copyrights to 2012
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.ui.ide')
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/.settings/org.eclipse.jdt.ui.prefs240
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/build.properties54
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/copyright.txt14
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/plugin.properties86
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/plugin.xml470
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/ide/CommonNavigatorUtils.java250
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/ide/Node.java582
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/ide/RepositoryContentProvider.java1090
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/ide/RepositoryLabelProvider.java236
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/ide/package-info.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/ChangeViewTargetActionDelegate.java76
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/CreateBranchActionDelegate.java178
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/DisconnectActionDelegate.java116
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/ExportResourceActionDelegate.java220
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/ImportResourceActionDelegate.java200
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/ManagePackagesActionDelegate.java78
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/NewResourceActionDelegate.java66
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/NewResourceFolderActionDelegate.java66
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/NewResourceNodeActionDelegate.java158
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/RegisterFileSystemPackageActionDelegate.java60
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/RegisterWorkspacePackageActionDelegate.java60
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/RemoveResourceActionDelegate.java306
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/RenameResourceNodeActionDelegate.java156
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/SessionAwareActionDelegate.java84
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/SwitchToBranchActionDelegate.java70
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/TransactionalBackgroundActionDelegate.java266
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/ViewAwareActionDelegate.java84
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/bundle/OM.java120
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/messages/Messages.java80
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/messages/messages.properties94
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/wizards/CDOProjectCreationWizard.java466
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/wizards/CDOShareProjectWizardPage.java156
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/wizards/TeamConfigurationWizard.java148
33 files changed, 3166 insertions, 3166 deletions
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/.settings/org.eclipse.jdt.ui.prefs b/plugins/org.eclipse.emf.cdo.ui.ide/.settings/org.eclipse.jdt.ui.prefs
index aaef0ccba1..6726e7034a 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/.settings/org.eclipse.jdt.ui.prefs
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/.settings/org.eclipse.jdt.ui.prefs
@@ -1,120 +1,120 @@
-#Thu Feb 04 09:44:24 CET 2010
-cleanup.add_default_serial_version_id=true
-cleanup.add_generated_serial_version_id=false
-cleanup.add_missing_annotations=true
-cleanup.add_missing_deprecated_annotations=true
-cleanup.add_missing_methods=false
-cleanup.add_missing_nls_tags=false
-cleanup.add_missing_override_annotations=true
-cleanup.add_missing_override_annotations_interface_methods=true
-cleanup.add_serial_version_id=true
-cleanup.always_use_blocks=true
-cleanup.always_use_parentheses_in_expressions=false
-cleanup.always_use_this_for_non_static_field_access=false
-cleanup.always_use_this_for_non_static_method_access=false
-cleanup.convert_to_enhanced_for_loop=false
-cleanup.correct_indentation=true
-cleanup.format_source_code=true
-cleanup.format_source_code_changes_only=false
-cleanup.make_local_variable_final=true
-cleanup.make_parameters_final=false
-cleanup.make_private_fields_final=true
-cleanup.make_type_abstract_if_missing_method=false
-cleanup.make_variable_declarations_final=false
-cleanup.never_use_blocks=false
-cleanup.never_use_parentheses_in_expressions=true
-cleanup.organize_imports=true
-cleanup.qualify_static_field_accesses_with_declaring_class=false
-cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
-cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
-cleanup.qualify_static_member_accesses_with_declaring_class=false
-cleanup.qualify_static_method_accesses_with_declaring_class=false
-cleanup.remove_private_constructors=true
-cleanup.remove_trailing_whitespaces=true
-cleanup.remove_trailing_whitespaces_all=true
-cleanup.remove_trailing_whitespaces_ignore_empty=false
-cleanup.remove_unnecessary_casts=true
-cleanup.remove_unnecessary_nls_tags=true
-cleanup.remove_unused_imports=true
-cleanup.remove_unused_local_variables=false
-cleanup.remove_unused_private_fields=true
-cleanup.remove_unused_private_members=false
-cleanup.remove_unused_private_methods=true
-cleanup.remove_unused_private_types=true
-cleanup.sort_members=false
-cleanup.sort_members_all=false
-cleanup.use_blocks=true
-cleanup.use_blocks_only_for_return_and_throw=false
-cleanup.use_parentheses_in_expressions=true
-cleanup.use_this_for_non_static_field_access=true
-cleanup.use_this_for_non_static_field_access_only_if_necessary=true
-cleanup.use_this_for_non_static_method_access=true
-cleanup.use_this_for_non_static_method_access_only_if_necessary=true
-cleanup_profile=_EMFT
-cleanup_settings_version=2
-eclipse.preferences.version=1
-editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
-formatter_profile=_EMFT
-formatter_settings_version=11
-org.eclipse.jdt.ui.exception.name=ex
-org.eclipse.jdt.ui.gettersetter.use.is=true
-org.eclipse.jdt.ui.ignorelowercasenames=true
-org.eclipse.jdt.ui.importorder=org.eclipse.emf.cdo;org.eclipse.emf.internal.cdo;org.eclipse.net4j;org.eclipse.internal.net4j;org.eclipse.emf;org.eclipse;com;org;javax;java;
-org.eclipse.jdt.ui.javadoc=true
-org.eclipse.jdt.ui.keywordthis=false
-org.eclipse.jdt.ui.ondemandthreshold=99
-org.eclipse.jdt.ui.overrideannotation=true
-org.eclipse.jdt.ui.staticondemandthreshold=99
-org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="false" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment"/><template autoinsert\="false" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment"/><template autoinsert\="false" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment"/><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*\r\n * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.\r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http\://www.eclipse.org/legal/epl-v10.html\r\n * \r\n * Contributors\:\r\n * Eike Stepper - initial API and implementation\r\n */</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * @author Eike Stepper\r\n */</template><template autoinsert\="false" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment"/><template autoinsert\="false" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment"/><template autoinsert\="false" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment"/><template autoinsert\="false" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment"/><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\r\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\r\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">${exception_var}.printStackTrace();</template><template autoinsert\="false" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">${body_statement}</template><template autoinsert\="false" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
-sp_cleanup.add_default_serial_version_id=true
-sp_cleanup.add_generated_serial_version_id=false
-sp_cleanup.add_missing_annotations=true
-sp_cleanup.add_missing_deprecated_annotations=true
-sp_cleanup.add_missing_methods=false
-sp_cleanup.add_missing_nls_tags=false
-sp_cleanup.add_missing_override_annotations=true
-sp_cleanup.add_missing_override_annotations_interface_methods=false
-sp_cleanup.add_serial_version_id=false
-sp_cleanup.always_use_blocks=true
-sp_cleanup.always_use_parentheses_in_expressions=false
-sp_cleanup.always_use_this_for_non_static_field_access=false
-sp_cleanup.always_use_this_for_non_static_method_access=false
-sp_cleanup.convert_to_enhanced_for_loop=false
-sp_cleanup.correct_indentation=true
-sp_cleanup.format_source_code=true
-sp_cleanup.format_source_code_changes_only=false
-sp_cleanup.make_local_variable_final=false
-sp_cleanup.make_parameters_final=false
-sp_cleanup.make_private_fields_final=true
-sp_cleanup.make_type_abstract_if_missing_method=false
-sp_cleanup.make_variable_declarations_final=false
-sp_cleanup.never_use_blocks=false
-sp_cleanup.never_use_parentheses_in_expressions=true
-sp_cleanup.on_save_use_additional_actions=true
-sp_cleanup.organize_imports=true
-sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
-sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
-sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
-sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
-sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
-sp_cleanup.remove_private_constructors=true
-sp_cleanup.remove_trailing_whitespaces=true
-sp_cleanup.remove_trailing_whitespaces_all=true
-sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
-sp_cleanup.remove_unnecessary_casts=true
-sp_cleanup.remove_unnecessary_nls_tags=true
-sp_cleanup.remove_unused_imports=true
-sp_cleanup.remove_unused_local_variables=false
-sp_cleanup.remove_unused_private_fields=true
-sp_cleanup.remove_unused_private_members=false
-sp_cleanup.remove_unused_private_methods=true
-sp_cleanup.remove_unused_private_types=true
-sp_cleanup.sort_members=false
-sp_cleanup.sort_members_all=false
-sp_cleanup.use_blocks=true
-sp_cleanup.use_blocks_only_for_return_and_throw=false
-sp_cleanup.use_parentheses_in_expressions=true
-sp_cleanup.use_this_for_non_static_field_access=true
-sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
-sp_cleanup.use_this_for_non_static_method_access=true
-sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+#Thu Feb 04 09:44:24 CET 2010
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_missing_override_annotations_interface_methods=true
+cleanup.add_serial_version_id=true
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_to_enhanced_for_loop=false
+cleanup.correct_indentation=true
+cleanup.format_source_code=true
+cleanup.format_source_code_changes_only=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=false
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=false
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.organize_imports=true
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=false
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_trailing_whitespaces=true
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.use_blocks=true
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_parentheses_in_expressions=true
+cleanup.use_this_for_non_static_field_access=true
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=true
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup_profile=_EMFT
+cleanup_settings_version=2
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=_EMFT
+formatter_settings_version=11
+org.eclipse.jdt.ui.exception.name=ex
+org.eclipse.jdt.ui.gettersetter.use.is=true
+org.eclipse.jdt.ui.ignorelowercasenames=true
+org.eclipse.jdt.ui.importorder=org.eclipse.emf.cdo;org.eclipse.emf.internal.cdo;org.eclipse.net4j;org.eclipse.internal.net4j;org.eclipse.emf;org.eclipse;com;org;javax;java;
+org.eclipse.jdt.ui.javadoc=true
+org.eclipse.jdt.ui.keywordthis=false
+org.eclipse.jdt.ui.ondemandthreshold=99
+org.eclipse.jdt.ui.overrideannotation=true
+org.eclipse.jdt.ui.staticondemandthreshold=99
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="false" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment"/><template autoinsert\="false" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment"/><template autoinsert\="false" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment"/><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*\r\n * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.\r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http\://www.eclipse.org/legal/epl-v10.html\r\n * \r\n * Contributors\:\r\n * Eike Stepper - initial API and implementation\r\n */</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * @author Eike Stepper\r\n */</template><template autoinsert\="false" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment"/><template autoinsert\="false" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment"/><template autoinsert\="false" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment"/><template autoinsert\="false" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment"/><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\r\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\r\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">${exception_var}.printStackTrace();</template><template autoinsert\="false" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">${body_statement}</template><template autoinsert\="false" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=false
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=true
+sp_cleanup.format_source_code=true
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.make_local_variable_final=false
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=true
+sp_cleanup.remove_unused_imports=true
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_blocks=true
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_parentheses_in_expressions=true
+sp_cleanup.use_this_for_non_static_field_access=true
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=true
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/build.properties b/plugins/org.eclipse.emf.cdo.ui.ide/build.properties
index 83553b45f3..62f2ad2c66 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/build.properties
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/build.properties
@@ -1,27 +1,27 @@
-# Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Eike Stepper - initial API and implementation
-
-# NLS_MESSAGEFORMAT_VAR
-
-bin.includes = .,\
- icons/,\
- META-INF/,\
- plugin.xml,\
- plugin.properties,\
- about.html,\
- copyright.txt,\
- .options
-jars.compile.order = .
-source.. = src/
-output.. = bin/
-src.includes = about.html,\
- copyright.txt,\
- IDE.launch
-
-doc.project = org.eclipse.emf.cdo.doc
+# Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Eike Stepper - initial API and implementation
+
+# NLS_MESSAGEFORMAT_VAR
+
+bin.includes = .,\
+ icons/,\
+ META-INF/,\
+ plugin.xml,\
+ plugin.properties,\
+ about.html,\
+ copyright.txt,\
+ .options
+jars.compile.order = .
+source.. = src/
+output.. = bin/
+src.includes = about.html,\
+ copyright.txt,\
+ IDE.launch
+
+doc.project = org.eclipse.emf.cdo.doc
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/copyright.txt b/plugins/org.eclipse.emf.cdo.ui.ide/copyright.txt
index e921242cf0..8f6328980e 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/copyright.txt
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/copyright.txt
@@ -1,8 +1,8 @@
-Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
-All rights reserved. This program and the accompanying materials
-are made available under the terms of the Eclipse Public License v1.0
-which accompanies this distribution, and is available at
-http://www.eclipse.org/legal/epl-v10.html
-
-Contributors:
+Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Eclipse Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/epl-v10.html
+
+Contributors:
Eike Stepper - initial API and implementation \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/plugin.properties b/plugins/org.eclipse.emf.cdo.ui.ide/plugin.properties
index 0b536d52b8..366830a798 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/plugin.properties
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/plugin.properties
@@ -1,44 +1,44 @@
-# Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Eike Stepper - initial API and implementation
-
-pluginName = CDO Model Repository Client UI IDE
-providerName = Eclipse Modeling Project
-
-wizard.name = CDO
-navigatorContent.name = CDO Repository Content
-action.label = Disconnect
-action.label.0 = New Resource...
-action.label.1 = New Folder...
-action.label.2 = Remove
-action.label.3 = New Resource...
-action.label.4 = New Folder...
-action.tooltip = Creates a new resource in the selected container
-action.tooltip.0 = Creates a new folder in the selected container
-action.tooltip.1 = Removes the selected Node
-action.tooltip.2 = Creates a new resource in the selected container
-action.tooltip.3 = Creates a new folder in the selected container
-action.label.5 = Show Package Registry...
-action.tooltip.4 = Open the Package Manager...
-action.label.6 = Register Filesystem Packages...
-action.tooltip.5 = Register a model by browsing the file system
-action.label.7 = Register Workspace Packages...
-action.tooltip.6 = Register a model by browsing the workspace
-action.label.8 = Import...
-action.tooltip.7 = Imports an external resource into the repository root
-action.label.9 = Import...
-action.tooltip.8 = Imports an external resource into the selected folder
-action.label.10 = Export...
-action.label.11 = New Branch...
-action.tooltip.9 = Creates a new sub branch of the selected branch
-action.label.12 = Switch To
-action.tooltip.10 = Switches the project to the selected branch
-wizard.name.0 = CDO Project
-action.label.13 = Rename...
-action.tooltip.11 = Change the name of this resource node
+# Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Eike Stepper - initial API and implementation
+
+pluginName = CDO Model Repository Client UI IDE
+providerName = Eclipse Modeling Project
+
+wizard.name = CDO
+navigatorContent.name = CDO Repository Content
+action.label = Disconnect
+action.label.0 = New Resource...
+action.label.1 = New Folder...
+action.label.2 = Remove
+action.label.3 = New Resource...
+action.label.4 = New Folder...
+action.tooltip = Creates a new resource in the selected container
+action.tooltip.0 = Creates a new folder in the selected container
+action.tooltip.1 = Removes the selected Node
+action.tooltip.2 = Creates a new resource in the selected container
+action.tooltip.3 = Creates a new folder in the selected container
+action.label.5 = Show Package Registry...
+action.tooltip.4 = Open the Package Manager...
+action.label.6 = Register Filesystem Packages...
+action.tooltip.5 = Register a model by browsing the file system
+action.label.7 = Register Workspace Packages...
+action.tooltip.6 = Register a model by browsing the workspace
+action.label.8 = Import...
+action.tooltip.7 = Imports an external resource into the repository root
+action.label.9 = Import...
+action.tooltip.8 = Imports an external resource into the selected folder
+action.label.10 = Export...
+action.label.11 = New Branch...
+action.tooltip.9 = Creates a new sub branch of the selected branch
+action.label.12 = Switch To
+action.tooltip.10 = Switches the project to the selected branch
+wizard.name.0 = CDO Project
+action.label.13 = Rename...
+action.tooltip.11 = Change the name of this resource node
action.label.14 = Switch to Another Branch or Version... \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/plugin.xml b/plugins/org.eclipse.emf.cdo.ui.ide/plugin.xml
index 19454ba6a8..0a31c046bb 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/plugin.xml
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/plugin.xml
@@ -1,235 +1,235 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<!--
- Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- All rights reserved. This program and the accompanying materials
- are made available under the terms of the Eclipse Public License v1.0
- which accompanies this distribution, and is available at
- http://www.eclipse.org/legal/epl-v10.html
-
- Contributors:
- Eike Stepper - initial API and implementation
--->
-
-<plugin>
-
- <extension
- point="org.eclipse.team.ui.configurationWizards">
- <wizard
- class="org.eclipse.emf.cdo.ui.internal.ide.wizards.TeamConfigurationWizard"
- icon="icons/full/obj16/CDOResource.gif"
- id="org.eclipse.emf.cdo.ui.ide.TeamConfigurationWizard"
- name="%wizard.name">
- </wizard>
- </extension>
-
- <extension
- point="org.eclipse.ui.navigator.navigatorContent">
- <navigatorContent
- activeByDefault="true"
- contentProvider="org.eclipse.emf.cdo.ui.ide.RepositoryContentProvider"
- icon="icons/full/obj16/repository_content.gif"
- id="org.eclipse.emf.cdo.ui.ide.RepositoryContent"
- labelProvider="org.eclipse.emf.cdo.ui.ide.RepositoryLabelProvider"
- name="%navigatorContent.name"
- priority="normal"
- providesSaveables="false">
- <triggerPoints>
- <or>
- <adapt
- type="org.eclipse.core.resources.IProject">
- <test
- args="org.eclipse.team.core.repository,org.eclipse.emf.cdo.team.TeamProvider"
- property="org.eclipse.core.resources.projectPersistentProperty">
- </test>
- </adapt>
- <instanceof
- value="org.eclipse.emf.cdo.ui.ide.Node">
- </instanceof>
- <instanceof
- value="org.eclipse.emf.ecore.EObject">
- </instanceof>
- </or>
- </triggerPoints>
- </navigatorContent>
- </extension>
-
- <extension
- point="org.eclipse.ui.navigator.viewer">
- <viewerContentBinding
- viewerId="org.eclipse.ui.navigator.ProjectExplorer">
- <includes>
- <contentExtension
- isRoot="false"
- pattern="org.eclipse.emf.cdo.ui.ide.RepositoryContent">
- </contentExtension>
- </includes>
- </viewerContentBinding>
- </extension>
-
- <extension
- point="org.eclipse.ui.popupMenus">
- <objectContribution
- adaptable="true"
- id="org.eclipse.emf.cdo.ui.ide.IProjectContributions"
- objectClass="org.eclipse.core.resources.IProject">
- <filter
- name="projectPersistentProperty"
- value="org.eclipse.team.core.repository=org.eclipse.emf.cdo.team.TeamProvider">
- </filter>
- <action
- class="org.eclipse.emf.cdo.ui.internal.ide.actions.DisconnectActionDelegate"
- id="org.eclipse.emf.cdo.ui.ide.DisconnectAction"
- label="%action.label"
- menubarPath="team.main/projectGroup">
- </action>
- </objectContribution>
- <objectContribution
- adaptable="true"
- id="org.eclipse.emf.cdo.ui.ide.ResourcesNodeContributions"
- objectClass="org.eclipse.emf.cdo.ui.ide.Node$ResourcesNode">
- <action
- class="org.eclipse.emf.cdo.ui.internal.ide.actions.ImportResourceActionDelegate"
- icon="icons/full/elcl16/import_wiz.gif"
- id="org.eclipse.emf.cdo.ui.ide.resourceNodeImportResource"
- label="%action.label.8"
- tooltip="%action.tooltip.7">
- </action>
- <action
- class="org.eclipse.emf.cdo.ui.internal.ide.actions.NewResourceFolderActionDelegate"
- icon="icons/full/elcl16/NewCDOResourceFolder.gif"
- id="org.eclipse.emf.cdo.ui.ide.resourceNodeNewResourceFolderAction"
- label="%action.label.1"
- tooltip="%action.tooltip.0">
- </action>
- <action
- class="org.eclipse.emf.cdo.ui.internal.ide.actions.NewResourceActionDelegate"
- icon="icons/full/elcl16/NewCDOResource.gif"
- id="org.eclipse.emf.cdo.ui.ide.resourceNodeCreateResourceAction"
- label="%action.label.0"
- tooltip="%action.tooltip">
- </action>
- <action
- class="org.eclipse.emf.cdo.ui.internal.ide.actions.ChangeViewTargetActionDelegate"
- id="org.eclipse.emf.cdo.ui.ide.changeViewTarget"
- label="%action.label.14">
- </action>
- </objectContribution>
- <objectContribution
- adaptable="true"
- id="org.eclipse.emf.cdo.ui.ide.CDOResourceNodeContributions"
- objectClass="org.eclipse.emf.cdo.eresource.CDOResourceNode">
- <action
- class="org.eclipse.emf.cdo.ui.internal.ide.actions.RemoveResourceActionDelegate"
- icon="icons/full/elcl16/delete_edit.gif"
- id="org.eclipse.emf.cdo.ui.ide.removeResourceNodeAction"
- label="%action.label.2"
- tooltip="%action.tooltip.1">
- </action>
- <action
- class="org.eclipse.emf.cdo.ui.internal.ide.actions.RenameResourceNodeActionDelegate"
- id="org.eclipse.emf.cdo.ui.ide.renameResourceNodeAction"
- label="%action.label.13"
- tooltip="%action.tooltip.11">
- </action>
- </objectContribution>
- <objectContribution
- adaptable="true"
- id="org.eclipse.emf.cdo.ui.ide.CDOResourceFolderContributions"
- objectClass="org.eclipse.emf.cdo.eresource.CDOResourceFolder">
- <action
- class="org.eclipse.emf.cdo.ui.internal.ide.actions.ImportResourceActionDelegate"
- icon="icons/full/elcl16/import_wiz.gif"
- id="org.eclipse.emf.cdo.ui.ide.importResource"
- label="%action.label.9"
- tooltip="%action.tooltip.8">
- </action>
- <action
- class="org.eclipse.emf.cdo.ui.internal.ide.actions.NewResourceFolderActionDelegate"
- icon="icons/full/elcl16/NewCDOResourceFolder.gif"
- id="org.eclipse.emf.cdo.ui.ide.newResourceFolderAction"
- label="%action.label.4"
- tooltip="%action.tooltip.3">
- </action>
- <action
- class="org.eclipse.emf.cdo.ui.internal.ide.actions.NewResourceActionDelegate"
- icon="icons/full/elcl16/NewCDOResource.gif"
- id="org.eclipse.emf.cdo.ui.ide.createResourceAction"
- label="%action.label.3"
- tooltip="%action.tooltip.2">
- </action>
- </objectContribution>
- <objectContribution
- adaptable="false"
- id="org.eclipse.emf.cdo.ui.ide.PackageNodeActions"
- objectClass="org.eclipse.emf.cdo.ui.ide.Node$PackagesNode">
- <action
- class="org.eclipse.emf.cdo.ui.internal.ide.actions.ManagePackagesActionDelegate"
- icon="icons/full/elcl16/EPackageIcon.gif"
- id="org.eclipse.emf.cdo.ui.ide.managePackages"
- label="%action.label.5"
- tooltip="%action.tooltip.4">
- </action>
- <action
- class="org.eclipse.emf.cdo.ui.internal.ide.actions.RegisterFileSystemPackageActionDelegate"
- icon="icons/full/elcl16/FileSystemIcon.gif"
- id="org.eclipse.emf.cdo.ui.ide.registerFilesystemPackage"
- label="%action.label.6"
- tooltip="%action.tooltip.5">
- </action>
- <action
- class="org.eclipse.emf.cdo.ui.internal.ide.actions.RegisterWorkspacePackageActionDelegate"
- icon="icons/full/elcl16/EcoreModelFile.gif"
- id="org.eclipse.emf.cdo.ui.ide.registerWorkspacePackage"
- label="%action.label.7"
- tooltip="%action.tooltip.6">
- </action>
- </objectContribution>
- <objectContribution
- adaptable="false"
- id="org.eclipse.emf.cdo.ui.ide.CDOResourceActionContribution"
- objectClass="org.eclipse.emf.cdo.eresource.CDOResource">
- <action
- class="org.eclipse.emf.cdo.ui.internal.ide.actions.ExportResourceActionDelegate"
- icon="icons/full/elcl16/export_wiz.gif"
- id="org.eclipse.emf.cdo.ui.ide.exportResource"
- label="%action.label.10">
- </action>
- </objectContribution>
- <objectContribution
- adaptable="false"
- id="org.eclipse.emf.cdo.ui.ide.BranchesNodeActions"
- objectClass="org.eclipse.emf.cdo.ui.ide.Node$BranchNode">
- <action
- class="org.eclipse.emf.cdo.ui.internal.ide.actions.SwitchToBranchActionDelegate"
- icon="icons/full/obj16/switch.png"
- id="org.eclipse.emf.cdo.ui.ide.switchToBranchAction"
- label="%action.label.12"
- tooltip="%action.tooltip.10">
- </action>
- <action
- class="org.eclipse.emf.cdo.ui.internal.ide.actions.CreateBranchActionDelegate"
- icon="icons/full/obj16/fork.png"
- id="org.eclipse.emf.cdo.ui.ide.createNewBranchAction"
- label="%action.label.11"
- tooltip="%action.tooltip.9">
- </action>
- </objectContribution>
- </extension>
-
- <extension
- point="org.eclipse.ui.newWizards">
- <wizard
- canFinishEarly="false"
- class="org.eclipse.emf.cdo.ui.internal.ide.wizards.CDOProjectCreationWizard"
- finalPerspective="org.eclipse.emf.cdo.ui.CDOExplorerPerspective"
- hasPages="true"
- icon="icons/full/obj16/repository_content.gif"
- id="org.eclipse.emf.cdo.ui.ide.createSharedProject"
- name="%wizard.name.0"
- preferredPerspectives="org.eclipse.ui.resourcePerspective"
- project="true">
- </wizard>
- </extension>
-
-</plugin>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<!--
+ Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Eike Stepper - initial API and implementation
+-->
+
+<plugin>
+
+ <extension
+ point="org.eclipse.team.ui.configurationWizards">
+ <wizard
+ class="org.eclipse.emf.cdo.ui.internal.ide.wizards.TeamConfigurationWizard"
+ icon="icons/full/obj16/CDOResource.gif"
+ id="org.eclipse.emf.cdo.ui.ide.TeamConfigurationWizard"
+ name="%wizard.name">
+ </wizard>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.navigator.navigatorContent">
+ <navigatorContent
+ activeByDefault="true"
+ contentProvider="org.eclipse.emf.cdo.ui.ide.RepositoryContentProvider"
+ icon="icons/full/obj16/repository_content.gif"
+ id="org.eclipse.emf.cdo.ui.ide.RepositoryContent"
+ labelProvider="org.eclipse.emf.cdo.ui.ide.RepositoryLabelProvider"
+ name="%navigatorContent.name"
+ priority="normal"
+ providesSaveables="false">
+ <triggerPoints>
+ <or>
+ <adapt
+ type="org.eclipse.core.resources.IProject">
+ <test
+ args="org.eclipse.team.core.repository,org.eclipse.emf.cdo.team.TeamProvider"
+ property="org.eclipse.core.resources.projectPersistentProperty">
+ </test>
+ </adapt>
+ <instanceof
+ value="org.eclipse.emf.cdo.ui.ide.Node">
+ </instanceof>
+ <instanceof
+ value="org.eclipse.emf.ecore.EObject">
+ </instanceof>
+ </or>
+ </triggerPoints>
+ </navigatorContent>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.navigator.viewer">
+ <viewerContentBinding
+ viewerId="org.eclipse.ui.navigator.ProjectExplorer">
+ <includes>
+ <contentExtension
+ isRoot="false"
+ pattern="org.eclipse.emf.cdo.ui.ide.RepositoryContent">
+ </contentExtension>
+ </includes>
+ </viewerContentBinding>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.popupMenus">
+ <objectContribution
+ adaptable="true"
+ id="org.eclipse.emf.cdo.ui.ide.IProjectContributions"
+ objectClass="org.eclipse.core.resources.IProject">
+ <filter
+ name="projectPersistentProperty"
+ value="org.eclipse.team.core.repository=org.eclipse.emf.cdo.team.TeamProvider">
+ </filter>
+ <action
+ class="org.eclipse.emf.cdo.ui.internal.ide.actions.DisconnectActionDelegate"
+ id="org.eclipse.emf.cdo.ui.ide.DisconnectAction"
+ label="%action.label"
+ menubarPath="team.main/projectGroup">
+ </action>
+ </objectContribution>
+ <objectContribution
+ adaptable="true"
+ id="org.eclipse.emf.cdo.ui.ide.ResourcesNodeContributions"
+ objectClass="org.eclipse.emf.cdo.ui.ide.Node$ResourcesNode">
+ <action
+ class="org.eclipse.emf.cdo.ui.internal.ide.actions.ImportResourceActionDelegate"
+ icon="icons/full/elcl16/import_wiz.gif"
+ id="org.eclipse.emf.cdo.ui.ide.resourceNodeImportResource"
+ label="%action.label.8"
+ tooltip="%action.tooltip.7">
+ </action>
+ <action
+ class="org.eclipse.emf.cdo.ui.internal.ide.actions.NewResourceFolderActionDelegate"
+ icon="icons/full/elcl16/NewCDOResourceFolder.gif"
+ id="org.eclipse.emf.cdo.ui.ide.resourceNodeNewResourceFolderAction"
+ label="%action.label.1"
+ tooltip="%action.tooltip.0">
+ </action>
+ <action
+ class="org.eclipse.emf.cdo.ui.internal.ide.actions.NewResourceActionDelegate"
+ icon="icons/full/elcl16/NewCDOResource.gif"
+ id="org.eclipse.emf.cdo.ui.ide.resourceNodeCreateResourceAction"
+ label="%action.label.0"
+ tooltip="%action.tooltip">
+ </action>
+ <action
+ class="org.eclipse.emf.cdo.ui.internal.ide.actions.ChangeViewTargetActionDelegate"
+ id="org.eclipse.emf.cdo.ui.ide.changeViewTarget"
+ label="%action.label.14">
+ </action>
+ </objectContribution>
+ <objectContribution
+ adaptable="true"
+ id="org.eclipse.emf.cdo.ui.ide.CDOResourceNodeContributions"
+ objectClass="org.eclipse.emf.cdo.eresource.CDOResourceNode">
+ <action
+ class="org.eclipse.emf.cdo.ui.internal.ide.actions.RemoveResourceActionDelegate"
+ icon="icons/full/elcl16/delete_edit.gif"
+ id="org.eclipse.emf.cdo.ui.ide.removeResourceNodeAction"
+ label="%action.label.2"
+ tooltip="%action.tooltip.1">
+ </action>
+ <action
+ class="org.eclipse.emf.cdo.ui.internal.ide.actions.RenameResourceNodeActionDelegate"
+ id="org.eclipse.emf.cdo.ui.ide.renameResourceNodeAction"
+ label="%action.label.13"
+ tooltip="%action.tooltip.11">
+ </action>
+ </objectContribution>
+ <objectContribution
+ adaptable="true"
+ id="org.eclipse.emf.cdo.ui.ide.CDOResourceFolderContributions"
+ objectClass="org.eclipse.emf.cdo.eresource.CDOResourceFolder">
+ <action
+ class="org.eclipse.emf.cdo.ui.internal.ide.actions.ImportResourceActionDelegate"
+ icon="icons/full/elcl16/import_wiz.gif"
+ id="org.eclipse.emf.cdo.ui.ide.importResource"
+ label="%action.label.9"
+ tooltip="%action.tooltip.8">
+ </action>
+ <action
+ class="org.eclipse.emf.cdo.ui.internal.ide.actions.NewResourceFolderActionDelegate"
+ icon="icons/full/elcl16/NewCDOResourceFolder.gif"
+ id="org.eclipse.emf.cdo.ui.ide.newResourceFolderAction"
+ label="%action.label.4"
+ tooltip="%action.tooltip.3">
+ </action>
+ <action
+ class="org.eclipse.emf.cdo.ui.internal.ide.actions.NewResourceActionDelegate"
+ icon="icons/full/elcl16/NewCDOResource.gif"
+ id="org.eclipse.emf.cdo.ui.ide.createResourceAction"
+ label="%action.label.3"
+ tooltip="%action.tooltip.2">
+ </action>
+ </objectContribution>
+ <objectContribution
+ adaptable="false"
+ id="org.eclipse.emf.cdo.ui.ide.PackageNodeActions"
+ objectClass="org.eclipse.emf.cdo.ui.ide.Node$PackagesNode">
+ <action
+ class="org.eclipse.emf.cdo.ui.internal.ide.actions.ManagePackagesActionDelegate"
+ icon="icons/full/elcl16/EPackageIcon.gif"
+ id="org.eclipse.emf.cdo.ui.ide.managePackages"
+ label="%action.label.5"
+ tooltip="%action.tooltip.4">
+ </action>
+ <action
+ class="org.eclipse.emf.cdo.ui.internal.ide.actions.RegisterFileSystemPackageActionDelegate"
+ icon="icons/full/elcl16/FileSystemIcon.gif"
+ id="org.eclipse.emf.cdo.ui.ide.registerFilesystemPackage"
+ label="%action.label.6"
+ tooltip="%action.tooltip.5">
+ </action>
+ <action
+ class="org.eclipse.emf.cdo.ui.internal.ide.actions.RegisterWorkspacePackageActionDelegate"
+ icon="icons/full/elcl16/EcoreModelFile.gif"
+ id="org.eclipse.emf.cdo.ui.ide.registerWorkspacePackage"
+ label="%action.label.7"
+ tooltip="%action.tooltip.6">
+ </action>
+ </objectContribution>
+ <objectContribution
+ adaptable="false"
+ id="org.eclipse.emf.cdo.ui.ide.CDOResourceActionContribution"
+ objectClass="org.eclipse.emf.cdo.eresource.CDOResource">
+ <action
+ class="org.eclipse.emf.cdo.ui.internal.ide.actions.ExportResourceActionDelegate"
+ icon="icons/full/elcl16/export_wiz.gif"
+ id="org.eclipse.emf.cdo.ui.ide.exportResource"
+ label="%action.label.10">
+ </action>
+ </objectContribution>
+ <objectContribution
+ adaptable="false"
+ id="org.eclipse.emf.cdo.ui.ide.BranchesNodeActions"
+ objectClass="org.eclipse.emf.cdo.ui.ide.Node$BranchNode">
+ <action
+ class="org.eclipse.emf.cdo.ui.internal.ide.actions.SwitchToBranchActionDelegate"
+ icon="icons/full/obj16/switch.png"
+ id="org.eclipse.emf.cdo.ui.ide.switchToBranchAction"
+ label="%action.label.12"
+ tooltip="%action.tooltip.10">
+ </action>
+ <action
+ class="org.eclipse.emf.cdo.ui.internal.ide.actions.CreateBranchActionDelegate"
+ icon="icons/full/obj16/fork.png"
+ id="org.eclipse.emf.cdo.ui.ide.createNewBranchAction"
+ label="%action.label.11"
+ tooltip="%action.tooltip.9">
+ </action>
+ </objectContribution>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.newWizards">
+ <wizard
+ canFinishEarly="false"
+ class="org.eclipse.emf.cdo.ui.internal.ide.wizards.CDOProjectCreationWizard"
+ finalPerspective="org.eclipse.emf.cdo.ui.CDOExplorerPerspective"
+ hasPages="true"
+ icon="icons/full/obj16/repository_content.gif"
+ id="org.eclipse.emf.cdo.ui.ide.createSharedProject"
+ name="%wizard.name.0"
+ preferredPerspectives="org.eclipse.ui.resourcePerspective"
+ project="true">
+ </wizard>
+ </extension>
+
+</plugin>
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/ide/CommonNavigatorUtils.java b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/ide/CommonNavigatorUtils.java
index de9899bb1d..7ce294b383 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/ide/CommonNavigatorUtils.java
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/ide/CommonNavigatorUtils.java
@@ -1,125 +1,125 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Victor Roldan Betancort - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.emf.cdo.ui.ide;
-
-import org.eclipse.emf.cdo.ui.internal.ide.bundle.OM;
-
-import org.eclipse.net4j.util.ui.UIUtil;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PartInitException;
-
-/**
- * Miscellaneous functionality associated with visualization on the Common Navigator Framework.
- *
- * @author Victor Roldan Betancort
- */
-public final class CommonNavigatorUtils
-{
- private CommonNavigatorUtils()
- {
- }
-
- /**
- * Creates a fake {@link org.eclipse.core.runtime.IAdaptable adaptable} object whose sole purpose is to show a message
- * in the common navigator.
- */
- public static Object createMessageProvider(final String message, final MessageType type)
- {
- return new IAdaptable()
- {
- @SuppressWarnings("rawtypes")
- public Object getAdapter(Class adapter)
- {
- if (adapter.equals(ILabelProvider.class))
- {
- return new LabelProvider()
- {
- @Override
- public String getText(Object element)
- {
- return message;
- }
-
- @Override
- public Image getImage(Object element)
- {
- switch (type)
- {
- case ERROR:
- return OM.getImageDescriptor(OM.ERROR_ICON).createImage();
- case WARNING:
- return OM.getImageDescriptor(OM.WARNING_ICON).createImage();
- case INFO:
- return OM.getImageDescriptor(OM.INFO_ICON).createImage();
- }
-
- return super.getImage(element);
- }
- };
- }
-
- if (adapter.equals(Runnable.class))
- {
- return new Runnable()
- {
- public void run()
- {
- try
- {
- UIUtil.getActiveWorkbenchPage().showView(UIUtil.ERROR_LOG_ID);
- }
- catch (PartInitException ex)
- {
- OM.LOG.error(ex);
- }
- }
- };
- }
-
- return null;
- }
-
- /*
- * In case is not adapted, at least the message is shown through toString()
- */
- @Override
- public String toString()
- {
- return message;
- }
- };
- }
-
- /**
- * Same as {@link #createMessageProvider(String, MessageType)}, but returning the object as an <code>Object</code>
- * array
- */
- public static Object[] createMessageProviderChild(final String message, final MessageType type)
- {
- Object[] result = { createMessageProvider(message, type) };
- return result;
- }
-
- /**
- * Defines message decoration to be shown in the Common Navigator through {@link CommonNavigatorUtils}
- *
- * @author Victor Roldan Betancort
- */
- public static enum MessageType
- {
- ERROR, WARNING, INFO
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Victor Roldan Betancort - initial API and implementation
+ * Eike Stepper - maintenance
+ */
+package org.eclipse.emf.cdo.ui.ide;
+
+import org.eclipse.emf.cdo.ui.internal.ide.bundle.OM;
+
+import org.eclipse.net4j.util.ui.UIUtil;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PartInitException;
+
+/**
+ * Miscellaneous functionality associated with visualization on the Common Navigator Framework.
+ *
+ * @author Victor Roldan Betancort
+ */
+public final class CommonNavigatorUtils
+{
+ private CommonNavigatorUtils()
+ {
+ }
+
+ /**
+ * Creates a fake {@link org.eclipse.core.runtime.IAdaptable adaptable} object whose sole purpose is to show a message
+ * in the common navigator.
+ */
+ public static Object createMessageProvider(final String message, final MessageType type)
+ {
+ return new IAdaptable()
+ {
+ @SuppressWarnings("rawtypes")
+ public Object getAdapter(Class adapter)
+ {
+ if (adapter.equals(ILabelProvider.class))
+ {
+ return new LabelProvider()
+ {
+ @Override
+ public String getText(Object element)
+ {
+ return message;
+ }
+
+ @Override
+ public Image getImage(Object element)
+ {
+ switch (type)
+ {
+ case ERROR:
+ return OM.getImageDescriptor(OM.ERROR_ICON).createImage();
+ case WARNING:
+ return OM.getImageDescriptor(OM.WARNING_ICON).createImage();
+ case INFO:
+ return OM.getImageDescriptor(OM.INFO_ICON).createImage();
+ }
+
+ return super.getImage(element);
+ }
+ };
+ }
+
+ if (adapter.equals(Runnable.class))
+ {
+ return new Runnable()
+ {
+ public void run()
+ {
+ try
+ {
+ UIUtil.getActiveWorkbenchPage().showView(UIUtil.ERROR_LOG_ID);
+ }
+ catch (PartInitException ex)
+ {
+ OM.LOG.error(ex);
+ }
+ }
+ };
+ }
+
+ return null;
+ }
+
+ /*
+ * In case is not adapted, at least the message is shown through toString()
+ */
+ @Override
+ public String toString()
+ {
+ return message;
+ }
+ };
+ }
+
+ /**
+ * Same as {@link #createMessageProvider(String, MessageType)}, but returning the object as an <code>Object</code>
+ * array
+ */
+ public static Object[] createMessageProviderChild(final String message, final MessageType type)
+ {
+ Object[] result = { createMessageProvider(message, type) };
+ return result;
+ }
+
+ /**
+ * Defines message decoration to be shown in the Common Navigator through {@link CommonNavigatorUtils}
+ *
+ * @author Victor Roldan Betancort
+ */
+ public static enum MessageType
+ {
+ ERROR, WARNING, INFO
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/ide/Node.java b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/ide/Node.java
index 8a27d46ffb..9f0a1178d7 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/ide/Node.java
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/ide/Node.java
@@ -1,291 +1,291 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.ui.ide;
-
-import org.eclipse.emf.cdo.CDOObject;
-import org.eclipse.emf.cdo.common.branch.CDOBranch;
-import org.eclipse.emf.cdo.common.model.CDOPackageRegistry;
-import org.eclipse.emf.cdo.eresource.CDOResourceNode;
-import org.eclipse.emf.cdo.team.IRepositoryProject;
-import org.eclipse.emf.cdo.ui.ide.CommonNavigatorUtils.MessageType;
-import org.eclipse.emf.cdo.ui.internal.ide.bundle.OM;
-import org.eclipse.emf.cdo.ui.internal.ide.messages.Messages;
-import org.eclipse.emf.cdo.view.CDOView;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-
-import org.eclipse.core.runtime.PlatformObject;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * {@link org.eclipse.core.runtime.IAdaptable Adaptable} abstraction for an UI representation of basic CDO concepts.
- *
- * @author Eike Stepper
- */
-public abstract class Node extends PlatformObject
-{
- private static final Object[] EMPTY = {};
-
- private IRepositoryProject repositoryProject;
-
- public Node(IRepositoryProject repositoryProject)
- {
- this.repositoryProject = repositoryProject;
- }
-
- public IRepositoryProject getRepositoryProject()
- {
- return repositoryProject;
- }
-
- public abstract String getText();
-
- public abstract String getImageKey();
-
- public Object[] getChildren()
- {
- return EMPTY;
- }
-
- public Object getParent()
- {
- return repositoryProject.getProject();
- }
-
- public abstract Type getType();
-
- /**
- * Differentiates kinds of {@link org.eclipse.emf.cdo.ui.ide.Node nodes}
- *
- * @author Eike Stepper
- */
- public static enum Type
- {
- BRANCH, PACKAGES, RESOURCES, SESSIONS
- }
-
- /**
- * Convenience UI object to represent a {@link org.eclipse.emf.cdo.common.branch.CDOBranch branch}
- *
- * @author Victor Roldan Betancort
- */
- public static final class BranchNode extends Node
- {
- private CDOBranch branch;
-
- public BranchNode(IRepositoryProject repositoryProject, CDOBranch branch)
- {
- super(repositoryProject);
- this.branch = branch;
- }
-
- public CDOBranch getBranch()
- {
- return branch;
- }
-
- @Override
- public Type getType()
- {
- return Type.BRANCH;
- }
-
- @Override
- public String getText()
- {
- return branch.getName();
- }
-
- @Override
- public String getImageKey()
- {
- return OM.BRANCH_ICON;
- }
-
- @Override
- public Object[] getChildren()
- {
- if (!getRepositoryProject().getView().getSession().getRepositoryInfo().isSupportingBranches())
- {
- return CommonNavigatorUtils.createMessageProviderChild(Messages.getString("Node.1"), //$NON-NLS-1$
- MessageType.INFO);
- }
-
- CDOBranch[] branches = branch.getBranches();
- BranchNode[] nodes = new BranchNode[branches.length];
- for (int i = 0; i < branches.length; i++)
- {
- nodes[i] = new BranchNode(getRepositoryProject(), branches[i]);
- }
-
- return nodes;
- }
-
- @Override
- public Object getParent()
- {
- if (branch.isMainBranch())
- {
- return getRepositoryProject();
- }
-
- return branch.getBase().getBranch();
- }
- }
-
- /**
- * Convenience UI object to represent the {@link org.eclipse.emf.cdo.common.model.CDOPackageRegistry
- * CDOPackageRegistry}
- *
- * @author Eike Stepper
- */
- public static final class PackagesNode extends Node
- {
- public PackagesNode(IRepositoryProject repositoryProject)
- {
- super(repositoryProject);
- }
-
- @Override
- public Type getType()
- {
- return Type.PACKAGES;
- }
-
- @Override
- public String getText()
- {
- return Messages.getString("Node.2"); //$NON-NLS-1$
- }
-
- @Override
- public String getImageKey()
- {
- return "icons/full/obj16/Packages.gif"; //$NON-NLS-1$
- }
-
- @Override
- public EPackage[] getChildren()
- {
- CDOPackageRegistry packageRegistry = getRepositoryProject().getView().getSession().getPackageRegistry();
- List<EPackage> children = new ArrayList<EPackage>();
- for (String nsURI : packageRegistry.keySet())
- {
- try
- {
- EPackage ePackage = packageRegistry.getEPackage(nsURI);
- children.add(ePackage);
- }
- catch (org.eclipse.emf.cdo.common.util.CDOException ex)
- {
- // Generated packages could not be locally available
- OM.LOG.error(ex);
- }
- }
-
- return children.toArray(new EPackage[children.size()]);
- }
- }
-
- /**
- * Convenience UI object to represent the {@link org.eclipse.emf.cdo.eresource.CDOResourceNode CDOResourceNode}
- *
- * @author Eike Stepper
- */
- public static final class ResourcesNode extends Node
- {
- public ResourcesNode(IRepositoryProject repositoryProject)
- {
- super(repositoryProject);
- }
-
- @Override
- public Type getType()
- {
- return Type.RESOURCES;
- }
-
- @Override
- public String getText()
- {
- return Messages.getString("Node.4"); //$NON-NLS-1$
- }
-
- @Override
- public String getImageKey()
- {
- return "icons/full/obj16/Resources.gif"; //$NON-NLS-1$
- }
-
- @SuppressWarnings("rawtypes")
- @Override
- public Object getAdapter(Class adapter)
- {
- if (adapter.equals(CDOObject.class))
- {
- return getRepositoryProject().getView().getRootResource();
- }
-
- return super.getAdapter(adapter);
- }
-
- @Override
- public CDOResourceNode[] getChildren()
- {
- CDOView view = getRepositoryProject().getView();
- List<CDOResourceNode> children = new ArrayList<CDOResourceNode>();
- for (EObject resourceNode : view.getRootResource().getContents())
- {
- if (resourceNode instanceof CDOResourceNode)
- {
- children.add((CDOResourceNode)resourceNode);
- }
- }
-
- return children.toArray(new CDOResourceNode[children.size()]);
- }
- }
-
- /**
- * Convenience UI object to represent the {@link org.eclipse.emf.cdo.session.CDOSession CDOSession}
- *
- * @author Eike Stepper
- */
- public static final class SessionsNode extends Node
- {
- public SessionsNode(IRepositoryProject repositoryProject)
- {
- super(repositoryProject);
- }
-
- @Override
- public Type getType()
- {
- return Type.SESSIONS;
- }
-
- @Override
- public String getText()
- {
- return Messages.getString("Node.0"); //$NON-NLS-1$
- }
-
- @Override
- public String getImageKey()
- {
- return "icons/full/obj16/Sessions.gif"; //$NON-NLS-1$
- }
- }
-
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.ui.ide;
+
+import org.eclipse.emf.cdo.CDOObject;
+import org.eclipse.emf.cdo.common.branch.CDOBranch;
+import org.eclipse.emf.cdo.common.model.CDOPackageRegistry;
+import org.eclipse.emf.cdo.eresource.CDOResourceNode;
+import org.eclipse.emf.cdo.team.IRepositoryProject;
+import org.eclipse.emf.cdo.ui.ide.CommonNavigatorUtils.MessageType;
+import org.eclipse.emf.cdo.ui.internal.ide.bundle.OM;
+import org.eclipse.emf.cdo.ui.internal.ide.messages.Messages;
+import org.eclipse.emf.cdo.view.CDOView;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.core.runtime.PlatformObject;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * {@link org.eclipse.core.runtime.IAdaptable Adaptable} abstraction for an UI representation of basic CDO concepts.
+ *
+ * @author Eike Stepper
+ */
+public abstract class Node extends PlatformObject
+{
+ private static final Object[] EMPTY = {};
+
+ private IRepositoryProject repositoryProject;
+
+ public Node(IRepositoryProject repositoryProject)
+ {
+ this.repositoryProject = repositoryProject;
+ }
+
+ public IRepositoryProject getRepositoryProject()
+ {
+ return repositoryProject;
+ }
+
+ public abstract String getText();
+
+ public abstract String getImageKey();
+
+ public Object[] getChildren()
+ {
+ return EMPTY;
+ }
+
+ public Object getParent()
+ {
+ return repositoryProject.getProject();
+ }
+
+ public abstract Type getType();
+
+ /**
+ * Differentiates kinds of {@link org.eclipse.emf.cdo.ui.ide.Node nodes}
+ *
+ * @author Eike Stepper
+ */
+ public static enum Type
+ {
+ BRANCH, PACKAGES, RESOURCES, SESSIONS
+ }
+
+ /**
+ * Convenience UI object to represent a {@link org.eclipse.emf.cdo.common.branch.CDOBranch branch}
+ *
+ * @author Victor Roldan Betancort
+ */
+ public static final class BranchNode extends Node
+ {
+ private CDOBranch branch;
+
+ public BranchNode(IRepositoryProject repositoryProject, CDOBranch branch)
+ {
+ super(repositoryProject);
+ this.branch = branch;
+ }
+
+ public CDOBranch getBranch()
+ {
+ return branch;
+ }
+
+ @Override
+ public Type getType()
+ {
+ return Type.BRANCH;
+ }
+
+ @Override
+ public String getText()
+ {
+ return branch.getName();
+ }
+
+ @Override
+ public String getImageKey()
+ {
+ return OM.BRANCH_ICON;
+ }
+
+ @Override
+ public Object[] getChildren()
+ {
+ if (!getRepositoryProject().getView().getSession().getRepositoryInfo().isSupportingBranches())
+ {
+ return CommonNavigatorUtils.createMessageProviderChild(Messages.getString("Node.1"), //$NON-NLS-1$
+ MessageType.INFO);
+ }
+
+ CDOBranch[] branches = branch.getBranches();
+ BranchNode[] nodes = new BranchNode[branches.length];
+ for (int i = 0; i < branches.length; i++)
+ {
+ nodes[i] = new BranchNode(getRepositoryProject(), branches[i]);
+ }
+
+ return nodes;
+ }
+
+ @Override
+ public Object getParent()
+ {
+ if (branch.isMainBranch())
+ {
+ return getRepositoryProject();
+ }
+
+ return branch.getBase().getBranch();
+ }
+ }
+
+ /**
+ * Convenience UI object to represent the {@link org.eclipse.emf.cdo.common.model.CDOPackageRegistry
+ * CDOPackageRegistry}
+ *
+ * @author Eike Stepper
+ */
+ public static final class PackagesNode extends Node
+ {
+ public PackagesNode(IRepositoryProject repositoryProject)
+ {
+ super(repositoryProject);
+ }
+
+ @Override
+ public Type getType()
+ {
+ return Type.PACKAGES;
+ }
+
+ @Override
+ public String getText()
+ {
+ return Messages.getString("Node.2"); //$NON-NLS-1$
+ }
+
+ @Override
+ public String getImageKey()
+ {
+ return "icons/full/obj16/Packages.gif"; //$NON-NLS-1$
+ }
+
+ @Override
+ public EPackage[] getChildren()
+ {
+ CDOPackageRegistry packageRegistry = getRepositoryProject().getView().getSession().getPackageRegistry();
+ List<EPackage> children = new ArrayList<EPackage>();
+ for (String nsURI : packageRegistry.keySet())
+ {
+ try
+ {
+ EPackage ePackage = packageRegistry.getEPackage(nsURI);
+ children.add(ePackage);
+ }
+ catch (org.eclipse.emf.cdo.common.util.CDOException ex)
+ {
+ // Generated packages could not be locally available
+ OM.LOG.error(ex);
+ }
+ }
+
+ return children.toArray(new EPackage[children.size()]);
+ }
+ }
+
+ /**
+ * Convenience UI object to represent the {@link org.eclipse.emf.cdo.eresource.CDOResourceNode CDOResourceNode}
+ *
+ * @author Eike Stepper
+ */
+ public static final class ResourcesNode extends Node
+ {
+ public ResourcesNode(IRepositoryProject repositoryProject)
+ {
+ super(repositoryProject);
+ }
+
+ @Override
+ public Type getType()
+ {
+ return Type.RESOURCES;
+ }
+
+ @Override
+ public String getText()
+ {
+ return Messages.getString("Node.4"); //$NON-NLS-1$
+ }
+
+ @Override
+ public String getImageKey()
+ {
+ return "icons/full/obj16/Resources.gif"; //$NON-NLS-1$
+ }
+
+ @SuppressWarnings("rawtypes")
+ @Override
+ public Object getAdapter(Class adapter)
+ {
+ if (adapter.equals(CDOObject.class))
+ {
+ return getRepositoryProject().getView().getRootResource();
+ }
+
+ return super.getAdapter(adapter);
+ }
+
+ @Override
+ public CDOResourceNode[] getChildren()
+ {
+ CDOView view = getRepositoryProject().getView();
+ List<CDOResourceNode> children = new ArrayList<CDOResourceNode>();
+ for (EObject resourceNode : view.getRootResource().getContents())
+ {
+ if (resourceNode instanceof CDOResourceNode)
+ {
+ children.add((CDOResourceNode)resourceNode);
+ }
+ }
+
+ return children.toArray(new CDOResourceNode[children.size()]);
+ }
+ }
+
+ /**
+ * Convenience UI object to represent the {@link org.eclipse.emf.cdo.session.CDOSession CDOSession}
+ *
+ * @author Eike Stepper
+ */
+ public static final class SessionsNode extends Node
+ {
+ public SessionsNode(IRepositoryProject repositoryProject)
+ {
+ super(repositoryProject);
+ }
+
+ @Override
+ public Type getType()
+ {
+ return Type.SESSIONS;
+ }
+
+ @Override
+ public String getText()
+ {
+ return Messages.getString("Node.0"); //$NON-NLS-1$
+ }
+
+ @Override
+ public String getImageKey()
+ {
+ return "icons/full/obj16/Sessions.gif"; //$NON-NLS-1$
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/ide/RepositoryContentProvider.java b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/ide/RepositoryContentProvider.java
index 905eef759a..b8435398fa 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/ide/RepositoryContentProvider.java
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/ide/RepositoryContentProvider.java
@@ -1,545 +1,545 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- * Victor Roldan Betancort - maintenance
- */
-package org.eclipse.emf.cdo.ui.ide;
-
-import org.eclipse.emf.cdo.CDOObject;
-import org.eclipse.emf.cdo.common.branch.CDOBranch;
-import org.eclipse.emf.cdo.common.branch.CDOBranchCreatedEvent;
-import org.eclipse.emf.cdo.eresource.CDOResource;
-import org.eclipse.emf.cdo.internal.ui.editor.CDOEditor;
-import org.eclipse.emf.cdo.team.IRepositoryManager;
-import org.eclipse.emf.cdo.team.IRepositoryProject;
-import org.eclipse.emf.cdo.ui.CDOEditorInput;
-import org.eclipse.emf.cdo.ui.CDOEditorUtil;
-import org.eclipse.emf.cdo.ui.CDOEventHandler;
-import org.eclipse.emf.cdo.ui.ide.CommonNavigatorUtils.MessageType;
-import org.eclipse.emf.cdo.ui.ide.Node.BranchNode;
-import org.eclipse.emf.cdo.ui.ide.Node.PackagesNode;
-import org.eclipse.emf.cdo.ui.ide.Node.ResourcesNode;
-import org.eclipse.emf.cdo.ui.ide.Node.SessionsNode;
-import org.eclipse.emf.cdo.ui.internal.ide.actions.RemoveResourceActionDelegate;
-import org.eclipse.emf.cdo.ui.internal.ide.bundle.OM;
-import org.eclipse.emf.cdo.ui.internal.ide.messages.Messages;
-import org.eclipse.emf.cdo.util.CDOUtil;
-import org.eclipse.emf.cdo.view.CDOView;
-import org.eclipse.emf.cdo.view.CDOViewInvalidationEvent;
-import org.eclipse.emf.cdo.view.CDOViewTargetChangedEvent;
-
-import org.eclipse.emf.internal.cdo.view.CDOStateMachine;
-
-import org.eclipse.net4j.util.container.ContainerEventAdapter;
-import org.eclipse.net4j.util.container.IContainer;
-import org.eclipse.net4j.util.event.IEvent;
-import org.eclipse.net4j.util.event.IListener;
-import org.eclipse.net4j.util.ui.StructuredContentProvider;
-import org.eclipse.net4j.util.ui.UIUtil;
-
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.edit.EMFEditPlugin;
-import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
-import org.eclipse.emf.edit.provider.ComposedAdapterFactory.Descriptor.Registry;
-import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
-import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
-import org.eclipse.emf.spi.cdo.InternalCDOObject;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * {@link org.eclipse.jface.viewers.ITreeContentProvider ITreeContentProvider} implementation for the CDO Team
- * integration. Capable of providing containment information for an {@link org.eclipse.core.resources.IProject project}
- * synchronized with a repository. Understands containment information of the {@link org.eclipse.emf.cdo.ui.ide.Node
- * node} abstraction.
- *
- * @author Eike Stepper
- */
-public class RepositoryContentProvider extends StructuredContentProvider<IWorkspaceRoot> implements
- ITreeContentProvider
-{
- private static final Object[] EMPTY = {};
-
- private ComposedAdapterFactory adapterFactory;
-
- private Map<IRepositoryProject, RepositoryInfo> infos = new HashMap<IRepositoryProject, RepositoryInfo>();
-
- private Map<IRepositoryProject, RepositoryCDOEventHandler> eventHandlers = new HashMap<IRepositoryProject, RepositoryCDOEventHandler>();
-
- private boolean sessionsNodeHidden;
-
- private boolean packagesNodeHidden;
-
- private boolean resourcesNodeHidden;
-
- private IListener repositoryManagerListener = new ContainerEventAdapter<IRepositoryProject>()
- {
- @Override
- protected void onAdded(IContainer<IRepositoryProject> container, IRepositoryProject element)
- {
- refreshViewer(element);
- }
-
- @Override
- protected void onRemoved(IContainer<IRepositoryProject> container, IRepositoryProject element)
- {
- refreshViewer(element);
- }
-
- private void refreshViewer(IRepositoryProject element)
- {
- getViewer().refresh(element.getProject());
- }
- };
-
- public RepositoryContentProvider()
- {
- adapterFactory = createAdapterFactory();
- IRepositoryManager.INSTANCE.addListener(repositoryManagerListener);
- }
-
- @Override
- public void dispose()
- {
- IRepositoryManager.INSTANCE.removeListener(repositoryManagerListener);
- adapterFactory.dispose();
- super.dispose();
- }
-
- public boolean isSessionsNodeHidden()
- {
- return sessionsNodeHidden;
- }
-
- public void setSessionsNodeHidden(boolean sessionNodesHidden)
- {
- sessionsNodeHidden = sessionNodesHidden;
- }
-
- public boolean isPackagesNodeHidden()
- {
- return packagesNodeHidden;
- }
-
- public void setPackagesNodeHidden(boolean packageNodesHidden)
- {
- packagesNodeHidden = packageNodesHidden;
- }
-
- public boolean isResourcesNodeHidden()
- {
- return resourcesNodeHidden;
- }
-
- public void setResourcesNodeHidden(boolean resourceNodesHidden)
- {
- resourcesNodeHidden = resourceNodesHidden;
- }
-
- public Object[] getChildren(Object parentElement)
- {
- try
- {
- return doGetChildren(parentElement);
- }
- catch (Exception e)
- {
- OM.LOG.error(e);
- return CommonNavigatorUtils.createMessageProviderChild(Messages.getString("RepositoryContentProvider_0"), //$NON-NLS-1$
- MessageType.ERROR);
- }
- }
-
- private Object[] doGetChildren(Object parentElement)
- {
- if (parentElement instanceof IProject)
- {
- IProject project = (IProject)parentElement;
- IRepositoryProject repositoryProject = IRepositoryManager.INSTANCE.getElement(project);
- if (repositoryProject != null)
- {
- return getChildren(repositoryProject);
- }
- }
-
- if (parentElement instanceof Node)
- {
- Node node = (Node)parentElement;
- return node.getChildren();
- }
-
- if (parentElement instanceof Notifier)
- {
- Notifier notifier = (Notifier)parentElement;
- ITreeItemContentProvider adapter = (ITreeItemContentProvider)adapterFactory.adapt(notifier,
- ITreeItemContentProvider.class);
- if (adapter != null)
- {
- return adapter.getChildren(notifier).toArray();
- }
- }
-
- return EMPTY;
- }
-
- public Object[] getElements(Object parentElement)
- {
- return getChildren(parentElement);
- }
-
- public Object getParent(Object element)
- {
- if (element instanceof Node)
- {
- Node node = (Node)element;
- return node.getParent();
- }
-
- if (element instanceof Notifier)
- {
- Notifier notifier = (Notifier)element;
- ITreeItemContentProvider adapter = (ITreeItemContentProvider)adapterFactory.adapt(notifier,
- ITreeItemContentProvider.class);
- if (adapter != null)
- {
- return adapter.getParent(notifier);
- }
- }
-
- return null;
- }
-
- private Object[] getChildren(IRepositoryProject repositoryProject)
- {
- List<Object> children = new ArrayList<Object>();
- RepositoryInfo info = getRepositoryInfo(repositoryProject);
-
- children.add(info.getMainBranch());
-
- // First try virtual parent nodes
- if (!isPackagesNodeHidden())
- {
- children.add(info.getPackages());
- }
-
- if (!isResourcesNodeHidden())
- {
- children.add(info.getResources());
- }
-
- if (!isSessionsNodeHidden())
- {
- children.add(info.getSessions());
- }
-
- // Then try flattened sub nodes
- if (isPackagesNodeHidden())
- {
- addChildren(children, info.getPackages());
- }
-
- if (isResourcesNodeHidden())
- {
- addChildren(children, info.getResources());
- }
-
- if (isSessionsNodeHidden())
- {
- addChildren(children, info.getSessions());
- }
-
- return children.toArray(new Object[children.size()]);
- }
-
- private void addChildren(List<Object> result, Node node)
- {
- Object[] children = node.getChildren();
- for (Object child : children)
- {
- result.add(child);
- }
- }
-
- private RepositoryInfo getRepositoryInfo(IRepositoryProject repositoryProject)
- {
- RepositoryInfo info = infos.get(repositoryProject);
- if (info == null)
- {
- info = new RepositoryInfo(repositoryProject);
- infos.put(repositoryProject, info);
-
- wireUpViewerRefresher(repositoryProject, info);
- prepareViewerEventHandlers();
-
- // TODO Get rid of info mappings that are no longer needed (lifecycle or weakref)
- }
-
- return info;
- }
-
- private void prepareViewerEventHandlers()
- {
- // Mouse double-click
- getViewer().addDoubleClickListener(new MouseListener());
-
- // Keyboard actions
- getViewer().getControl().addKeyListener(new CDONavigatorKeyListener());
- }
-
- private void wireUpViewerRefresher(IRepositoryProject repositoryProject, RepositoryInfo info)
- {
- // Handles invalidated objects
- eventHandlers.put(repositoryProject, new RepositoryCDOEventHandler(info.getResources(),
- repositoryProject.getView(), (TreeViewer)getViewer()));
-
- repositoryProject.getView().getBranch().getBranchManager().addListener(new IListener()
- {
- public void notifyEvent(IEvent event)
- {
- if (event instanceof CDOBranchCreatedEvent)
- {
- refreshViewer(true);
- }
- }
- });
-
- repositoryProject.getView().addListener(new IListener()
- {
- public void notifyEvent(IEvent event)
- {
- if (event instanceof CDOViewInvalidationEvent || event instanceof CDOViewTargetChangedEvent)
- {
- refreshViewer(true);
- }
- }
- });
- }
-
- public static ComposedAdapterFactory createAdapterFactory()
- {
- Registry registry = EMFEditPlugin.getComposedAdapterFactoryDescriptorRegistry();
- ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(registry);
- adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
- return adapterFactory;
- }
-
- /**
- * @author Victor Roldan Betancort
- */
- private final class RepositoryCDOEventHandler extends CDOEventHandler
- {
- private Node resourcesNode;
-
- public RepositoryCDOEventHandler(Node resourcesNode, CDOView view, TreeViewer treeViewer)
- {
- super(view, treeViewer);
- this.resourcesNode = resourcesNode;
- }
-
- @Override
- protected void objectInvalidated(InternalCDOObject cdoObject)
- {
- if (CDOUtil.isLegacyObject(cdoObject))
- {
- CDOStateMachine.INSTANCE.read(cdoObject);
- }
-
- if (cdoObject instanceof CDOResource)
- {
- if (((CDOResource)cdoObject).isRoot())
- {
- refreshViewer(true);
- return;
- }
- }
-
- refreshElement(cdoObject, true);
- }
-
- @Override
- protected void viewInvalidated(Set<? extends CDOObject> dirtyObjects)
- {
- // Necessary when the parent of the dirtyObject is ResourcesNode
- // (since viewer.getInput() is IWorkspaceRoot)
- for (CDOObject cdoObject : dirtyObjects)
- {
- if (cdoObject instanceof CDOResource)
- {
- if (((CDOResource)cdoObject).isRoot())
- {
- refreshElement(resourcesNode, true);
- return;
- }
- }
- }
-
- super.viewInvalidated(dirtyObjects);
- }
-
- @Override
- protected void viewConflict(final CDOObject conflictingObject, boolean firstConflict)
- {
- refreshElement(conflictingObject, true);
- }
-
- @Override
- protected void viewClosed()
- {
- // TODO what should we do here? CDOObjects become disconnected, exceptions could arise everywhere
- // Temporary closing the project.
-
- try
- {
- // View gets on shutdown, but we shouldn't close the project
- if (PlatformUI.isWorkbenchRunning())
- {
- resourcesNode.getRepositoryProject().getProject().close(new NullProgressMonitor());
- }
- }
- catch (CoreException ex)
- {
- OM.LOG.error(ex);
- }
- }
-
- @Override
- protected void viewDirtyStateChanged()
- {
- }
- }
-
- /**
- * @author Eike Stepper
- */
- private static final class RepositoryInfo
- {
- private BranchNode mainBranch;
-
- private PackagesNode packages;
-
- private ResourcesNode resources;
-
- private SessionsNode sessions;
-
- public RepositoryInfo(IRepositoryProject repositoryProject)
- {
- CDOBranch main = repositoryProject.getView().getSession().getBranchManager().getMainBranch();
- mainBranch = new BranchNode(repositoryProject, main);
- packages = new PackagesNode(repositoryProject);
- resources = new ResourcesNode(repositoryProject);
- sessions = new SessionsNode(repositoryProject);
- }
-
- public BranchNode getMainBranch()
- {
- return mainBranch;
- }
-
- public PackagesNode getPackages()
- {
- return packages;
- }
-
- public ResourcesNode getResources()
- {
- return resources;
- }
-
- public SessionsNode getSessions()
- {
- return sessions;
- }
- }
-
- /**
- * @author Victor Roldan Betancort
- */
- private static final class MouseListener implements IDoubleClickListener
- {
- public MouseListener()
- {
- }
-
- public void doubleClick(DoubleClickEvent event)
- {
- Object selection = UIUtil.getElement(event.getSelection());
- if (selection instanceof CDOResource)
- {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- CDOView view = ((CDOResource)selection).cdoView().getSession().openTransaction();
-
- try
- {
- CDOEditorInput editorInput = CDOEditorUtil.createCDOEditorInput(view, ((CDOResource)selection).getPath(),
- true);
- page.openEditor(editorInput, CDOEditor.EDITOR_ID);
- }
- catch (PartInitException ex)
- {
- OM.LOG.error(ex);
- }
- }
- if (selection instanceof IAdaptable)
- {
- Runnable runnable = (Runnable)((IAdaptable)selection).getAdapter(Runnable.class);
- if (runnable != null)
- {
- UIUtil.getDisplay().asyncExec(runnable);
- }
- }
- }
- }
-
- public boolean hasChildren(Object parentElement)
- {
- Object[] children = getChildren(parentElement);
- return children != null && children.length != 0;
- }
-
- /**
- * @author Victor Roldan Betancort
- */
- private final class CDONavigatorKeyListener extends KeyAdapter
- {
- public CDONavigatorKeyListener()
- {
- }
-
- @Override
- public void keyPressed(KeyEvent e)
- {
- if (e.keyCode == SWT.DEL)
- {
- RemoveResourceActionDelegate action = new RemoveResourceActionDelegate();
- action.selectionChanged(null, getViewer().getSelection());
- action.run(null);
- }
- }
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ * Victor Roldan Betancort - maintenance
+ */
+package org.eclipse.emf.cdo.ui.ide;
+
+import org.eclipse.emf.cdo.CDOObject;
+import org.eclipse.emf.cdo.common.branch.CDOBranch;
+import org.eclipse.emf.cdo.common.branch.CDOBranchCreatedEvent;
+import org.eclipse.emf.cdo.eresource.CDOResource;
+import org.eclipse.emf.cdo.internal.ui.editor.CDOEditor;
+import org.eclipse.emf.cdo.team.IRepositoryManager;
+import org.eclipse.emf.cdo.team.IRepositoryProject;
+import org.eclipse.emf.cdo.ui.CDOEditorInput;
+import org.eclipse.emf.cdo.ui.CDOEditorUtil;
+import org.eclipse.emf.cdo.ui.CDOEventHandler;
+import org.eclipse.emf.cdo.ui.ide.CommonNavigatorUtils.MessageType;
+import org.eclipse.emf.cdo.ui.ide.Node.BranchNode;
+import org.eclipse.emf.cdo.ui.ide.Node.PackagesNode;
+import org.eclipse.emf.cdo.ui.ide.Node.ResourcesNode;
+import org.eclipse.emf.cdo.ui.ide.Node.SessionsNode;
+import org.eclipse.emf.cdo.ui.internal.ide.actions.RemoveResourceActionDelegate;
+import org.eclipse.emf.cdo.ui.internal.ide.bundle.OM;
+import org.eclipse.emf.cdo.ui.internal.ide.messages.Messages;
+import org.eclipse.emf.cdo.util.CDOUtil;
+import org.eclipse.emf.cdo.view.CDOView;
+import org.eclipse.emf.cdo.view.CDOViewInvalidationEvent;
+import org.eclipse.emf.cdo.view.CDOViewTargetChangedEvent;
+
+import org.eclipse.emf.internal.cdo.view.CDOStateMachine;
+
+import org.eclipse.net4j.util.container.ContainerEventAdapter;
+import org.eclipse.net4j.util.container.IContainer;
+import org.eclipse.net4j.util.event.IEvent;
+import org.eclipse.net4j.util.event.IListener;
+import org.eclipse.net4j.util.ui.StructuredContentProvider;
+import org.eclipse.net4j.util.ui.UIUtil;
+
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.edit.EMFEditPlugin;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory.Descriptor.Registry;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
+import org.eclipse.emf.spi.cdo.InternalCDOObject;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * {@link org.eclipse.jface.viewers.ITreeContentProvider ITreeContentProvider} implementation for the CDO Team
+ * integration. Capable of providing containment information for an {@link org.eclipse.core.resources.IProject project}
+ * synchronized with a repository. Understands containment information of the {@link org.eclipse.emf.cdo.ui.ide.Node
+ * node} abstraction.
+ *
+ * @author Eike Stepper
+ */
+public class RepositoryContentProvider extends StructuredContentProvider<IWorkspaceRoot> implements
+ ITreeContentProvider
+{
+ private static final Object[] EMPTY = {};
+
+ private ComposedAdapterFactory adapterFactory;
+
+ private Map<IRepositoryProject, RepositoryInfo> infos = new HashMap<IRepositoryProject, RepositoryInfo>();
+
+ private Map<IRepositoryProject, RepositoryCDOEventHandler> eventHandlers = new HashMap<IRepositoryProject, RepositoryCDOEventHandler>();
+
+ private boolean sessionsNodeHidden;
+
+ private boolean packagesNodeHidden;
+
+ private boolean resourcesNodeHidden;
+
+ private IListener repositoryManagerListener = new ContainerEventAdapter<IRepositoryProject>()
+ {
+ @Override
+ protected void onAdded(IContainer<IRepositoryProject> container, IRepositoryProject element)
+ {
+ refreshViewer(element);
+ }
+
+ @Override
+ protected void onRemoved(IContainer<IRepositoryProject> container, IRepositoryProject element)
+ {
+ refreshViewer(element);
+ }
+
+ private void refreshViewer(IRepositoryProject element)
+ {
+ getViewer().refresh(element.getProject());
+ }
+ };
+
+ public RepositoryContentProvider()
+ {
+ adapterFactory = createAdapterFactory();
+ IRepositoryManager.INSTANCE.addListener(repositoryManagerListener);
+ }
+
+ @Override
+ public void dispose()
+ {
+ IRepositoryManager.INSTANCE.removeListener(repositoryManagerListener);
+ adapterFactory.dispose();
+ super.dispose();
+ }
+
+ public boolean isSessionsNodeHidden()
+ {
+ return sessionsNodeHidden;
+ }
+
+ public void setSessionsNodeHidden(boolean sessionNodesHidden)
+ {
+ sessionsNodeHidden = sessionNodesHidden;
+ }
+
+ public boolean isPackagesNodeHidden()
+ {
+ return packagesNodeHidden;
+ }
+
+ public void setPackagesNodeHidden(boolean packageNodesHidden)
+ {
+ packagesNodeHidden = packageNodesHidden;
+ }
+
+ public boolean isResourcesNodeHidden()
+ {
+ return resourcesNodeHidden;
+ }
+
+ public void setResourcesNodeHidden(boolean resourceNodesHidden)
+ {
+ resourcesNodeHidden = resourceNodesHidden;
+ }
+
+ public Object[] getChildren(Object parentElement)
+ {
+ try
+ {
+ return doGetChildren(parentElement);
+ }
+ catch (Exception e)
+ {
+ OM.LOG.error(e);
+ return CommonNavigatorUtils.createMessageProviderChild(Messages.getString("RepositoryContentProvider_0"), //$NON-NLS-1$
+ MessageType.ERROR);
+ }
+ }
+
+ private Object[] doGetChildren(Object parentElement)
+ {
+ if (parentElement instanceof IProject)
+ {
+ IProject project = (IProject)parentElement;
+ IRepositoryProject repositoryProject = IRepositoryManager.INSTANCE.getElement(project);
+ if (repositoryProject != null)
+ {
+ return getChildren(repositoryProject);
+ }
+ }
+
+ if (parentElement instanceof Node)
+ {
+ Node node = (Node)parentElement;
+ return node.getChildren();
+ }
+
+ if (parentElement instanceof Notifier)
+ {
+ Notifier notifier = (Notifier)parentElement;
+ ITreeItemContentProvider adapter = (ITreeItemContentProvider)adapterFactory.adapt(notifier,
+ ITreeItemContentProvider.class);
+ if (adapter != null)
+ {
+ return adapter.getChildren(notifier).toArray();
+ }
+ }
+
+ return EMPTY;
+ }
+
+ public Object[] getElements(Object parentElement)
+ {
+ return getChildren(parentElement);
+ }
+
+ public Object getParent(Object element)
+ {
+ if (element instanceof Node)
+ {
+ Node node = (Node)element;
+ return node.getParent();
+ }
+
+ if (element instanceof Notifier)
+ {
+ Notifier notifier = (Notifier)element;
+ ITreeItemContentProvider adapter = (ITreeItemContentProvider)adapterFactory.adapt(notifier,
+ ITreeItemContentProvider.class);
+ if (adapter != null)
+ {
+ return adapter.getParent(notifier);
+ }
+ }
+
+ return null;
+ }
+
+ private Object[] getChildren(IRepositoryProject repositoryProject)
+ {
+ List<Object> children = new ArrayList<Object>();
+ RepositoryInfo info = getRepositoryInfo(repositoryProject);
+
+ children.add(info.getMainBranch());
+
+ // First try virtual parent nodes
+ if (!isPackagesNodeHidden())
+ {
+ children.add(info.getPackages());
+ }
+
+ if (!isResourcesNodeHidden())
+ {
+ children.add(info.getResources());
+ }
+
+ if (!isSessionsNodeHidden())
+ {
+ children.add(info.getSessions());
+ }
+
+ // Then try flattened sub nodes
+ if (isPackagesNodeHidden())
+ {
+ addChildren(children, info.getPackages());
+ }
+
+ if (isResourcesNodeHidden())
+ {
+ addChildren(children, info.getResources());
+ }
+
+ if (isSessionsNodeHidden())
+ {
+ addChildren(children, info.getSessions());
+ }
+
+ return children.toArray(new Object[children.size()]);
+ }
+
+ private void addChildren(List<Object> result, Node node)
+ {
+ Object[] children = node.getChildren();
+ for (Object child : children)
+ {
+ result.add(child);
+ }
+ }
+
+ private RepositoryInfo getRepositoryInfo(IRepositoryProject repositoryProject)
+ {
+ RepositoryInfo info = infos.get(repositoryProject);
+ if (info == null)
+ {
+ info = new RepositoryInfo(repositoryProject);
+ infos.put(repositoryProject, info);
+
+ wireUpViewerRefresher(repositoryProject, info);
+ prepareViewerEventHandlers();
+
+ // TODO Get rid of info mappings that are no longer needed (lifecycle or weakref)
+ }
+
+ return info;
+ }
+
+ private void prepareViewerEventHandlers()
+ {
+ // Mouse double-click
+ getViewer().addDoubleClickListener(new MouseListener());
+
+ // Keyboard actions
+ getViewer().getControl().addKeyListener(new CDONavigatorKeyListener());
+ }
+
+ private void wireUpViewerRefresher(IRepositoryProject repositoryProject, RepositoryInfo info)
+ {
+ // Handles invalidated objects
+ eventHandlers.put(repositoryProject, new RepositoryCDOEventHandler(info.getResources(),
+ repositoryProject.getView(), (TreeViewer)getViewer()));
+
+ repositoryProject.getView().getBranch().getBranchManager().addListener(new IListener()
+ {
+ public void notifyEvent(IEvent event)
+ {
+ if (event instanceof CDOBranchCreatedEvent)
+ {
+ refreshViewer(true);
+ }
+ }
+ });
+
+ repositoryProject.getView().addListener(new IListener()
+ {
+ public void notifyEvent(IEvent event)
+ {
+ if (event instanceof CDOViewInvalidationEvent || event instanceof CDOViewTargetChangedEvent)
+ {
+ refreshViewer(true);
+ }
+ }
+ });
+ }
+
+ public static ComposedAdapterFactory createAdapterFactory()
+ {
+ Registry registry = EMFEditPlugin.getComposedAdapterFactoryDescriptorRegistry();
+ ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(registry);
+ adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
+ return adapterFactory;
+ }
+
+ /**
+ * @author Victor Roldan Betancort
+ */
+ private final class RepositoryCDOEventHandler extends CDOEventHandler
+ {
+ private Node resourcesNode;
+
+ public RepositoryCDOEventHandler(Node resourcesNode, CDOView view, TreeViewer treeViewer)
+ {
+ super(view, treeViewer);
+ this.resourcesNode = resourcesNode;
+ }
+
+ @Override
+ protected void objectInvalidated(InternalCDOObject cdoObject)
+ {
+ if (CDOUtil.isLegacyObject(cdoObject))
+ {
+ CDOStateMachine.INSTANCE.read(cdoObject);
+ }
+
+ if (cdoObject instanceof CDOResource)
+ {
+ if (((CDOResource)cdoObject).isRoot())
+ {
+ refreshViewer(true);
+ return;
+ }
+ }
+
+ refreshElement(cdoObject, true);
+ }
+
+ @Override
+ protected void viewInvalidated(Set<? extends CDOObject> dirtyObjects)
+ {
+ // Necessary when the parent of the dirtyObject is ResourcesNode
+ // (since viewer.getInput() is IWorkspaceRoot)
+ for (CDOObject cdoObject : dirtyObjects)
+ {
+ if (cdoObject instanceof CDOResource)
+ {
+ if (((CDOResource)cdoObject).isRoot())
+ {
+ refreshElement(resourcesNode, true);
+ return;
+ }
+ }
+ }
+
+ super.viewInvalidated(dirtyObjects);
+ }
+
+ @Override
+ protected void viewConflict(final CDOObject conflictingObject, boolean firstConflict)
+ {
+ refreshElement(conflictingObject, true);
+ }
+
+ @Override
+ protected void viewClosed()
+ {
+ // TODO what should we do here? CDOObjects become disconnected, exceptions could arise everywhere
+ // Temporary closing the project.
+
+ try
+ {
+ // View gets on shutdown, but we shouldn't close the project
+ if (PlatformUI.isWorkbenchRunning())
+ {
+ resourcesNode.getRepositoryProject().getProject().close(new NullProgressMonitor());
+ }
+ }
+ catch (CoreException ex)
+ {
+ OM.LOG.error(ex);
+ }
+ }
+
+ @Override
+ protected void viewDirtyStateChanged()
+ {
+ }
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ private static final class RepositoryInfo
+ {
+ private BranchNode mainBranch;
+
+ private PackagesNode packages;
+
+ private ResourcesNode resources;
+
+ private SessionsNode sessions;
+
+ public RepositoryInfo(IRepositoryProject repositoryProject)
+ {
+ CDOBranch main = repositoryProject.getView().getSession().getBranchManager().getMainBranch();
+ mainBranch = new BranchNode(repositoryProject, main);
+ packages = new PackagesNode(repositoryProject);
+ resources = new ResourcesNode(repositoryProject);
+ sessions = new SessionsNode(repositoryProject);
+ }
+
+ public BranchNode getMainBranch()
+ {
+ return mainBranch;
+ }
+
+ public PackagesNode getPackages()
+ {
+ return packages;
+ }
+
+ public ResourcesNode getResources()
+ {
+ return resources;
+ }
+
+ public SessionsNode getSessions()
+ {
+ return sessions;
+ }
+ }
+
+ /**
+ * @author Victor Roldan Betancort
+ */
+ private static final class MouseListener implements IDoubleClickListener
+ {
+ public MouseListener()
+ {
+ }
+
+ public void doubleClick(DoubleClickEvent event)
+ {
+ Object selection = UIUtil.getElement(event.getSelection());
+ if (selection instanceof CDOResource)
+ {
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ CDOView view = ((CDOResource)selection).cdoView().getSession().openTransaction();
+
+ try
+ {
+ CDOEditorInput editorInput = CDOEditorUtil.createCDOEditorInput(view, ((CDOResource)selection).getPath(),
+ true);
+ page.openEditor(editorInput, CDOEditor.EDITOR_ID);
+ }
+ catch (PartInitException ex)
+ {
+ OM.LOG.error(ex);
+ }
+ }
+ if (selection instanceof IAdaptable)
+ {
+ Runnable runnable = (Runnable)((IAdaptable)selection).getAdapter(Runnable.class);
+ if (runnable != null)
+ {
+ UIUtil.getDisplay().asyncExec(runnable);
+ }
+ }
+ }
+ }
+
+ public boolean hasChildren(Object parentElement)
+ {
+ Object[] children = getChildren(parentElement);
+ return children != null && children.length != 0;
+ }
+
+ /**
+ * @author Victor Roldan Betancort
+ */
+ private final class CDONavigatorKeyListener extends KeyAdapter
+ {
+ public CDONavigatorKeyListener()
+ {
+ }
+
+ @Override
+ public void keyPressed(KeyEvent e)
+ {
+ if (e.keyCode == SWT.DEL)
+ {
+ RemoveResourceActionDelegate action = new RemoveResourceActionDelegate();
+ action.selectionChanged(null, getViewer().getSelection());
+ action.run(null);
+ }
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/ide/RepositoryLabelProvider.java b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/ide/RepositoryLabelProvider.java
index d48957b576..64204653ba 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/ide/RepositoryLabelProvider.java
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/ide/RepositoryLabelProvider.java
@@ -1,118 +1,118 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.ui.ide;
-
-import org.eclipse.emf.cdo.eresource.CDOResourceNode;
-import org.eclipse.emf.cdo.ui.internal.ide.bundle.OM;
-
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
-import org.eclipse.emf.edit.provider.IItemLabelProvider;
-import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * {@link org.eclipse.jface.viewers.ILabelProvider ILabelProvider} implementation for the CDO Team integration. Capable
- * of providing text and image information for {@link org.eclipse.emf.cdo.ui.ide.Node nodes}
- *
- * @author Eike Stepper
- */
-public class RepositoryLabelProvider extends LabelProvider
-{
- private ComposedAdapterFactory adapterFactory;
-
- public RepositoryLabelProvider()
- {
- adapterFactory = RepositoryContentProvider.createAdapterFactory();
- }
-
- @Override
- public void dispose()
- {
- adapterFactory.dispose();
- super.dispose();
- }
-
- @Override
- public String getText(Object element)
- {
- if (element instanceof Node)
- {
- Node node = (Node)element;
- return node.getText();
- }
-
- if (element instanceof CDOResourceNode)
- {
- CDOResourceNode resourceNode = (CDOResourceNode)element;
- return resourceNode.getName();
- }
-
- if (element instanceof Notifier)
- {
- Notifier notifier = (Notifier)element;
- IItemLabelProvider adapter = (IItemLabelProvider)adapterFactory.adapt(notifier, IItemLabelProvider.class);
- if (adapter != null)
- {
- return adapter.getText(notifier);
- }
- }
-
- if (element instanceof IAdaptable)
- {
- Object adapter = ((IAdaptable)element).getAdapter(ILabelProvider.class);
- if (adapter != null)
- {
- return ((ILabelProvider)adapter).getText(element);
- }
- }
-
- return super.getText(element);
- }
-
- @Override
- public Image getImage(Object element)
- {
- if (element instanceof Node)
- {
- Node node = (Node)element;
- String imageKey = node.getImageKey();
- ImageDescriptor imageDescriptor = OM.Activator.imageDescriptorFromPlugin(OM.BUNDLE_ID, imageKey);
- return imageDescriptor.createImage();
- }
-
- if (element instanceof Notifier)
- {
- Notifier notifier = (Notifier)element;
- IItemLabelProvider adapter = (IItemLabelProvider)adapterFactory.adapt(notifier, IItemLabelProvider.class);
- if (adapter != null)
- {
- return ExtendedImageRegistry.getInstance().getImage(adapter.getImage(notifier));
- }
- }
-
- if (element instanceof IAdaptable)
- {
- Object adapter = ((IAdaptable)element).getAdapter(ILabelProvider.class);
- if (adapter != null)
- {
- return ((ILabelProvider)adapter).getImage(element);
- }
- }
-
- return super.getImage(element);
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.ui.ide;
+
+import org.eclipse.emf.cdo.eresource.CDOResourceNode;
+import org.eclipse.emf.cdo.ui.internal.ide.bundle.OM;
+
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * {@link org.eclipse.jface.viewers.ILabelProvider ILabelProvider} implementation for the CDO Team integration. Capable
+ * of providing text and image information for {@link org.eclipse.emf.cdo.ui.ide.Node nodes}
+ *
+ * @author Eike Stepper
+ */
+public class RepositoryLabelProvider extends LabelProvider
+{
+ private ComposedAdapterFactory adapterFactory;
+
+ public RepositoryLabelProvider()
+ {
+ adapterFactory = RepositoryContentProvider.createAdapterFactory();
+ }
+
+ @Override
+ public void dispose()
+ {
+ adapterFactory.dispose();
+ super.dispose();
+ }
+
+ @Override
+ public String getText(Object element)
+ {
+ if (element instanceof Node)
+ {
+ Node node = (Node)element;
+ return node.getText();
+ }
+
+ if (element instanceof CDOResourceNode)
+ {
+ CDOResourceNode resourceNode = (CDOResourceNode)element;
+ return resourceNode.getName();
+ }
+
+ if (element instanceof Notifier)
+ {
+ Notifier notifier = (Notifier)element;
+ IItemLabelProvider adapter = (IItemLabelProvider)adapterFactory.adapt(notifier, IItemLabelProvider.class);
+ if (adapter != null)
+ {
+ return adapter.getText(notifier);
+ }
+ }
+
+ if (element instanceof IAdaptable)
+ {
+ Object adapter = ((IAdaptable)element).getAdapter(ILabelProvider.class);
+ if (adapter != null)
+ {
+ return ((ILabelProvider)adapter).getText(element);
+ }
+ }
+
+ return super.getText(element);
+ }
+
+ @Override
+ public Image getImage(Object element)
+ {
+ if (element instanceof Node)
+ {
+ Node node = (Node)element;
+ String imageKey = node.getImageKey();
+ ImageDescriptor imageDescriptor = OM.Activator.imageDescriptorFromPlugin(OM.BUNDLE_ID, imageKey);
+ return imageDescriptor.createImage();
+ }
+
+ if (element instanceof Notifier)
+ {
+ Notifier notifier = (Notifier)element;
+ IItemLabelProvider adapter = (IItemLabelProvider)adapterFactory.adapt(notifier, IItemLabelProvider.class);
+ if (adapter != null)
+ {
+ return ExtendedImageRegistry.getInstance().getImage(adapter.getImage(notifier));
+ }
+ }
+
+ if (element instanceof IAdaptable)
+ {
+ Object adapter = ((IAdaptable)element).getAdapter(ILabelProvider.class);
+ if (adapter != null)
+ {
+ return ((ILabelProvider)adapter).getImage(element);
+ }
+ }
+
+ return super.getImage(element);
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/ide/package-info.java b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/ide/package-info.java
index a15d887eaf..7b17d3fce8 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/ide/package-info.java
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/ide/package-info.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) 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
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/ChangeViewTargetActionDelegate.java b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/ChangeViewTargetActionDelegate.java
index 70eb66335b..338afac35f 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/ChangeViewTargetActionDelegate.java
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/ChangeViewTargetActionDelegate.java
@@ -1,38 +1,38 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Victor Roldan Betancort - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.emf.cdo.ui.internal.ide.actions;
-
-import org.eclipse.emf.cdo.internal.ui.actions.SwitchTargetAction;
-
-import org.eclipse.jface.action.IAction;
-
-/**
- * @author Victor Roldan Betancort
- */
-public class ChangeViewTargetActionDelegate extends ViewAwareActionDelegate
-{
- private IAction action;
-
- public ChangeViewTargetActionDelegate()
- {
- }
-
- @Override
- protected void safeRun() throws Exception
- {
- if (action == null)
- {
- action = new SwitchTargetAction(getPage(), getView());
- }
- action.run();
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Victor Roldan Betancort - initial API and implementation
+ * Eike Stepper - maintenance
+ */
+package org.eclipse.emf.cdo.ui.internal.ide.actions;
+
+import org.eclipse.emf.cdo.internal.ui.actions.SwitchTargetAction;
+
+import org.eclipse.jface.action.IAction;
+
+/**
+ * @author Victor Roldan Betancort
+ */
+public class ChangeViewTargetActionDelegate extends ViewAwareActionDelegate
+{
+ private IAction action;
+
+ public ChangeViewTargetActionDelegate()
+ {
+ }
+
+ @Override
+ protected void safeRun() throws Exception
+ {
+ if (action == null)
+ {
+ action = new SwitchTargetAction(getPage(), getView());
+ }
+ action.run();
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/CreateBranchActionDelegate.java b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/CreateBranchActionDelegate.java
index f74db189e6..c3e6ed7f31 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/CreateBranchActionDelegate.java
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/CreateBranchActionDelegate.java
@@ -1,89 +1,89 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Victor Roldan Betancort - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.emf.cdo.ui.internal.ide.actions;
-
-import org.eclipse.emf.cdo.common.branch.CDOBranch;
-import org.eclipse.emf.cdo.ui.ide.Node.BranchNode;
-import org.eclipse.emf.cdo.ui.internal.ide.messages.Messages;
-
-import org.eclipse.net4j.util.StringUtil;
-import org.eclipse.net4j.util.ui.UIUtil;
-import org.eclipse.net4j.util.ui.actions.LongRunningActionDelegate;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IInputValidator;
-import org.eclipse.jface.dialogs.InputDialog;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * @author Victor Roldan Betancort
- */
-public class CreateBranchActionDelegate extends LongRunningActionDelegate
-{
- private String name;
-
- public CreateBranchActionDelegate()
- {
- }
-
- @Override
- protected void preRun() throws Exception
- {
- InputDialog dialog = new InputDialog(new Shell(), Messages.getString("CreateBranchActionDelegate_0"), //$NON-NLS-1$
- Messages.getString("CreateBranchActionDelegate_1"), "", new BranchNameInputValidator()); //$NON-NLS-1$ //$NON-NLS-2$
-
- if (dialog.open() == Dialog.OK)
- {
- name = dialog.getValue();
- }
- else
- {
- cancel();
- }
- }
-
- @Override
- protected void doRun(IProgressMonitor progressMonitor) throws Exception
- {
- BranchNode branchNode = UIUtil.getElement(getSelection(), BranchNode.class);
- branchNode.getBranch().createBranch(name);
- }
-
- /**
- * @author Victor Roldan Betancort
- */
- private final class BranchNameInputValidator implements IInputValidator
- {
- public String isValid(String newText)
- {
- if (StringUtil.isEmpty(newText))
- {
- return Messages.getString("CreateBranchActionDelegate_3"); //$NON-NLS-1$
- }
-
- if (newText.contains(CDOBranch.PATH_SEPARATOR))
- {
- return Messages.getString("CreateBranchActionDelegate_4"); //$NON-NLS-1$
- }
-
- BranchNode branchNode = UIUtil.getElement(getSelection(), BranchNode.class);
- CDOBranch branch = branchNode.getBranch();
- if (branch.getBranch(newText) != null)
- {
- return Messages.getString("CreateBranchActionDelegate_5"); //$NON-NLS-1$
- }
-
- return null;
- }
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Victor Roldan Betancort - initial API and implementation
+ * Eike Stepper - maintenance
+ */
+package org.eclipse.emf.cdo.ui.internal.ide.actions;
+
+import org.eclipse.emf.cdo.common.branch.CDOBranch;
+import org.eclipse.emf.cdo.ui.ide.Node.BranchNode;
+import org.eclipse.emf.cdo.ui.internal.ide.messages.Messages;
+
+import org.eclipse.net4j.util.StringUtil;
+import org.eclipse.net4j.util.ui.UIUtil;
+import org.eclipse.net4j.util.ui.actions.LongRunningActionDelegate;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IInputValidator;
+import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * @author Victor Roldan Betancort
+ */
+public class CreateBranchActionDelegate extends LongRunningActionDelegate
+{
+ private String name;
+
+ public CreateBranchActionDelegate()
+ {
+ }
+
+ @Override
+ protected void preRun() throws Exception
+ {
+ InputDialog dialog = new InputDialog(new Shell(), Messages.getString("CreateBranchActionDelegate_0"), //$NON-NLS-1$
+ Messages.getString("CreateBranchActionDelegate_1"), "", new BranchNameInputValidator()); //$NON-NLS-1$ //$NON-NLS-2$
+
+ if (dialog.open() == Dialog.OK)
+ {
+ name = dialog.getValue();
+ }
+ else
+ {
+ cancel();
+ }
+ }
+
+ @Override
+ protected void doRun(IProgressMonitor progressMonitor) throws Exception
+ {
+ BranchNode branchNode = UIUtil.getElement(getSelection(), BranchNode.class);
+ branchNode.getBranch().createBranch(name);
+ }
+
+ /**
+ * @author Victor Roldan Betancort
+ */
+ private final class BranchNameInputValidator implements IInputValidator
+ {
+ public String isValid(String newText)
+ {
+ if (StringUtil.isEmpty(newText))
+ {
+ return Messages.getString("CreateBranchActionDelegate_3"); //$NON-NLS-1$
+ }
+
+ if (newText.contains(CDOBranch.PATH_SEPARATOR))
+ {
+ return Messages.getString("CreateBranchActionDelegate_4"); //$NON-NLS-1$
+ }
+
+ BranchNode branchNode = UIUtil.getElement(getSelection(), BranchNode.class);
+ CDOBranch branch = branchNode.getBranch();
+ if (branch.getBranch(newText) != null)
+ {
+ return Messages.getString("CreateBranchActionDelegate_5"); //$NON-NLS-1$
+ }
+
+ return null;
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/DisconnectActionDelegate.java b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/DisconnectActionDelegate.java
index c2c10bba57..b115fa9162 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/DisconnectActionDelegate.java
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/DisconnectActionDelegate.java
@@ -1,58 +1,58 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- * Victor Roldan Betancort - maintenance
- */
-package org.eclipse.emf.cdo.ui.internal.ide.actions;
-
-import org.eclipse.emf.cdo.internal.team.RepositoryManager;
-import org.eclipse.emf.cdo.internal.team.RepositoryTeamProvider;
-import org.eclipse.emf.cdo.ui.internal.ide.bundle.OM;
-
-import org.eclipse.net4j.util.ui.UIUtil;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * @author Eike Stepper
- */
-public class DisconnectActionDelegate implements IObjectActionDelegate
-{
- private IProject project;
-
- public DisconnectActionDelegate()
- {
- }
-
- public void setActivePart(IAction action, IWorkbenchPart targetPart)
- {
- }
-
- public void selectionChanged(IAction action, ISelection selection)
- {
- project = UIUtil.getElement(selection, IProject.class);
- }
-
- public void run(IAction action)
- {
- try
- {
- RepositoryManager.INSTANCE.removeElement(project);
- RepositoryTeamProvider.unmapProject(project);
- }
- catch (Exception ex)
- {
- OM.LOG.error(ex);
- }
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ * Victor Roldan Betancort - maintenance
+ */
+package org.eclipse.emf.cdo.ui.internal.ide.actions;
+
+import org.eclipse.emf.cdo.internal.team.RepositoryManager;
+import org.eclipse.emf.cdo.internal.team.RepositoryTeamProvider;
+import org.eclipse.emf.cdo.ui.internal.ide.bundle.OM;
+
+import org.eclipse.net4j.util.ui.UIUtil;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+
+/**
+ * @author Eike Stepper
+ */
+public class DisconnectActionDelegate implements IObjectActionDelegate
+{
+ private IProject project;
+
+ public DisconnectActionDelegate()
+ {
+ }
+
+ public void setActivePart(IAction action, IWorkbenchPart targetPart)
+ {
+ }
+
+ public void selectionChanged(IAction action, ISelection selection)
+ {
+ project = UIUtil.getElement(selection, IProject.class);
+ }
+
+ public void run(IAction action)
+ {
+ try
+ {
+ RepositoryManager.INSTANCE.removeElement(project);
+ RepositoryTeamProvider.unmapProject(project);
+ }
+ catch (Exception ex)
+ {
+ OM.LOG.error(ex);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/ExportResourceActionDelegate.java b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/ExportResourceActionDelegate.java
index f0adc63e63..98fbbfede6 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/ExportResourceActionDelegate.java
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/ExportResourceActionDelegate.java
@@ -1,110 +1,110 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Victor Roldan Betancort - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.emf.cdo.ui.internal.ide.actions;
-
-import org.eclipse.emf.cdo.CDOObject;
-import org.eclipse.emf.cdo.eresource.CDOResource;
-import org.eclipse.emf.cdo.internal.ui.dialogs.ImportResourceDialog;
-import org.eclipse.emf.cdo.transaction.CDOTransaction;
-import org.eclipse.emf.cdo.ui.internal.ide.messages.Messages;
-
-import org.eclipse.net4j.util.io.IORuntimeException;
-
-import org.eclipse.emf.common.ui.dialogs.ResourceDialog;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Shell;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-/**
- * @author Victor Roldan Betancort
- */
-public class ExportResourceActionDelegate extends TransactionalBackgroundActionDelegate
-{
- private URI targetURI;
-
- public ExportResourceActionDelegate()
- {
- super(Messages.getString("ExportSelectedResourceAction_0")); //$NON-NLS-1$
- }
-
- @Override
- protected final CDOObject preRun(CDOObject object)
- {
- ResourceDialog dialog = new ResourceDialog(new Shell(),
- Messages.getString("ExportSelectedResourceAction_1"), SWT.SAVE); //$NON-NLS-1$
- if (dialog.open() == ImportResourceDialog.OK)
- {
- List<URI> uris = dialog.getURIs();
- if (uris.size() == 1)
- {
- targetURI = uris.get(0);
- CDOTransaction transaction = object.cdoView().getSession().openTransaction();
- CDOObject transactionalObject = transaction.getObject(object);
- return transactionalObject;
- }
-
- MessageDialog.openError(new Shell(), Messages.getString("ExportResourceActionDelegate.0"), //$NON-NLS-1$
- Messages.getString("ExportSelectedResourceAction_2")); //$NON-NLS-1$
- cancel();
- }
- else
- {
- cancel();
- }
-
- return null;
- }
-
- @Override
- protected void doRun(CDOTransaction transaction, CDOObject object, IProgressMonitor progressMonitor) throws Exception
- {
- // Source Resource
- Resource source = object instanceof CDOResource ? (CDOResource)object : object.cdoResource();
- List<EObject> sourceContents = new ArrayList<EObject>(source.getContents());
- exportObjects(sourceContents);
- }
-
- private void exportObjects(List<EObject> sourceContents)
- {
- // Target Resource
- ResourceSet resourceSet = new ResourceSetImpl();
- resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap()
- .put(Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl());
- Resource resource = resourceSet.createResource(targetURI);
-
- Collection<EObject> copiedRoots = EcoreUtil.copyAll(sourceContents);
- resource.getContents().addAll(copiedRoots);
-
- try
- {
- resource.save(null);
- }
- catch (IOException ex)
- {
- throw new IORuntimeException(ex);
- }
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Victor Roldan Betancort - initial API and implementation
+ * Eike Stepper - maintenance
+ */
+package org.eclipse.emf.cdo.ui.internal.ide.actions;
+
+import org.eclipse.emf.cdo.CDOObject;
+import org.eclipse.emf.cdo.eresource.CDOResource;
+import org.eclipse.emf.cdo.internal.ui.dialogs.ImportResourceDialog;
+import org.eclipse.emf.cdo.transaction.CDOTransaction;
+import org.eclipse.emf.cdo.ui.internal.ide.messages.Messages;
+
+import org.eclipse.net4j.util.io.IORuntimeException;
+
+import org.eclipse.emf.common.ui.dialogs.ResourceDialog;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Shell;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * @author Victor Roldan Betancort
+ */
+public class ExportResourceActionDelegate extends TransactionalBackgroundActionDelegate
+{
+ private URI targetURI;
+
+ public ExportResourceActionDelegate()
+ {
+ super(Messages.getString("ExportSelectedResourceAction_0")); //$NON-NLS-1$
+ }
+
+ @Override
+ protected final CDOObject preRun(CDOObject object)
+ {
+ ResourceDialog dialog = new ResourceDialog(new Shell(),
+ Messages.getString("ExportSelectedResourceAction_1"), SWT.SAVE); //$NON-NLS-1$
+ if (dialog.open() == ImportResourceDialog.OK)
+ {
+ List<URI> uris = dialog.getURIs();
+ if (uris.size() == 1)
+ {
+ targetURI = uris.get(0);
+ CDOTransaction transaction = object.cdoView().getSession().openTransaction();
+ CDOObject transactionalObject = transaction.getObject(object);
+ return transactionalObject;
+ }
+
+ MessageDialog.openError(new Shell(), Messages.getString("ExportResourceActionDelegate.0"), //$NON-NLS-1$
+ Messages.getString("ExportSelectedResourceAction_2")); //$NON-NLS-1$
+ cancel();
+ }
+ else
+ {
+ cancel();
+ }
+
+ return null;
+ }
+
+ @Override
+ protected void doRun(CDOTransaction transaction, CDOObject object, IProgressMonitor progressMonitor) throws Exception
+ {
+ // Source Resource
+ Resource source = object instanceof CDOResource ? (CDOResource)object : object.cdoResource();
+ List<EObject> sourceContents = new ArrayList<EObject>(source.getContents());
+ exportObjects(sourceContents);
+ }
+
+ private void exportObjects(List<EObject> sourceContents)
+ {
+ // Target Resource
+ ResourceSet resourceSet = new ResourceSetImpl();
+ resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap()
+ .put(Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl());
+ Resource resource = resourceSet.createResource(targetURI);
+
+ Collection<EObject> copiedRoots = EcoreUtil.copyAll(sourceContents);
+ resource.getContents().addAll(copiedRoots);
+
+ try
+ {
+ resource.save(null);
+ }
+ catch (IOException ex)
+ {
+ throw new IORuntimeException(ex);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/ImportResourceActionDelegate.java b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/ImportResourceActionDelegate.java
index 5ebfa640ff..aa908f68be 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/ImportResourceActionDelegate.java
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/ImportResourceActionDelegate.java
@@ -1,100 +1,100 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Victor Roldan Betancort - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.emf.cdo.ui.internal.ide.actions;
-
-import org.eclipse.emf.cdo.CDOObject;
-import org.eclipse.emf.cdo.eresource.CDOResource;
-import org.eclipse.emf.cdo.eresource.CDOResourceNode;
-import org.eclipse.emf.cdo.internal.ui.dialogs.ImportResourceDialog;
-import org.eclipse.emf.cdo.transaction.CDOTransaction;
-import org.eclipse.emf.cdo.ui.internal.ide.messages.Messages;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Shell;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author Victor Roldan Betancort
- */
-public class ImportResourceActionDelegate extends NewResourceActionDelegate
-{
- private URI sourceURI;
-
- public ImportResourceActionDelegate()
- {
- }
-
- @Override
- protected final CDOObject preRun(CDOObject object)
- {
- ImportResourceDialog dialog = new ImportResourceDialog(new Shell(),
- Messages.getString("ImportResourceToFolderAction_0"), SWT.OPEN); //$NON-NLS-1$
- if (dialog.open() == ImportResourceDialog.OK)
- {
- List<URI> uris = dialog.getURIs();
- if (uris.size() == 1)
- {
- sourceURI = uris.get(0);
- setNewResourceNode(createNewResourceNode());
- getNewResourceNode().setName(dialog.getTargetPath());
- CDOTransaction transaction = object.cdoView().getSession().openTransaction();
- CDOObject transactionalObject = transaction.getObject(object);
- return transactionalObject;
- }
-
- MessageDialog.openError(new Shell(), Messages.getString("ImportResourceActionDelegate.0"), //$NON-NLS-1$
- Messages.getString("ImportResourceToFolderAction_1")); //$NON-NLS-1$
- cancel();
- }
- else
- {
- cancel();
- }
-
- return null;
- }
-
- @Override
- protected CDOResourceNode createNewResourceNode()
- {
- CDOResource resource = (CDOResource)super.createNewResourceNode();
-
- // Source ResourceSet
- ResourceSet sourceSet = new ResourceSetImpl();
- // sourceSet.setPackageRegistry(transaction.getSession().getPackageRegistry());
-
- // Source Resource
- Resource source = sourceSet.getResource(sourceURI, true);
- List<EObject> sourceContents = new ArrayList<EObject>(source.getContents());
-
- // Target Resource
- EList<EObject> targetContents = resource.getContents();
-
- // Move contents over
- for (EObject root : sourceContents)
- {
- targetContents.add(root);
- }
-
- return resource;
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Victor Roldan Betancort - initial API and implementation
+ * Eike Stepper - maintenance
+ */
+package org.eclipse.emf.cdo.ui.internal.ide.actions;
+
+import org.eclipse.emf.cdo.CDOObject;
+import org.eclipse.emf.cdo.eresource.CDOResource;
+import org.eclipse.emf.cdo.eresource.CDOResourceNode;
+import org.eclipse.emf.cdo.internal.ui.dialogs.ImportResourceDialog;
+import org.eclipse.emf.cdo.transaction.CDOTransaction;
+import org.eclipse.emf.cdo.ui.internal.ide.messages.Messages;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Shell;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Victor Roldan Betancort
+ */
+public class ImportResourceActionDelegate extends NewResourceActionDelegate
+{
+ private URI sourceURI;
+
+ public ImportResourceActionDelegate()
+ {
+ }
+
+ @Override
+ protected final CDOObject preRun(CDOObject object)
+ {
+ ImportResourceDialog dialog = new ImportResourceDialog(new Shell(),
+ Messages.getString("ImportResourceToFolderAction_0"), SWT.OPEN); //$NON-NLS-1$
+ if (dialog.open() == ImportResourceDialog.OK)
+ {
+ List<URI> uris = dialog.getURIs();
+ if (uris.size() == 1)
+ {
+ sourceURI = uris.get(0);
+ setNewResourceNode(createNewResourceNode());
+ getNewResourceNode().setName(dialog.getTargetPath());
+ CDOTransaction transaction = object.cdoView().getSession().openTransaction();
+ CDOObject transactionalObject = transaction.getObject(object);
+ return transactionalObject;
+ }
+
+ MessageDialog.openError(new Shell(), Messages.getString("ImportResourceActionDelegate.0"), //$NON-NLS-1$
+ Messages.getString("ImportResourceToFolderAction_1")); //$NON-NLS-1$
+ cancel();
+ }
+ else
+ {
+ cancel();
+ }
+
+ return null;
+ }
+
+ @Override
+ protected CDOResourceNode createNewResourceNode()
+ {
+ CDOResource resource = (CDOResource)super.createNewResourceNode();
+
+ // Source ResourceSet
+ ResourceSet sourceSet = new ResourceSetImpl();
+ // sourceSet.setPackageRegistry(transaction.getSession().getPackageRegistry());
+
+ // Source Resource
+ Resource source = sourceSet.getResource(sourceURI, true);
+ List<EObject> sourceContents = new ArrayList<EObject>(source.getContents());
+
+ // Target Resource
+ EList<EObject> targetContents = resource.getContents();
+
+ // Move contents over
+ for (EObject root : sourceContents)
+ {
+ targetContents.add(root);
+ }
+
+ return resource;
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/ManagePackagesActionDelegate.java b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/ManagePackagesActionDelegate.java
index 8a514e59af..92da75c783 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/ManagePackagesActionDelegate.java
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/ManagePackagesActionDelegate.java
@@ -1,39 +1,39 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Victor Roldan Betancort - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.emf.cdo.ui.internal.ide.actions;
-
-import org.eclipse.emf.cdo.internal.ui.actions.ManagePackagesAction;
-
-import org.eclipse.jface.action.IAction;
-
-/**
- * @author Victor Roldan Betancort
- */
-public class ManagePackagesActionDelegate extends SessionAwareActionDelegate
-{
- private IAction action;
-
- public ManagePackagesActionDelegate()
- {
- }
-
- @Override
- protected void safeRun() throws Exception
- {
- if (action == null)
- {
- action = new ManagePackagesAction(getPage(), getSession());
- }
-
- action.run();
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Victor Roldan Betancort - initial API and implementation
+ * Eike Stepper - maintenance
+ */
+package org.eclipse.emf.cdo.ui.internal.ide.actions;
+
+import org.eclipse.emf.cdo.internal.ui.actions.ManagePackagesAction;
+
+import org.eclipse.jface.action.IAction;
+
+/**
+ * @author Victor Roldan Betancort
+ */
+public class ManagePackagesActionDelegate extends SessionAwareActionDelegate
+{
+ private IAction action;
+
+ public ManagePackagesActionDelegate()
+ {
+ }
+
+ @Override
+ protected void safeRun() throws Exception
+ {
+ if (action == null)
+ {
+ action = new ManagePackagesAction(getPage(), getSession());
+ }
+
+ action.run();
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/NewResourceActionDelegate.java b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/NewResourceActionDelegate.java
index 9c17b5e346..62b7b340d5 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/NewResourceActionDelegate.java
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/NewResourceActionDelegate.java
@@ -1,33 +1,33 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Victor Roldan Betancort - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.emf.cdo.ui.internal.ide.actions;
-
-import org.eclipse.emf.cdo.eresource.CDOResourceNode;
-import org.eclipse.emf.cdo.eresource.EresourceFactory;
-import org.eclipse.emf.cdo.ui.internal.ide.messages.Messages;
-
-/**
- * @author Eike Stepper
- */
-public class NewResourceActionDelegate extends NewResourceNodeActionDelegate
-{
- public NewResourceActionDelegate()
- {
- super(Messages.getString("NewResourceAction_0")); //$NON-NLS-1$
- }
-
- @Override
- protected CDOResourceNode createNewResourceNode()
- {
- return EresourceFactory.eINSTANCE.createCDOResource();
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Victor Roldan Betancort - initial API and implementation
+ * Eike Stepper - maintenance
+ */
+package org.eclipse.emf.cdo.ui.internal.ide.actions;
+
+import org.eclipse.emf.cdo.eresource.CDOResourceNode;
+import org.eclipse.emf.cdo.eresource.EresourceFactory;
+import org.eclipse.emf.cdo.ui.internal.ide.messages.Messages;
+
+/**
+ * @author Eike Stepper
+ */
+public class NewResourceActionDelegate extends NewResourceNodeActionDelegate
+{
+ public NewResourceActionDelegate()
+ {
+ super(Messages.getString("NewResourceAction_0")); //$NON-NLS-1$
+ }
+
+ @Override
+ protected CDOResourceNode createNewResourceNode()
+ {
+ return EresourceFactory.eINSTANCE.createCDOResource();
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/NewResourceFolderActionDelegate.java b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/NewResourceFolderActionDelegate.java
index 7fb30a6d3f..32699fcf26 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/NewResourceFolderActionDelegate.java
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/NewResourceFolderActionDelegate.java
@@ -1,33 +1,33 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Victor Roldan Betancort - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.emf.cdo.ui.internal.ide.actions;
-
-import org.eclipse.emf.cdo.eresource.CDOResourceNode;
-import org.eclipse.emf.cdo.eresource.EresourceFactory;
-import org.eclipse.emf.cdo.ui.internal.ide.messages.Messages;
-
-/**
- * @author Eike Stepper
- */
-public class NewResourceFolderActionDelegate extends NewResourceNodeActionDelegate
-{
- public NewResourceFolderActionDelegate()
- {
- super(Messages.getString("NewResourceFolderAction_0")); //$NON-NLS-1$
- }
-
- @Override
- protected CDOResourceNode createNewResourceNode()
- {
- return EresourceFactory.eINSTANCE.createCDOResourceFolder();
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Victor Roldan Betancort - initial API and implementation
+ * Eike Stepper - maintenance
+ */
+package org.eclipse.emf.cdo.ui.internal.ide.actions;
+
+import org.eclipse.emf.cdo.eresource.CDOResourceNode;
+import org.eclipse.emf.cdo.eresource.EresourceFactory;
+import org.eclipse.emf.cdo.ui.internal.ide.messages.Messages;
+
+/**
+ * @author Eike Stepper
+ */
+public class NewResourceFolderActionDelegate extends NewResourceNodeActionDelegate
+{
+ public NewResourceFolderActionDelegate()
+ {
+ super(Messages.getString("NewResourceFolderAction_0")); //$NON-NLS-1$
+ }
+
+ @Override
+ protected CDOResourceNode createNewResourceNode()
+ {
+ return EresourceFactory.eINSTANCE.createCDOResourceFolder();
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/NewResourceNodeActionDelegate.java b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/NewResourceNodeActionDelegate.java
index 7169e39f15..cef2593bfe 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/NewResourceNodeActionDelegate.java
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/NewResourceNodeActionDelegate.java
@@ -1,79 +1,79 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Victor Roldan Betancort - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.emf.cdo.ui.internal.ide.actions;
-
-import org.eclipse.emf.cdo.CDOObject;
-import org.eclipse.emf.cdo.eresource.CDOResourceFolder;
-import org.eclipse.emf.cdo.eresource.CDOResourceNode;
-import org.eclipse.emf.cdo.internal.ui.actions.ResourceNodeNameInputValidator;
-import org.eclipse.emf.cdo.transaction.CDOTransaction;
-import org.eclipse.emf.cdo.ui.internal.ide.messages.Messages;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.InputDialog;
-
-/**
- * @author Eike Stepper
- */
-public abstract class NewResourceNodeActionDelegate extends TransactionalBackgroundActionDelegate
-{
- private CDOResourceNode newResourceNode;
-
- public NewResourceNodeActionDelegate(String text)
- {
- super(text);
- }
-
- @Override
- protected CDOObject preRun(CDOObject object)
- {
- InputDialog dialog = new InputDialog(
- getTargetPart().getSite().getShell(),
- getText(),
- Messages.getString("NewResourceNodeAction_0"), null, new ResourceNodeNameInputValidator((CDOResourceNode)object)); //$NON-NLS-1$
- if (dialog.open() == Dialog.OK)
- {
- setNewResourceNode(createNewResourceNode());
- getNewResourceNode().setName(dialog.getValue());
- return super.preRun(object);
- }
-
- return null;
- }
-
- @Override
- protected final void doRun(CDOTransaction transaction, CDOObject object, IProgressMonitor progressMonitor)
- throws Exception
- {
- if (object instanceof CDOResourceFolder)
- {
- ((CDOResourceFolder)object).getNodes().add(getNewResourceNode());
- }
- else
- {
- transaction.getRootResource().getContents().add(getNewResourceNode());
- }
- }
-
- protected void setNewResourceNode(CDOResourceNode newResourceNode)
- {
- this.newResourceNode = newResourceNode;
- }
-
- protected CDOResourceNode getNewResourceNode()
- {
- return newResourceNode;
- }
-
- protected abstract CDOResourceNode createNewResourceNode();
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Victor Roldan Betancort - initial API and implementation
+ * Eike Stepper - maintenance
+ */
+package org.eclipse.emf.cdo.ui.internal.ide.actions;
+
+import org.eclipse.emf.cdo.CDOObject;
+import org.eclipse.emf.cdo.eresource.CDOResourceFolder;
+import org.eclipse.emf.cdo.eresource.CDOResourceNode;
+import org.eclipse.emf.cdo.internal.ui.actions.ResourceNodeNameInputValidator;
+import org.eclipse.emf.cdo.transaction.CDOTransaction;
+import org.eclipse.emf.cdo.ui.internal.ide.messages.Messages;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.InputDialog;
+
+/**
+ * @author Eike Stepper
+ */
+public abstract class NewResourceNodeActionDelegate extends TransactionalBackgroundActionDelegate
+{
+ private CDOResourceNode newResourceNode;
+
+ public NewResourceNodeActionDelegate(String text)
+ {
+ super(text);
+ }
+
+ @Override
+ protected CDOObject preRun(CDOObject object)
+ {
+ InputDialog dialog = new InputDialog(
+ getTargetPart().getSite().getShell(),
+ getText(),
+ Messages.getString("NewResourceNodeAction_0"), null, new ResourceNodeNameInputValidator((CDOResourceNode)object)); //$NON-NLS-1$
+ if (dialog.open() == Dialog.OK)
+ {
+ setNewResourceNode(createNewResourceNode());
+ getNewResourceNode().setName(dialog.getValue());
+ return super.preRun(object);
+ }
+
+ return null;
+ }
+
+ @Override
+ protected final void doRun(CDOTransaction transaction, CDOObject object, IProgressMonitor progressMonitor)
+ throws Exception
+ {
+ if (object instanceof CDOResourceFolder)
+ {
+ ((CDOResourceFolder)object).getNodes().add(getNewResourceNode());
+ }
+ else
+ {
+ transaction.getRootResource().getContents().add(getNewResourceNode());
+ }
+ }
+
+ protected void setNewResourceNode(CDOResourceNode newResourceNode)
+ {
+ this.newResourceNode = newResourceNode;
+ }
+
+ protected CDOResourceNode getNewResourceNode()
+ {
+ return newResourceNode;
+ }
+
+ protected abstract CDOResourceNode createNewResourceNode();
+}
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/RegisterFileSystemPackageActionDelegate.java b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/RegisterFileSystemPackageActionDelegate.java
index ff9c70c6ba..24739ad186 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/RegisterFileSystemPackageActionDelegate.java
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/RegisterFileSystemPackageActionDelegate.java
@@ -1,30 +1,30 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Victor Roldan Betancort - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.emf.cdo.ui.internal.ide.actions;
-
-import org.eclipse.emf.cdo.internal.ui.actions.RegisterFilesystemPackagesAction;
-
-/**
- * @author Victor Roldan Betancort
- */
-public class RegisterFileSystemPackageActionDelegate extends SessionAwareActionDelegate
-{
- public RegisterFileSystemPackageActionDelegate()
- {
- }
-
- @Override
- protected void safeRun() throws Exception
- {
- new RegisterFilesystemPackagesAction(getPage(), getSession()).run();
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Victor Roldan Betancort - initial API and implementation
+ * Eike Stepper - maintenance
+ */
+package org.eclipse.emf.cdo.ui.internal.ide.actions;
+
+import org.eclipse.emf.cdo.internal.ui.actions.RegisterFilesystemPackagesAction;
+
+/**
+ * @author Victor Roldan Betancort
+ */
+public class RegisterFileSystemPackageActionDelegate extends SessionAwareActionDelegate
+{
+ public RegisterFileSystemPackageActionDelegate()
+ {
+ }
+
+ @Override
+ protected void safeRun() throws Exception
+ {
+ new RegisterFilesystemPackagesAction(getPage(), getSession()).run();
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/RegisterWorkspacePackageActionDelegate.java b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/RegisterWorkspacePackageActionDelegate.java
index 21e1ec8327..73b64b3803 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/RegisterWorkspacePackageActionDelegate.java
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/RegisterWorkspacePackageActionDelegate.java
@@ -1,30 +1,30 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Victor Roldan Betancort - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.emf.cdo.ui.internal.ide.actions;
-
-import org.eclipse.emf.cdo.internal.ui.actions.RegisterWorkspacePackagesAction;
-
-/**
- * @author Victor Roldan Betancort
- */
-public class RegisterWorkspacePackageActionDelegate extends SessionAwareActionDelegate
-{
- public RegisterWorkspacePackageActionDelegate()
- {
- }
-
- @Override
- protected void safeRun() throws Exception
- {
- new RegisterWorkspacePackagesAction(getPage(), getSession()).run();
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Victor Roldan Betancort - initial API and implementation
+ * Eike Stepper - maintenance
+ */
+package org.eclipse.emf.cdo.ui.internal.ide.actions;
+
+import org.eclipse.emf.cdo.internal.ui.actions.RegisterWorkspacePackagesAction;
+
+/**
+ * @author Victor Roldan Betancort
+ */
+public class RegisterWorkspacePackageActionDelegate extends SessionAwareActionDelegate
+{
+ public RegisterWorkspacePackageActionDelegate()
+ {
+ }
+
+ @Override
+ protected void safeRun() throws Exception
+ {
+ new RegisterWorkspacePackagesAction(getPage(), getSession()).run();
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/RemoveResourceActionDelegate.java b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/RemoveResourceActionDelegate.java
index 5793719798..77ec36b19b 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/RemoveResourceActionDelegate.java
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/RemoveResourceActionDelegate.java
@@ -1,153 +1,153 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Victor Roldan Betancort - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.emf.cdo.ui.internal.ide.actions;
-
-import org.eclipse.emf.cdo.CDOObject;
-import org.eclipse.emf.cdo.eresource.CDOResource;
-import org.eclipse.emf.cdo.eresource.CDOResourceFolder;
-import org.eclipse.emf.cdo.eresource.CDOResourceNode;
-import org.eclipse.emf.cdo.transaction.CDOTransaction;
-import org.eclipse.emf.cdo.ui.internal.ide.bundle.OM;
-import org.eclipse.emf.cdo.ui.internal.ide.messages.Messages;
-
-import org.eclipse.net4j.util.ui.UIUtil;
-
-import org.eclipse.emf.ecore.EObject;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-
-import java.text.MessageFormat;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @author Victor Roldan Betancort
- */
-public class RemoveResourceActionDelegate implements IObjectActionDelegate
-{
- // private Image deleteIcon;
-
- private List<CDOResourceNode> nodes;
-
- private Shell shell;
-
- public RemoveResourceActionDelegate()
- {
- }
-
- public void setActivePart(IAction action, IWorkbenchPart targetPart)
- {
- shell = targetPart.getSite().getShell();
- }
-
- public void selectionChanged(IAction action, ISelection selection)
- {
- nodes = UIUtil.getElements(selection, CDOResourceNode.class);
- }
-
- public void run(IAction action)
- {
- if (MessageDialog.openConfirm(shell, Messages.getString("RemoveResourceAction_1"), MessageFormat.format( //$NON-NLS-1$
- Messages.getString("RemoveResourceAction_2"), nodes.size()))) //$NON-NLS-1$
- {
- Job job = new Job(Messages.getString("RemoveResourceAction_3")) //$NON-NLS-1$
- {
- @Override
- protected IStatus run(IProgressMonitor monitor)
- {
- Map<Integer, CDOTransaction> repositoryToTransaction = new HashMap<Integer, CDOTransaction>();
- for (CDOResourceNode node : nodes)
- {
- int sessionID = node.cdoView().getSession().getSessionID();
- CDOTransaction transaction = repositoryToTransaction.get(sessionID);
- if (transaction == null)
- {
- transaction = node.cdoView().getSession().openTransaction();
- repositoryToTransaction.put(sessionID, transaction);
- }
-
- CDOObject writableNode = transaction.getObject(node.cdoID());
- EObject container = writableNode.eContainer();
- if (container == null)
- {
- container = (CDOResource)writableNode.eResource();
- }
-
- if (container instanceof CDOResource)
- {
- ((CDOResource)container).getContents().remove(writableNode);
- }
- else if (container instanceof CDOResourceFolder)
- {
- ((CDOResourceFolder)container).getNodes().remove(writableNode);
- }
- }
-
- for (CDOTransaction transaction : repositoryToTransaction.values())
- {
- try
- {
- transaction.commit();
- }
- catch (Exception ex)
- {
- OM.LOG.error(MessageFormat.format(
- Messages.getString("RemoveResourceAction_4"), this.getClass().getName().toString()), ex); //$NON-NLS-1$
- }
- finally
- {
- transaction.close();
- }
- }
-
- // UIUtil.setStatusBarMessage(
- // MessageFormat.format(Messages.getString("RemoveResourceAction_5"), nodes.size()), getDeleteIcon()); //$NON-NLS-1$
- return Status.OK_STATUS;
- }
- };
-
- job.schedule();
- }
- }
-
- // private Image getDeleteIcon()
- // {
- // if (deleteIcon == null)
- // {
- // deleteIcon = OM.Activator
- // .imageDescriptorFromPlugin(OM.BUNDLE_ID, "icons/full/elcl16/delete_edit.gif").createImage(); //$NON-NLS-1$
- // }
- //
- // return deleteIcon;
- // }
- //
- // @Override
- // protected void finalize() throws Throwable
- // {
- // if (deleteIcon != null)
- // {
- // deleteIcon.dispose();
- // }
- //
- // super.finalize();
- // }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Victor Roldan Betancort - initial API and implementation
+ * Eike Stepper - maintenance
+ */
+package org.eclipse.emf.cdo.ui.internal.ide.actions;
+
+import org.eclipse.emf.cdo.CDOObject;
+import org.eclipse.emf.cdo.eresource.CDOResource;
+import org.eclipse.emf.cdo.eresource.CDOResourceFolder;
+import org.eclipse.emf.cdo.eresource.CDOResourceNode;
+import org.eclipse.emf.cdo.transaction.CDOTransaction;
+import org.eclipse.emf.cdo.ui.internal.ide.bundle.OM;
+import org.eclipse.emf.cdo.ui.internal.ide.messages.Messages;
+
+import org.eclipse.net4j.util.ui.UIUtil;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+
+import java.text.MessageFormat;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author Victor Roldan Betancort
+ */
+public class RemoveResourceActionDelegate implements IObjectActionDelegate
+{
+ // private Image deleteIcon;
+
+ private List<CDOResourceNode> nodes;
+
+ private Shell shell;
+
+ public RemoveResourceActionDelegate()
+ {
+ }
+
+ public void setActivePart(IAction action, IWorkbenchPart targetPart)
+ {
+ shell = targetPart.getSite().getShell();
+ }
+
+ public void selectionChanged(IAction action, ISelection selection)
+ {
+ nodes = UIUtil.getElements(selection, CDOResourceNode.class);
+ }
+
+ public void run(IAction action)
+ {
+ if (MessageDialog.openConfirm(shell, Messages.getString("RemoveResourceAction_1"), MessageFormat.format( //$NON-NLS-1$
+ Messages.getString("RemoveResourceAction_2"), nodes.size()))) //$NON-NLS-1$
+ {
+ Job job = new Job(Messages.getString("RemoveResourceAction_3")) //$NON-NLS-1$
+ {
+ @Override
+ protected IStatus run(IProgressMonitor monitor)
+ {
+ Map<Integer, CDOTransaction> repositoryToTransaction = new HashMap<Integer, CDOTransaction>();
+ for (CDOResourceNode node : nodes)
+ {
+ int sessionID = node.cdoView().getSession().getSessionID();
+ CDOTransaction transaction = repositoryToTransaction.get(sessionID);
+ if (transaction == null)
+ {
+ transaction = node.cdoView().getSession().openTransaction();
+ repositoryToTransaction.put(sessionID, transaction);
+ }
+
+ CDOObject writableNode = transaction.getObject(node.cdoID());
+ EObject container = writableNode.eContainer();
+ if (container == null)
+ {
+ container = (CDOResource)writableNode.eResource();
+ }
+
+ if (container instanceof CDOResource)
+ {
+ ((CDOResource)container).getContents().remove(writableNode);
+ }
+ else if (container instanceof CDOResourceFolder)
+ {
+ ((CDOResourceFolder)container).getNodes().remove(writableNode);
+ }
+ }
+
+ for (CDOTransaction transaction : repositoryToTransaction.values())
+ {
+ try
+ {
+ transaction.commit();
+ }
+ catch (Exception ex)
+ {
+ OM.LOG.error(MessageFormat.format(
+ Messages.getString("RemoveResourceAction_4"), this.getClass().getName().toString()), ex); //$NON-NLS-1$
+ }
+ finally
+ {
+ transaction.close();
+ }
+ }
+
+ // UIUtil.setStatusBarMessage(
+ // MessageFormat.format(Messages.getString("RemoveResourceAction_5"), nodes.size()), getDeleteIcon()); //$NON-NLS-1$
+ return Status.OK_STATUS;
+ }
+ };
+
+ job.schedule();
+ }
+ }
+
+ // private Image getDeleteIcon()
+ // {
+ // if (deleteIcon == null)
+ // {
+ // deleteIcon = OM.Activator
+ // .imageDescriptorFromPlugin(OM.BUNDLE_ID, "icons/full/elcl16/delete_edit.gif").createImage(); //$NON-NLS-1$
+ // }
+ //
+ // return deleteIcon;
+ // }
+ //
+ // @Override
+ // protected void finalize() throws Throwable
+ // {
+ // if (deleteIcon != null)
+ // {
+ // deleteIcon.dispose();
+ // }
+ //
+ // super.finalize();
+ // }
+}
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/RenameResourceNodeActionDelegate.java b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/RenameResourceNodeActionDelegate.java
index 0b6c841f98..190277b0c5 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/RenameResourceNodeActionDelegate.java
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/RenameResourceNodeActionDelegate.java
@@ -1,78 +1,78 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Victor Roldan Betancort - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.emf.cdo.ui.internal.ide.actions;
-
-import org.eclipse.emf.cdo.CDOObject;
-import org.eclipse.emf.cdo.eresource.CDOResourceNode;
-import org.eclipse.emf.cdo.internal.ui.actions.ResourceNodeNameInputValidator;
-import org.eclipse.emf.cdo.transaction.CDOTransaction;
-import org.eclipse.emf.cdo.ui.internal.ide.messages.Messages;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.InputDialog;
-
-/**
- * @author Victor Roldan Betancort
- */
-public class RenameResourceNodeActionDelegate extends TransactionalBackgroundActionDelegate
-{
- private String newResourceName;
-
- public RenameResourceNodeActionDelegate()
- {
- super(Messages.getString("RenameResourceNodeActionDelegate.0")); //$NON-NLS-1$
- }
-
- @Override
- protected CDOObject preRun(CDOObject object)
- {
- InputDialog dialog = new InputDialog(
- getTargetPart().getSite().getShell(),
- getText(),
- Messages.getString("NewResourceNodeAction_0"), null, new ResourceNodeNameInputValidator((CDOResourceNode)object)); //$NON-NLS-1$
- if (dialog.open() == Dialog.OK)
- {
- setNewResourceName(dialog.getValue());
- return super.preRun(object);
- }
-
- cancel();
-
- return null;
- }
-
- private void setNewResourceName(String newName)
- {
- newResourceName = newName;
- }
-
- private String getNewResourceName()
- {
- return newResourceName;
- }
-
- @Override
- protected final void doRun(CDOTransaction transaction, CDOObject object, IProgressMonitor progressMonitor)
- throws Exception
- {
- if (object instanceof CDOResourceNode)
- {
- ((CDOResourceNode)object).setName(getNewResourceName());
- }
- else
- {
- throw new IllegalArgumentException("object is not a CDOResourceNode"); //$NON-NLS-1$
- }
- }
-
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Victor Roldan Betancort - initial API and implementation
+ * Eike Stepper - maintenance
+ */
+package org.eclipse.emf.cdo.ui.internal.ide.actions;
+
+import org.eclipse.emf.cdo.CDOObject;
+import org.eclipse.emf.cdo.eresource.CDOResourceNode;
+import org.eclipse.emf.cdo.internal.ui.actions.ResourceNodeNameInputValidator;
+import org.eclipse.emf.cdo.transaction.CDOTransaction;
+import org.eclipse.emf.cdo.ui.internal.ide.messages.Messages;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.InputDialog;
+
+/**
+ * @author Victor Roldan Betancort
+ */
+public class RenameResourceNodeActionDelegate extends TransactionalBackgroundActionDelegate
+{
+ private String newResourceName;
+
+ public RenameResourceNodeActionDelegate()
+ {
+ super(Messages.getString("RenameResourceNodeActionDelegate.0")); //$NON-NLS-1$
+ }
+
+ @Override
+ protected CDOObject preRun(CDOObject object)
+ {
+ InputDialog dialog = new InputDialog(
+ getTargetPart().getSite().getShell(),
+ getText(),
+ Messages.getString("NewResourceNodeAction_0"), null, new ResourceNodeNameInputValidator((CDOResourceNode)object)); //$NON-NLS-1$
+ if (dialog.open() == Dialog.OK)
+ {
+ setNewResourceName(dialog.getValue());
+ return super.preRun(object);
+ }
+
+ cancel();
+
+ return null;
+ }
+
+ private void setNewResourceName(String newName)
+ {
+ newResourceName = newName;
+ }
+
+ private String getNewResourceName()
+ {
+ return newResourceName;
+ }
+
+ @Override
+ protected final void doRun(CDOTransaction transaction, CDOObject object, IProgressMonitor progressMonitor)
+ throws Exception
+ {
+ if (object instanceof CDOResourceNode)
+ {
+ ((CDOResourceNode)object).setName(getNewResourceName());
+ }
+ else
+ {
+ throw new IllegalArgumentException("object is not a CDOResourceNode"); //$NON-NLS-1$
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/SessionAwareActionDelegate.java b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/SessionAwareActionDelegate.java
index 503284fb6e..fb4ba891a9 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/SessionAwareActionDelegate.java
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/SessionAwareActionDelegate.java
@@ -1,42 +1,42 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Victor Roldan Betancort - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.emf.cdo.ui.internal.ide.actions;
-
-import org.eclipse.emf.cdo.session.CDOSession;
-import org.eclipse.emf.cdo.ui.ide.Node;
-
-import org.eclipse.net4j.util.ui.UIUtil;
-import org.eclipse.net4j.util.ui.actions.SafeActionDelegate;
-
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @author Victor Roldan Betancort
- */
-public abstract class SessionAwareActionDelegate extends SafeActionDelegate
-{
- public SessionAwareActionDelegate()
- {
- }
-
- public CDOSession getSession()
- {
- Node node = UIUtil.getElement(getSelection(), Node.class);
- return node.getRepositoryProject().getView().getSession();
- }
-
- public IWorkbenchPage getPage()
- {
- return PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Victor Roldan Betancort - initial API and implementation
+ * Eike Stepper - maintenance
+ */
+package org.eclipse.emf.cdo.ui.internal.ide.actions;
+
+import org.eclipse.emf.cdo.session.CDOSession;
+import org.eclipse.emf.cdo.ui.ide.Node;
+
+import org.eclipse.net4j.util.ui.UIUtil;
+import org.eclipse.net4j.util.ui.actions.SafeActionDelegate;
+
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * @author Victor Roldan Betancort
+ */
+public abstract class SessionAwareActionDelegate extends SafeActionDelegate
+{
+ public SessionAwareActionDelegate()
+ {
+ }
+
+ public CDOSession getSession()
+ {
+ Node node = UIUtil.getElement(getSelection(), Node.class);
+ return node.getRepositoryProject().getView().getSession();
+ }
+
+ public IWorkbenchPage getPage()
+ {
+ return PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/SwitchToBranchActionDelegate.java b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/SwitchToBranchActionDelegate.java
index 589ed01da3..baa2625aef 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/SwitchToBranchActionDelegate.java
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/SwitchToBranchActionDelegate.java
@@ -1,35 +1,35 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Victor Roldan Betancort - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.emf.cdo.ui.internal.ide.actions;
-
-import org.eclipse.emf.cdo.ui.ide.Node.BranchNode;
-import org.eclipse.emf.cdo.view.CDOView;
-
-import org.eclipse.net4j.util.ui.UIUtil;
-
-/**
- * @author Victor Roldan Betancort
- */
-public class SwitchToBranchActionDelegate extends SessionAwareActionDelegate
-{
- public SwitchToBranchActionDelegate()
- {
- }
-
- @Override
- protected void safeRun() throws Exception
- {
- BranchNode branchNode = UIUtil.getElement(getSelection(), BranchNode.class);
- CDOView view = branchNode.getRepositoryProject().getView();
- view.setBranch(branchNode.getBranch());
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Victor Roldan Betancort - initial API and implementation
+ * Eike Stepper - maintenance
+ */
+package org.eclipse.emf.cdo.ui.internal.ide.actions;
+
+import org.eclipse.emf.cdo.ui.ide.Node.BranchNode;
+import org.eclipse.emf.cdo.view.CDOView;
+
+import org.eclipse.net4j.util.ui.UIUtil;
+
+/**
+ * @author Victor Roldan Betancort
+ */
+public class SwitchToBranchActionDelegate extends SessionAwareActionDelegate
+{
+ public SwitchToBranchActionDelegate()
+ {
+ }
+
+ @Override
+ protected void safeRun() throws Exception
+ {
+ BranchNode branchNode = UIUtil.getElement(getSelection(), BranchNode.class);
+ CDOView view = branchNode.getRepositoryProject().getView();
+ view.setBranch(branchNode.getBranch());
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/TransactionalBackgroundActionDelegate.java b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/TransactionalBackgroundActionDelegate.java
index fdad30ae44..05c377b3a9 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/TransactionalBackgroundActionDelegate.java
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/TransactionalBackgroundActionDelegate.java
@@ -1,133 +1,133 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Victor Roldan Betancort - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.emf.cdo.ui.internal.ide.actions;
-
-import org.eclipse.emf.cdo.CDOObject;
-import org.eclipse.emf.cdo.transaction.CDOTransaction;
-import org.eclipse.emf.cdo.ui.internal.ide.messages.Messages;
-import org.eclipse.emf.cdo.view.CDOView;
-
-import org.eclipse.net4j.util.AdapterUtil;
-import org.eclipse.net4j.util.ui.UIUtil;
-import org.eclipse.net4j.util.ui.actions.LongRunningActionDelegate;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-
-import java.text.MessageFormat;
-
-/**
- * @author Victor Roldan Betancort
- */
-public abstract class TransactionalBackgroundActionDelegate extends LongRunningActionDelegate implements
- IObjectActionDelegate
-{
- private IWorkbenchPart targetPart;
-
- private String text;
-
- private CDOObject transactionalObject;
-
- public TransactionalBackgroundActionDelegate(String text)
- {
- this.text = text;
- }
-
- public void setActivePart(IAction action, IWorkbenchPart targetPart)
- {
- this.targetPart = targetPart;
- selectionChanged(action, getSelection());
- }
-
- public IWorkbenchPart getTargetPart()
- {
- return targetPart;
- }
-
- @Override
- protected String getText()
- {
- return text;
- }
-
- protected int getCommitWorkPercent()
- {
- return 90;
- }
-
- @Override
- protected final void preRun() throws Exception
- {
- Object element = UIUtil.getElement(getSelection());
- CDOObject object = AdapterUtil.adapt(element, CDOObject.class);
- if (object != null)
- {
- transactionalObject = preRun(object);
- if (transactionalObject != null)
- {
- CDOView view = transactionalObject.cdoView();
- if (!(view instanceof CDOTransaction))
- {
- throw new IllegalStateException(MessageFormat.format(
- Messages.getString("TransactionalBackgroundAction_0"), transactionalObject)); //$NON-NLS-1$
- }
-
- // Bypass cancel()
- return;
- }
- }
-
- cancel();
- }
-
- /**
- * Usually opens a new transaction based on the passed object and its view/session and returns a "contextualized" copy
- * of this object. Clients may override to access the UI thread before the background job is started or change the
- * contextualization procedure.
- *
- * @param object
- * Usually an object in a read-only view that needs to be modified in a separate transaction.
- * @return A transactional copy of the passed object, or <code>null</code> to indicate cancelation of this action.
- */
- protected CDOObject preRun(CDOObject object)
- {
- CDOTransaction transaction = object.cdoView().getSession().openTransaction();
- CDOObject transactionalObject = transaction.getObject(object);
- return transactionalObject;
- }
-
- @Override
- protected final void doRun(IProgressMonitor progressMonitor) throws Exception
- {
- CDOTransaction transaction = (CDOTransaction)transactionalObject.cdoView();
- int commitWorkPercent = getCommitWorkPercent();
- progressMonitor.beginTask(Messages.getString("TransactionalBackgroundAction_1"), 100); //$NON-NLS-1$
-
- try
- {
- doRun(transaction, transactionalObject, new SubProgressMonitor(progressMonitor, 100 - commitWorkPercent));
- transaction.commit(new SubProgressMonitor(progressMonitor, commitWorkPercent));
- }
- finally
- {
- progressMonitor.done();
- transaction.close();
- transactionalObject = null;
- }
- }
-
- protected abstract void doRun(CDOTransaction transaction, CDOObject object, IProgressMonitor progressMonitor)
- throws Exception;
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Victor Roldan Betancort - initial API and implementation
+ * Eike Stepper - maintenance
+ */
+package org.eclipse.emf.cdo.ui.internal.ide.actions;
+
+import org.eclipse.emf.cdo.CDOObject;
+import org.eclipse.emf.cdo.transaction.CDOTransaction;
+import org.eclipse.emf.cdo.ui.internal.ide.messages.Messages;
+import org.eclipse.emf.cdo.view.CDOView;
+
+import org.eclipse.net4j.util.AdapterUtil;
+import org.eclipse.net4j.util.ui.UIUtil;
+import org.eclipse.net4j.util.ui.actions.LongRunningActionDelegate;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+
+import java.text.MessageFormat;
+
+/**
+ * @author Victor Roldan Betancort
+ */
+public abstract class TransactionalBackgroundActionDelegate extends LongRunningActionDelegate implements
+ IObjectActionDelegate
+{
+ private IWorkbenchPart targetPart;
+
+ private String text;
+
+ private CDOObject transactionalObject;
+
+ public TransactionalBackgroundActionDelegate(String text)
+ {
+ this.text = text;
+ }
+
+ public void setActivePart(IAction action, IWorkbenchPart targetPart)
+ {
+ this.targetPart = targetPart;
+ selectionChanged(action, getSelection());
+ }
+
+ public IWorkbenchPart getTargetPart()
+ {
+ return targetPart;
+ }
+
+ @Override
+ protected String getText()
+ {
+ return text;
+ }
+
+ protected int getCommitWorkPercent()
+ {
+ return 90;
+ }
+
+ @Override
+ protected final void preRun() throws Exception
+ {
+ Object element = UIUtil.getElement(getSelection());
+ CDOObject object = AdapterUtil.adapt(element, CDOObject.class);
+ if (object != null)
+ {
+ transactionalObject = preRun(object);
+ if (transactionalObject != null)
+ {
+ CDOView view = transactionalObject.cdoView();
+ if (!(view instanceof CDOTransaction))
+ {
+ throw new IllegalStateException(MessageFormat.format(
+ Messages.getString("TransactionalBackgroundAction_0"), transactionalObject)); //$NON-NLS-1$
+ }
+
+ // Bypass cancel()
+ return;
+ }
+ }
+
+ cancel();
+ }
+
+ /**
+ * Usually opens a new transaction based on the passed object and its view/session and returns a "contextualized" copy
+ * of this object. Clients may override to access the UI thread before the background job is started or change the
+ * contextualization procedure.
+ *
+ * @param object
+ * Usually an object in a read-only view that needs to be modified in a separate transaction.
+ * @return A transactional copy of the passed object, or <code>null</code> to indicate cancelation of this action.
+ */
+ protected CDOObject preRun(CDOObject object)
+ {
+ CDOTransaction transaction = object.cdoView().getSession().openTransaction();
+ CDOObject transactionalObject = transaction.getObject(object);
+ return transactionalObject;
+ }
+
+ @Override
+ protected final void doRun(IProgressMonitor progressMonitor) throws Exception
+ {
+ CDOTransaction transaction = (CDOTransaction)transactionalObject.cdoView();
+ int commitWorkPercent = getCommitWorkPercent();
+ progressMonitor.beginTask(Messages.getString("TransactionalBackgroundAction_1"), 100); //$NON-NLS-1$
+
+ try
+ {
+ doRun(transaction, transactionalObject, new SubProgressMonitor(progressMonitor, 100 - commitWorkPercent));
+ transaction.commit(new SubProgressMonitor(progressMonitor, commitWorkPercent));
+ }
+ finally
+ {
+ progressMonitor.done();
+ transaction.close();
+ transactionalObject = null;
+ }
+ }
+
+ protected abstract void doRun(CDOTransaction transaction, CDOObject object, IProgressMonitor progressMonitor)
+ throws Exception;
+}
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/ViewAwareActionDelegate.java b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/ViewAwareActionDelegate.java
index 9651e9a8ca..c51a78dcab 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/ViewAwareActionDelegate.java
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/actions/ViewAwareActionDelegate.java
@@ -1,42 +1,42 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Victor Roldan Betancort - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.emf.cdo.ui.internal.ide.actions;
-
-import org.eclipse.emf.cdo.ui.ide.Node;
-import org.eclipse.emf.cdo.view.CDOView;
-
-import org.eclipse.net4j.util.ui.UIUtil;
-import org.eclipse.net4j.util.ui.actions.SafeActionDelegate;
-
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @author Victor Roldan Betancort
- */
-public abstract class ViewAwareActionDelegate extends SafeActionDelegate
-{
- public ViewAwareActionDelegate()
- {
- }
-
- public CDOView getView()
- {
- Node node = UIUtil.getElement(getSelection(), Node.class);
- return node.getRepositoryProject().getView();
- }
-
- public IWorkbenchPage getPage()
- {
- return PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Victor Roldan Betancort - initial API and implementation
+ * Eike Stepper - maintenance
+ */
+package org.eclipse.emf.cdo.ui.internal.ide.actions;
+
+import org.eclipse.emf.cdo.ui.ide.Node;
+import org.eclipse.emf.cdo.view.CDOView;
+
+import org.eclipse.net4j.util.ui.UIUtil;
+import org.eclipse.net4j.util.ui.actions.SafeActionDelegate;
+
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * @author Victor Roldan Betancort
+ */
+public abstract class ViewAwareActionDelegate extends SafeActionDelegate
+{
+ public ViewAwareActionDelegate()
+ {
+ }
+
+ public CDOView getView()
+ {
+ Node node = UIUtil.getElement(getSelection(), Node.class);
+ return node.getRepositoryProject().getView();
+ }
+
+ public IWorkbenchPage getPage()
+ {
+ return PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/bundle/OM.java b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/bundle/OM.java
index a8aaf9e136..ee4079bd32 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/bundle/OM.java
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/bundle/OM.java
@@ -1,60 +1,60 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- * Victor Roldan Betancort - maintenance
- */
-package org.eclipse.emf.cdo.ui.internal.ide.bundle;
-
-import org.eclipse.net4j.util.om.OMBundle;
-import org.eclipse.net4j.util.om.OMPlatform;
-import org.eclipse.net4j.util.om.log.OMLogger;
-import org.eclipse.net4j.util.om.trace.OMTracer;
-import org.eclipse.net4j.util.ui.UIActivator;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-
-/**
- * The <em>Operations & Maintenance</em> class of this bundle.
- *
- * @author Eike Stepper
- */
-public abstract class OM
-{
- public static final String BUNDLE_ID = "org.eclipse.emf.cdo.ui.ide"; //$NON-NLS-1$
-
- public static final String ERROR_ICON = "icons/full/elcl16/error.gif"; //$NON-NLS-1$
-
- public static final String WARNING_ICON = "icons/full/elcl16/warning.gif"; //$NON-NLS-1$
-
- public static final String INFO_ICON = "icons/full/elcl16/info.gif"; //$NON-NLS-1$
-
- public static final String BRANCH_ICON = "icons/full/obj16/branch.png"; //$NON-NLS-1$
-
- public static final OMBundle BUNDLE = OMPlatform.INSTANCE.bundle(BUNDLE_ID, OM.class);
-
- public static final OMLogger LOG = BUNDLE.logger();
-
- public static final OMTracer DEBUG = BUNDLE.tracer("debug"); //$NON-NLS-1$
-
- public static ImageDescriptor getImageDescriptor(String imageFilePath)
- {
- return Activator.imageDescriptorFromPlugin(BUNDLE_ID, imageFilePath);
- }
-
- /**
- * @author Eike Stepper
- */
- public static final class Activator extends UIActivator
- {
- public Activator()
- {
- super(BUNDLE);
- }
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ * Victor Roldan Betancort - maintenance
+ */
+package org.eclipse.emf.cdo.ui.internal.ide.bundle;
+
+import org.eclipse.net4j.util.om.OMBundle;
+import org.eclipse.net4j.util.om.OMPlatform;
+import org.eclipse.net4j.util.om.log.OMLogger;
+import org.eclipse.net4j.util.om.trace.OMTracer;
+import org.eclipse.net4j.util.ui.UIActivator;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+
+/**
+ * The <em>Operations & Maintenance</em> class of this bundle.
+ *
+ * @author Eike Stepper
+ */
+public abstract class OM
+{
+ public static final String BUNDLE_ID = "org.eclipse.emf.cdo.ui.ide"; //$NON-NLS-1$
+
+ public static final String ERROR_ICON = "icons/full/elcl16/error.gif"; //$NON-NLS-1$
+
+ public static final String WARNING_ICON = "icons/full/elcl16/warning.gif"; //$NON-NLS-1$
+
+ public static final String INFO_ICON = "icons/full/elcl16/info.gif"; //$NON-NLS-1$
+
+ public static final String BRANCH_ICON = "icons/full/obj16/branch.png"; //$NON-NLS-1$
+
+ public static final OMBundle BUNDLE = OMPlatform.INSTANCE.bundle(BUNDLE_ID, OM.class);
+
+ public static final OMLogger LOG = BUNDLE.logger();
+
+ public static final OMTracer DEBUG = BUNDLE.tracer("debug"); //$NON-NLS-1$
+
+ public static ImageDescriptor getImageDescriptor(String imageFilePath)
+ {
+ return Activator.imageDescriptorFromPlugin(BUNDLE_ID, imageFilePath);
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ public static final class Activator extends UIActivator
+ {
+ public Activator()
+ {
+ super(BUNDLE);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/messages/Messages.java b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/messages/Messages.java
index 3d98355373..e7c203a417 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/messages/Messages.java
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/messages/Messages.java
@@ -1,40 +1,40 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.ui.internal.ide.messages;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * @author Eike Stepper
- */
-public class Messages
-{
- private static final String BUNDLE_NAME = "org.eclipse.emf.cdo.ui.internal.ide.messages.messages"; //$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
-
- private Messages()
- {
- }
-
- public static String getString(String key)
- {
- try
- {
- return RESOURCE_BUNDLE.getString(key);
- }
- catch (MissingResourceException e)
- {
- return '!' + key + '!';
- }
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.ui.internal.ide.messages;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+/**
+ * @author Eike Stepper
+ */
+public class Messages
+{
+ private static final String BUNDLE_NAME = "org.eclipse.emf.cdo.ui.internal.ide.messages.messages"; //$NON-NLS-1$
+
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
+
+ private Messages()
+ {
+ }
+
+ public static String getString(String key)
+ {
+ try
+ {
+ return RESOURCE_BUNDLE.getString(key);
+ }
+ catch (MissingResourceException e)
+ {
+ return '!' + key + '!';
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/messages/messages.properties b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/messages/messages.properties
index aa79c40446..419aa3aa05 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/messages/messages.properties
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/messages/messages.properties
@@ -1,48 +1,48 @@
-# Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Victor Roldan Betancort - initial API and implementation
-# Eike Stepper - maintenance
-
-ExportSelectedResourceAction_0=Export Resource
-ImportResourceActionDelegate.0=Couldn't Import CDOResource
-ImportResourceToFolderAction_0=Import Resource
-ImportResourceToFolderAction_1=No URI has been introduced
-NewResourceAction_0=Creating CDO resource
-NewResourceFolderAction_0=Creating CDO folder
-NewResourceNodeAction_0=Enter the name
-Node.0=Sessions
-Node.1=Repository does not support branching
-Node.2=Packages
-Node.4=Resources
-RemoveResourceAction_1=Delete Resource
-RemoveResourceAction_2=Are you sure you want to delete the selected {0} item(s)?
-RemoveResourceAction_3=Deleting CDOResource(s)
-RemoveResourceAction_4={0}: Cannot perform commit
-RemoveResourceAction_5={0} element(s) removed
-RenameResourceNodeActionDelegate.0=Rename
-RepositoryContentProvider_0=An error happened. See Error Log for more details.
-TeamConfigurationWizard_1=Share Project to CDO
-TeamConfigurationWizard_2=Enter CDO repository location information
-TeamConfigurationWizard_3=Provide a URL to the target server and a repository name
-TransactionalBackgroundAction_0=Object is not transactional: {0}
-TransactionalBackgroundAction_1=Commit Transaction
-CDOProjectCreationWizard.0=New Project
-CDOProjectCreationWizard.1=Creation Problems
-CDOProjectCreationWizard.2=Create a new project resource.
-CDOProjectCreationWizard.4=Create and Share to CDO a new Project
-CDOProjectCreationWizard.5=Change perspective
-CDOProjectCreationWizard.6=Do you want to switch to CDO Explorer perspective?
-CDOShareProjectWizardPage_0=Please introduce a valid server URL and repository name
-CreateBranchActionDelegate_0=Create a new branch
-CreateBranchActionDelegate_1=Please specify the name of the new branch
-CreateBranchActionDelegate_3=Branch name cannot be empty
-CreateBranchActionDelegate_4=Branch name cannot contain path separators
-CreateBranchActionDelegate_5=A branch with that name already exists
-ExportResourceActionDelegate.0=Couldn't Export CDOResource
-ExportSelectedResourceAction_1=Export CDOResource
+# Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Victor Roldan Betancort - initial API and implementation
+# Eike Stepper - maintenance
+
+ExportSelectedResourceAction_0=Export Resource
+ImportResourceActionDelegate.0=Couldn't Import CDOResource
+ImportResourceToFolderAction_0=Import Resource
+ImportResourceToFolderAction_1=No URI has been introduced
+NewResourceAction_0=Creating CDO resource
+NewResourceFolderAction_0=Creating CDO folder
+NewResourceNodeAction_0=Enter the name
+Node.0=Sessions
+Node.1=Repository does not support branching
+Node.2=Packages
+Node.4=Resources
+RemoveResourceAction_1=Delete Resource
+RemoveResourceAction_2=Are you sure you want to delete the selected {0} item(s)?
+RemoveResourceAction_3=Deleting CDOResource(s)
+RemoveResourceAction_4={0}: Cannot perform commit
+RemoveResourceAction_5={0} element(s) removed
+RenameResourceNodeActionDelegate.0=Rename
+RepositoryContentProvider_0=An error happened. See Error Log for more details.
+TeamConfigurationWizard_1=Share Project to CDO
+TeamConfigurationWizard_2=Enter CDO repository location information
+TeamConfigurationWizard_3=Provide a URL to the target server and a repository name
+TransactionalBackgroundAction_0=Object is not transactional: {0}
+TransactionalBackgroundAction_1=Commit Transaction
+CDOProjectCreationWizard.0=New Project
+CDOProjectCreationWizard.1=Creation Problems
+CDOProjectCreationWizard.2=Create a new project resource.
+CDOProjectCreationWizard.4=Create and Share to CDO a new Project
+CDOProjectCreationWizard.5=Change perspective
+CDOProjectCreationWizard.6=Do you want to switch to CDO Explorer perspective?
+CDOShareProjectWizardPage_0=Please introduce a valid server URL and repository name
+CreateBranchActionDelegate_0=Create a new branch
+CreateBranchActionDelegate_1=Please specify the name of the new branch
+CreateBranchActionDelegate_3=Branch name cannot be empty
+CreateBranchActionDelegate_4=Branch name cannot contain path separators
+CreateBranchActionDelegate_5=A branch with that name already exists
+ExportResourceActionDelegate.0=Couldn't Export CDOResource
+ExportSelectedResourceAction_1=Export CDOResource
ExportSelectedResourceAction_2=No URI has been introduced \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/wizards/CDOProjectCreationWizard.java b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/wizards/CDOProjectCreationWizard.java
index c7b9158b8a..867adb7297 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/wizards/CDOProjectCreationWizard.java
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/wizards/CDOProjectCreationWizard.java
@@ -1,233 +1,233 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Victor Roldan Betancort - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.emf.cdo.ui.internal.ide.wizards;
-
-import org.eclipse.emf.cdo.internal.team.RepositoryManager;
-import org.eclipse.emf.cdo.internal.team.RepositoryTeamProvider;
-import org.eclipse.emf.cdo.internal.ui.perspectives.CDOExplorerPerspective;
-import org.eclipse.emf.cdo.ui.internal.ide.bundle.OM;
-import org.eclipse.emf.cdo.ui.internal.ide.messages.Messages;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IProjectDescription;
-import org.eclipse.core.resources.IResourceStatus;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.team.core.TeamException;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWizard;
-import org.eclipse.ui.WorkbenchException;
-import org.eclipse.ui.dialogs.WizardNewProjectCreationPage;
-import org.eclipse.ui.ide.undo.CreateProjectOperation;
-import org.eclipse.ui.ide.undo.WorkspaceUndoUtil;
-import org.eclipse.ui.statushandlers.IStatusAdapterConstants;
-import org.eclipse.ui.statushandlers.StatusAdapter;
-import org.eclipse.ui.statushandlers.StatusManager;
-
-import java.lang.reflect.InvocationTargetException;
-import java.net.URI;
-
-/**
- * @author Victor Roldan Betancort
- */
-public class CDOProjectCreationWizard extends Wizard implements IWorkbenchWizard
-{
- private WizardNewProjectCreationPage projectCreationPage;
-
- private CDOShareProjectWizardPage sharePage;
-
- // Cache of newly-created project
- private IProject newProject;
-
- private IWorkbench workbench;
-
- public CDOProjectCreationWizard()
- {
- }
-
- @Override
- public boolean performFinish()
- {
- createNewProject();
- if (newProject == null)
- {
- return false;
- }
-
- try
- {
- RepositoryTeamProvider.mapProject(newProject, sharePage.getSessionDescription());
- }
- catch (TeamException ex)
- {
- OM.LOG.equals(ex);
- return false;
- }
-
- RepositoryManager.INSTANCE.addElement(newProject);
- if (!CDOExplorerPerspective.isCurrent())
- {
- openCDOExplorerPerspective(workbench);
- }
-
- return true;
- }
-
- @Override
- public void addPages()
- {
- super.addPages();
- projectCreationPage = new WizardNewProjectCreationPage("basicNewProjectPage"); //$NON-NLS-1$
- projectCreationPage.setTitle(Messages.getString("CDOProjectCreationWizard.4")); //$NON-NLS-1$
- projectCreationPage.setDescription(Messages.getString("CDOProjectCreationWizard.2")); //$NON-NLS-1$
- super.addPage(projectCreationPage);
-
- sharePage = new CDOShareProjectWizardPage("shareProject"); //$NON-NLS-1$
- sharePage.setTitle(Messages.getString("TeamConfigurationWizard_2")); //$NON-NLS-1$
- super.addPage(sharePage);
- }
-
- public void init(IWorkbench workbench, IStructuredSelection currentSelection)
- {
- this.workbench = workbench;
- setNeedsProgressMonitor(true);
- setWindowTitle(Messages.getString("CDOProjectCreationWizard.4")); //$NON-NLS-1$
- initializeDefaultPageImageDescriptor();
- }
-
- protected void initializeDefaultPageImageDescriptor()
- {
- ImageDescriptor desc = OM.getImageDescriptor("icons/full/wizban/wizard_icon.gif");//$NON-NLS-1$
- setDefaultPageImageDescriptor(desc);
- }
-
- private IProject createNewProject()
- {
- if (newProject != null)
- {
- return newProject;
- }
-
- // get a project handle
- final IProject newProjectHandle = projectCreationPage.getProjectHandle();
-
- // get a project descriptor
- URI location = null;
- if (!projectCreationPage.useDefaults())
- {
- location = projectCreationPage.getLocationURI();
- }
-
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- final IProjectDescription description = workspace.newProjectDescription(newProjectHandle.getName());
- description.setLocationURI(location);
-
- // create the new project operation
- IRunnableWithProgress op = new IRunnableWithProgress()
- {
- public void run(IProgressMonitor monitor) throws InvocationTargetException
- {
- CreateProjectOperation op = new CreateProjectOperation(description,
- Messages.getString("CDOProjectCreationWizard.0")); //$NON-NLS-1$
- try
- {
- op.execute(monitor, WorkspaceUndoUtil.getUIInfoAdapter(getShell()));
- }
- catch (ExecutionException e)
- {
- throw new InvocationTargetException(e);
- }
- }
- };
-
- // run the new project creation operation
- try
- {
- getContainer().run(true, true, op);
- }
- catch (InterruptedException e)
- {
- return null;
- }
-
- catch (InvocationTargetException e)
- {
- Throwable t = e.getTargetException();
- if (t instanceof ExecutionException && t.getCause() instanceof CoreException)
- {
- CoreException cause = (CoreException)t.getCause();
- StatusAdapter status;
- if (cause.getStatus().getCode() == IResourceStatus.CASE_VARIANT_EXISTS)
- {
- status = new StatusAdapter(new Status(IStatus.WARNING, OM.BUNDLE_ID, cause.getMessage(), cause));
- }
- else
- {
- status = new StatusAdapter(new Status(cause.getStatus().getSeverity(), OM.BUNDLE_ID, cause.getMessage(),
- cause));
- }
-
- status.setProperty(IStatusAdapterConstants.TITLE_PROPERTY, Messages.getString("CDOProjectCreationWizard.1")); //$NON-NLS-1$
- StatusManager.getManager().handle(status, StatusManager.BLOCK);
- }
- else
- {
- StatusAdapter status = new StatusAdapter(new Status(IStatus.WARNING, OM.BUNDLE_ID, t.getMessage(), t));
- status.setProperty(IStatusAdapterConstants.TITLE_PROPERTY, Messages.getString("CDOProjectCreationWizard.1")); //$NON-NLS-1$
- StatusManager.getManager().handle(status, StatusManager.LOG | StatusManager.BLOCK);
- }
-
- return null;
- }
-
- newProject = newProjectHandle;
- return newProject;
- }
-
- /**
- * Opens CDO Explorer perspective
- */
- public void openCDOExplorerPerspective(final IWorkbench workbench)
- {
- Display.getDefault().asyncExec(new Runnable()
- {
- public void run()
- {
- try
- {
- boolean result = MessageDialog.openQuestion(getShell(), Messages.getString("CDOProjectCreationWizard.5"), //$NON-NLS-1$
- Messages.getString("CDOProjectCreationWizard.6")); //$NON-NLS-1$
- if (result)
- {
- workbench.showPerspective(CDOExplorerPerspective.ID, workbench.getActiveWorkbenchWindow());
- }
- }
- catch (WorkbenchException ex)
- {
- OM.LOG.error(ex);
- // ignore
- }
- }
- });
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Victor Roldan Betancort - initial API and implementation
+ * Eike Stepper - maintenance
+ */
+package org.eclipse.emf.cdo.ui.internal.ide.wizards;
+
+import org.eclipse.emf.cdo.internal.team.RepositoryManager;
+import org.eclipse.emf.cdo.internal.team.RepositoryTeamProvider;
+import org.eclipse.emf.cdo.internal.ui.perspectives.CDOExplorerPerspective;
+import org.eclipse.emf.cdo.ui.internal.ide.bundle.OM;
+import org.eclipse.emf.cdo.ui.internal.ide.messages.Messages;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IResourceStatus;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.team.core.TeamException;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchWizard;
+import org.eclipse.ui.WorkbenchException;
+import org.eclipse.ui.dialogs.WizardNewProjectCreationPage;
+import org.eclipse.ui.ide.undo.CreateProjectOperation;
+import org.eclipse.ui.ide.undo.WorkspaceUndoUtil;
+import org.eclipse.ui.statushandlers.IStatusAdapterConstants;
+import org.eclipse.ui.statushandlers.StatusAdapter;
+import org.eclipse.ui.statushandlers.StatusManager;
+
+import java.lang.reflect.InvocationTargetException;
+import java.net.URI;
+
+/**
+ * @author Victor Roldan Betancort
+ */
+public class CDOProjectCreationWizard extends Wizard implements IWorkbenchWizard
+{
+ private WizardNewProjectCreationPage projectCreationPage;
+
+ private CDOShareProjectWizardPage sharePage;
+
+ // Cache of newly-created project
+ private IProject newProject;
+
+ private IWorkbench workbench;
+
+ public CDOProjectCreationWizard()
+ {
+ }
+
+ @Override
+ public boolean performFinish()
+ {
+ createNewProject();
+ if (newProject == null)
+ {
+ return false;
+ }
+
+ try
+ {
+ RepositoryTeamProvider.mapProject(newProject, sharePage.getSessionDescription());
+ }
+ catch (TeamException ex)
+ {
+ OM.LOG.equals(ex);
+ return false;
+ }
+
+ RepositoryManager.INSTANCE.addElement(newProject);
+ if (!CDOExplorerPerspective.isCurrent())
+ {
+ openCDOExplorerPerspective(workbench);
+ }
+
+ return true;
+ }
+
+ @Override
+ public void addPages()
+ {
+ super.addPages();
+ projectCreationPage = new WizardNewProjectCreationPage("basicNewProjectPage"); //$NON-NLS-1$
+ projectCreationPage.setTitle(Messages.getString("CDOProjectCreationWizard.4")); //$NON-NLS-1$
+ projectCreationPage.setDescription(Messages.getString("CDOProjectCreationWizard.2")); //$NON-NLS-1$
+ super.addPage(projectCreationPage);
+
+ sharePage = new CDOShareProjectWizardPage("shareProject"); //$NON-NLS-1$
+ sharePage.setTitle(Messages.getString("TeamConfigurationWizard_2")); //$NON-NLS-1$
+ super.addPage(sharePage);
+ }
+
+ public void init(IWorkbench workbench, IStructuredSelection currentSelection)
+ {
+ this.workbench = workbench;
+ setNeedsProgressMonitor(true);
+ setWindowTitle(Messages.getString("CDOProjectCreationWizard.4")); //$NON-NLS-1$
+ initializeDefaultPageImageDescriptor();
+ }
+
+ protected void initializeDefaultPageImageDescriptor()
+ {
+ ImageDescriptor desc = OM.getImageDescriptor("icons/full/wizban/wizard_icon.gif");//$NON-NLS-1$
+ setDefaultPageImageDescriptor(desc);
+ }
+
+ private IProject createNewProject()
+ {
+ if (newProject != null)
+ {
+ return newProject;
+ }
+
+ // get a project handle
+ final IProject newProjectHandle = projectCreationPage.getProjectHandle();
+
+ // get a project descriptor
+ URI location = null;
+ if (!projectCreationPage.useDefaults())
+ {
+ location = projectCreationPage.getLocationURI();
+ }
+
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ final IProjectDescription description = workspace.newProjectDescription(newProjectHandle.getName());
+ description.setLocationURI(location);
+
+ // create the new project operation
+ IRunnableWithProgress op = new IRunnableWithProgress()
+ {
+ public void run(IProgressMonitor monitor) throws InvocationTargetException
+ {
+ CreateProjectOperation op = new CreateProjectOperation(description,
+ Messages.getString("CDOProjectCreationWizard.0")); //$NON-NLS-1$
+ try
+ {
+ op.execute(monitor, WorkspaceUndoUtil.getUIInfoAdapter(getShell()));
+ }
+ catch (ExecutionException e)
+ {
+ throw new InvocationTargetException(e);
+ }
+ }
+ };
+
+ // run the new project creation operation
+ try
+ {
+ getContainer().run(true, true, op);
+ }
+ catch (InterruptedException e)
+ {
+ return null;
+ }
+
+ catch (InvocationTargetException e)
+ {
+ Throwable t = e.getTargetException();
+ if (t instanceof ExecutionException && t.getCause() instanceof CoreException)
+ {
+ CoreException cause = (CoreException)t.getCause();
+ StatusAdapter status;
+ if (cause.getStatus().getCode() == IResourceStatus.CASE_VARIANT_EXISTS)
+ {
+ status = new StatusAdapter(new Status(IStatus.WARNING, OM.BUNDLE_ID, cause.getMessage(), cause));
+ }
+ else
+ {
+ status = new StatusAdapter(new Status(cause.getStatus().getSeverity(), OM.BUNDLE_ID, cause.getMessage(),
+ cause));
+ }
+
+ status.setProperty(IStatusAdapterConstants.TITLE_PROPERTY, Messages.getString("CDOProjectCreationWizard.1")); //$NON-NLS-1$
+ StatusManager.getManager().handle(status, StatusManager.BLOCK);
+ }
+ else
+ {
+ StatusAdapter status = new StatusAdapter(new Status(IStatus.WARNING, OM.BUNDLE_ID, t.getMessage(), t));
+ status.setProperty(IStatusAdapterConstants.TITLE_PROPERTY, Messages.getString("CDOProjectCreationWizard.1")); //$NON-NLS-1$
+ StatusManager.getManager().handle(status, StatusManager.LOG | StatusManager.BLOCK);
+ }
+
+ return null;
+ }
+
+ newProject = newProjectHandle;
+ return newProject;
+ }
+
+ /**
+ * Opens CDO Explorer perspective
+ */
+ public void openCDOExplorerPerspective(final IWorkbench workbench)
+ {
+ Display.getDefault().asyncExec(new Runnable()
+ {
+ public void run()
+ {
+ try
+ {
+ boolean result = MessageDialog.openQuestion(getShell(), Messages.getString("CDOProjectCreationWizard.5"), //$NON-NLS-1$
+ Messages.getString("CDOProjectCreationWizard.6")); //$NON-NLS-1$
+ if (result)
+ {
+ workbench.showPerspective(CDOExplorerPerspective.ID, workbench.getActiveWorkbenchWindow());
+ }
+ }
+ catch (WorkbenchException ex)
+ {
+ OM.LOG.error(ex);
+ // ignore
+ }
+ }
+ });
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/wizards/CDOShareProjectWizardPage.java b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/wizards/CDOShareProjectWizardPage.java
index 58fb262b02..0c9050e632 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/wizards/CDOShareProjectWizardPage.java
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/wizards/CDOShareProjectWizardPage.java
@@ -1,78 +1,78 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Victor Roldan Betancort - initial API and implementation
- * Eike Stepper - maintenance
- */
-package org.eclipse.emf.cdo.ui.internal.ide.wizards;
-
-import org.eclipse.emf.cdo.ui.internal.ide.messages.Messages;
-import org.eclipse.emf.cdo.ui.widgets.SessionComposite;
-
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-
-/**
- * @author Victor Roldan Betancort
- */
-public class CDOShareProjectWizardPage extends WizardPage
-{
- private SessionComposite sessionComposite;
-
- private Listener modifyListener = new Listener()
- {
- public void handleEvent(Event e)
- {
- boolean valid = isPageComplete();
- setPageComplete(valid);
- }
- };
-
- public CDOShareProjectWizardPage(String id)
- {
- super(id);
- }
-
- public SessionComposite getSessionComposite()
- {
- return sessionComposite;
- }
-
- public void createControl(Composite parent)
- {
- sessionComposite = new SessionComposite(parent, SWT.NONE);
- setControl(sessionComposite);
- sessionComposite.addListener(SWT.Modify, modifyListener);
- }
-
- public String getSessionDescription()
- {
- return sessionComposite != null ? sessionComposite.getSessionDescription() : null;
- }
-
- public boolean isDescriptionValid()
- {
- return sessionComposite.isDescriptionValid();
- }
-
- @Override
- public boolean isPageComplete()
- {
- if (isDescriptionValid())
- {
- CDOShareProjectWizardPage.this.setErrorMessage(null);
- return true;
- }
-
- CDOShareProjectWizardPage.this.setErrorMessage(Messages.getString("CDOShareProjectWizardPage_0")); //$NON-NLS-1$
- return false;
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Victor Roldan Betancort - initial API and implementation
+ * Eike Stepper - maintenance
+ */
+package org.eclipse.emf.cdo.ui.internal.ide.wizards;
+
+import org.eclipse.emf.cdo.ui.internal.ide.messages.Messages;
+import org.eclipse.emf.cdo.ui.widgets.SessionComposite;
+
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+
+/**
+ * @author Victor Roldan Betancort
+ */
+public class CDOShareProjectWizardPage extends WizardPage
+{
+ private SessionComposite sessionComposite;
+
+ private Listener modifyListener = new Listener()
+ {
+ public void handleEvent(Event e)
+ {
+ boolean valid = isPageComplete();
+ setPageComplete(valid);
+ }
+ };
+
+ public CDOShareProjectWizardPage(String id)
+ {
+ super(id);
+ }
+
+ public SessionComposite getSessionComposite()
+ {
+ return sessionComposite;
+ }
+
+ public void createControl(Composite parent)
+ {
+ sessionComposite = new SessionComposite(parent, SWT.NONE);
+ setControl(sessionComposite);
+ sessionComposite.addListener(SWT.Modify, modifyListener);
+ }
+
+ public String getSessionDescription()
+ {
+ return sessionComposite != null ? sessionComposite.getSessionDescription() : null;
+ }
+
+ public boolean isDescriptionValid()
+ {
+ return sessionComposite.isDescriptionValid();
+ }
+
+ @Override
+ public boolean isPageComplete()
+ {
+ if (isDescriptionValid())
+ {
+ CDOShareProjectWizardPage.this.setErrorMessage(null);
+ return true;
+ }
+
+ CDOShareProjectWizardPage.this.setErrorMessage(Messages.getString("CDOShareProjectWizardPage_0")); //$NON-NLS-1$
+ return false;
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/wizards/TeamConfigurationWizard.java b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/wizards/TeamConfigurationWizard.java
index 2bae1801d4..4616f51648 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/wizards/TeamConfigurationWizard.java
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/internal/ide/wizards/TeamConfigurationWizard.java
@@ -1,74 +1,74 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- * Victor Roldan Betancort - maintenance
- */
-package org.eclipse.emf.cdo.ui.internal.ide.wizards;
-
-import org.eclipse.emf.cdo.internal.team.RepositoryManager;
-import org.eclipse.emf.cdo.internal.team.RepositoryTeamProvider;
-import org.eclipse.emf.cdo.ui.internal.ide.bundle.OM;
-import org.eclipse.emf.cdo.ui.internal.ide.messages.Messages;
-import org.eclipse.emf.cdo.ui.widgets.SessionComposite;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.team.ui.IConfigurationWizard;
-import org.eclipse.ui.IWorkbench;
-
-/**
- * @author Eike Stepper
- */
-public class TeamConfigurationWizard extends Wizard implements IConfigurationWizard
-{
- private IProject project;
-
- private CDOShareProjectWizardPage page1;
-
- public TeamConfigurationWizard()
- {
- }
-
- public void init(IWorkbench workbench, IProject project)
- {
- this.project = project;
- setWindowTitle(Messages.getString("TeamConfigurationWizard_1")); //$NON-NLS-1$
- ImageDescriptor desc = OM.getImageDescriptor("icons/full/wizban/wizard_icon.gif");//$NON-NLS-1$
- setDefaultPageImageDescriptor(desc);
- }
-
- @Override
- public void addPages()
- {
- page1 = new CDOShareProjectWizardPage("page1"); //$NON-NLS-1$
- page1.setTitle(Messages.getString("TeamConfigurationWizard_2")); //$NON-NLS-1$
- addPage(page1);
- }
-
- @Override
- public boolean performFinish()
- {
- try
- {
- SessionComposite sessionComposite = page1.getSessionComposite();
- String sessionDescription = sessionComposite.getSessionDescription();
- sessionComposite.rememberSettings();
-
- RepositoryTeamProvider.mapProject(project, sessionDescription);
- RepositoryManager.INSTANCE.addElement(project);
- return true;
- }
- catch (Exception ex)
- {
- OM.LOG.error(ex);
- return false;
- }
- }
-}
+/*
+ * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ * Victor Roldan Betancort - maintenance
+ */
+package org.eclipse.emf.cdo.ui.internal.ide.wizards;
+
+import org.eclipse.emf.cdo.internal.team.RepositoryManager;
+import org.eclipse.emf.cdo.internal.team.RepositoryTeamProvider;
+import org.eclipse.emf.cdo.ui.internal.ide.bundle.OM;
+import org.eclipse.emf.cdo.ui.internal.ide.messages.Messages;
+import org.eclipse.emf.cdo.ui.widgets.SessionComposite;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.team.ui.IConfigurationWizard;
+import org.eclipse.ui.IWorkbench;
+
+/**
+ * @author Eike Stepper
+ */
+public class TeamConfigurationWizard extends Wizard implements IConfigurationWizard
+{
+ private IProject project;
+
+ private CDOShareProjectWizardPage page1;
+
+ public TeamConfigurationWizard()
+ {
+ }
+
+ public void init(IWorkbench workbench, IProject project)
+ {
+ this.project = project;
+ setWindowTitle(Messages.getString("TeamConfigurationWizard_1")); //$NON-NLS-1$
+ ImageDescriptor desc = OM.getImageDescriptor("icons/full/wizban/wizard_icon.gif");//$NON-NLS-1$
+ setDefaultPageImageDescriptor(desc);
+ }
+
+ @Override
+ public void addPages()
+ {
+ page1 = new CDOShareProjectWizardPage("page1"); //$NON-NLS-1$
+ page1.setTitle(Messages.getString("TeamConfigurationWizard_2")); //$NON-NLS-1$
+ addPage(page1);
+ }
+
+ @Override
+ public boolean performFinish()
+ {
+ try
+ {
+ SessionComposite sessionComposite = page1.getSessionComposite();
+ String sessionDescription = sessionComposite.getSessionDescription();
+ sessionComposite.rememberSettings();
+
+ RepositoryTeamProvider.mapProject(project, sessionDescription);
+ RepositoryManager.INSTANCE.addElement(project);
+ return true;
+ }
+ catch (Exception ex)
+ {
+ OM.LOG.error(ex);
+ return false;
+ }
+ }
+}

Back to the top