| [comment encoding = UTF-8 |
| ******************************************************************************* |
| * Copyright (c) 2008-2009 Obeo. |
| * 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: |
| * Obeo - initial API and implementation |
| ******************************************************************************* |
| /] |
| [module ereferencesviewerGettersSetters('http://www.eclipse.org/emf/eef/views/1.0.0') extends org::eclipse::emf::eef::codegen::widgets::api::widgetGettersSetters/] |
| |
| [import org::eclipse::emf::eef::codegen::services::common /] |
| [import org::eclipse::emf::eef::codegen::services::naming /] |
| [import org::eclipse::emf::eef::codegen::widgets::api::widgetGettersSetters /] |
| [import org::eclipse::emf::eef::codegen::services::imports /] |
| |
| [template public getterDeclaration(elementEditor : ElementEditor) overrides getterDeclaration ? (elementEditor.representationName('EReferencesViewer'))] |
| [/template] |
| |
| [template public getterImplementation(elementEditor : ElementEditor, fullInterfacePath : String) overrides getterImplementation ? (elementEditor.representationName('EReferencesViewer'))] |
| [/template] |
| |
| [template public setterDeclaration(elementEditor : ElementEditor) overrides setterDeclaration ? (elementEditor.representationName('EReferencesViewer'))] |
| [elementEditor.initSignatureDocumentation()/] |
| [elementEditor.initSignature()/]; |
| |
| [elementEditor.updateSignatureDocumentation()/] |
| [elementEditor.updateSignature()/]; |
| |
| [elementEditor.addFilterSignatureDocumentation()/] |
| [elementEditor.addFilterSignature()/]; |
| |
| [elementEditor.addBusinessFilterSignatureDocumentation()/] |
| [elementEditor.addBusinessFilterSignature()/]; |
| |
| [elementEditor.isContainedInTableSignatureDocumentation()/] |
| [elementEditor.isContainedInTableSignature()/]; |
| [/template] |
| |
| [template public initSignature(elementEditor : ElementEditor) overrides initSignature ? (elementEditor.representationName('EReferencesViewer'))] |
| public void init[elementEditor.viewPackageSignature()/]([include('org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings')/] settings) |
| [/template] |
| |
| [template public getterImplementationDelegate(elementEditor : ElementEditor, fullInterfacePath : String, referencedView : View) overrides getterImplementationDelegate ? (elementEditor.representationName('EReferencesViewer'))] |
| [/template] |
| |
| [template public initSignatureDocumentation(elementEditor : ElementEditor) overrides initSignatureDocumentation ? (elementEditor.representationName('EReferencesViewer'))] |
| /** |
| * Init the [elementEditor.name/] |
| * @param settings settings for the [elementEditor.name/] ReferencesTable |
| */ |
| [/template] |
| |
| |
| [template public setterImplementation(elementEditor : ElementEditor, fullInterfacePath : String) overrides setterImplementation ? (elementEditor.representationName('EReferencesViewer'))] |
| [initSignatureDocumentationImplementation(elementEditor, fullInterfacePath)/] |
| [elementEditor.initSignatureImplementation()/] |
| |
| [updateSignatureDocumentationImplementation(elementEditor, fullInterfacePath)/] |
| [elementEditor.updateSignatureImplementation()/] |
| |
| [addFilterSignatureDocumentationImplementation(elementEditor, fullInterfacePath)/] |
| [elementEditor.addFilterSignatureImplementation()/] |
| |
| [addBusinessFilterSignatureDocumentationImplementation(elementEditor, fullInterfacePath)/] |
| [elementEditor.addBusinessFilterSignatureImplementation()/] |
| |
| [isContainedInTableSignatureDocumentationImplementation(elementEditor, fullInterfacePath)/] |
| [elementEditor.isContainedInTableSignatureImplementation()/] |
| [/template] |
| |
| [template public setterImplementationDelegate(elementEditor : ElementEditor, fullInterfacePath : String, referencedView : View) overrides setterImplementationDelegate ? (elementEditor.representationName('EReferencesViewer'))] |
| [initSignatureDocumentationImplementation(elementEditor, fullInterfacePath)/] |
| [elementEditor.initSignature()/] { |
| [referencedView.name.toJavaIdentifier()/]PropertiesEditionPart.init[elementEditor.viewPackageSignature()/](settings); |
| } |
| |
| [updateSignatureDocumentationImplementation(elementEditor, fullInterfacePath)/] |
| [elementEditor.updateSignature()/] { |
| [referencedView.name.toJavaIdentifier()/]PropertiesEditionPart.update[elementEditor.viewPackageSignature()/](); |
| } |
| |
| [addFilterSignatureDocumentationImplementation(elementEditor, fullInterfacePath)/] |
| [elementEditor.addFilterSignature()/] { |
| [referencedView.name.toJavaIdentifier()/]PropertiesEditionPart.addFilterTo[elementEditor.viewPackageSignature()/](filter); |
| } |
| |
| [addBusinessFilterSignatureDocumentationImplementation(elementEditor, fullInterfacePath)/] |
| [elementEditor.addBusinessFilterSignature()/] { |
| [referencedView.name.toJavaIdentifier()/]PropertiesEditionPart.addBusinessFilterTo[elementEditor.viewPackageSignature()/](filter); |
| } |
| |
| [isContainedInTableSignatureDocumentationImplementation(elementEditor, fullInterfacePath)/] |
| [elementEditor.isContainedInTableSignature()/] { |
| return [referencedView.name.toJavaIdentifier()/]PropertiesEditionPart.isContainedIn[elementEditor.viewPackageSignature()/]Table(element); |
| } |
| [/template] |
| |
| [template public initSignatureDocumentationImplementation(elementEditor : ElementEditor, fullInterfacePath : String) overrides initSignatureDocumentationImplementation ? (elementEditor.representationName('EReferencesViewer'))] |
| /** |
| * {@inheritDoc} |
| * |
| * @see [fullInterfacePath/]#init[elementEditor.viewPackageSignature()/](org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings) |
| */ |
| [/template] |
| |
| [template public initSignatureImplementation(elementEditor : ElementEditor) overrides initSignatureImplementation ? (elementEditor.representationName('EReferencesViewer'))] |
| [elementEditor.initSignature()/] { |
| if (current.eResource() != null && current.eResource().getResourceSet() != null) |
| this.resourceSet = current.eResource().getResourceSet(); |
| [include('org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableContentProvider')/] contentProvider = new ReferencesTableContentProvider(); |
| [elementEditor.elementEditorName()/].setContentProvider(contentProvider); |
| [elementEditor.elementEditorName()/].setInput(settings); |
| [elementEditor.readOnly()/] |
| } |
| [/template] |
| |
| [template public addFilterSignatureImplementation(elementEditor : ElementEditor) ? (elementEditor.representationName('EReferencesViewer'))] |
| [elementEditor.addFilterSignature()/] { |
| [elementEditor.elementEditorName()/]Filters.add(filter); |
| } |
| [/template] |
| |
| [template public addBusinessFilterSignatureImplementation(elementEditor : ElementEditor) ? (elementEditor.representationName('EReferencesViewer'))] |
| [elementEditor.addBusinessFilterSignature()/] { |
| [elementEditor.elementEditorName()/]BusinessFilters.add(filter); |
| } |
| [/template] |
| |
| [template public isContainedInTableSignatureImplementation(elementEditor : ElementEditor) ? (elementEditor.representationName('EReferencesViewer'))] |
| [elementEditor.isContainedInTableSignature()/] { |
| return ((ReferencesTableSettings)[elementEditor.elementEditorName()/].getInput()).contains(element); |
| } |
| [/template] |
| |
| [template public readOnly (editor : ElementEditor) overrides readOnly ? (editor.representationName('EReferencesViewer'))] |
| [if (editor.readOnly)] |
| [setReadOnly()/] |
| [else] |
| boolean eefElementEditorReadOnlyState = isReadOnly([editor.editorID()/][navigationReadOnly()/]); |
| if (eefElementEditorReadOnlyState && [editor.elementEditorName()/].getTable().isEnabled()) { |
| [editor.setReadOnly()/] |
| } else if (!eefElementEditorReadOnlyState && ![editor.elementEditorName()/].getTable().isEnabled()) { |
| [editor.unsetReadOnly()/] |
| } |
| [/if] |
| [/template] |