Skip to main content
aboutsummaryrefslogblamecommitdiffstats
blob: 16c5f086fcd23c7c6422139a7c29624930d80ebf (plain) (tree)
1
2
3
4
5
6
7
8
9
                                                   





                                                          
                                           
                                                                                                  
                                                                                















                                                                                                                                                                                                                      
                                                    




                                                                                                                                
«IMPORT "http://www.eclipse.org/gmf/2006/GenModel"»
«IMPORT "http://www.eclipse.org/emf/2002/Ecore"»

«DEFINE PropertySection FOR gmfgen::GenCustomPropertyTab-»
«EXPAND xpt::Common::copyright FOR sheet.editorGen»
package «sheet.packageName»;

«EXPAND xpt::Common::generatedClassComment»
public class «className» extends org.eclipse.gmf.runtime.lite.properties.AdvancedPropertySection {
	«EXPAND xpt::Common::generatedMemberComment("Modify/unwrap selection.")»
	protected Object transformSelection(Object selected) {
		if (selected instanceof org.eclipse.gef.EditPart) {
			Object model = ((org.eclipse.gef.EditPart) selected).getModel();
			return model instanceof org.eclipse.gmf.runtime.notation.View ? ((org.eclipse.gmf.runtime.notation.View) model).getElement() : null;
		}
		if (selected instanceof org.eclipse.gmf.runtime.notation.View) {
			return ((org.eclipse.gmf.runtime.notation.View) selected).getElement();
		}
		if (selected instanceof org.eclipse.core.runtime.IAdaptable) {
			org.eclipse.gmf.runtime.notation.View view = (org.eclipse.gmf.runtime.notation.View) ((org.eclipse.core.runtime.IAdaptable) selected).getAdapter(org.eclipse.gmf.runtime.notation.View.class);
			if (view != null) {
				return view.getElement();
			}
		}
		return selected;
	}
	«EXPAND xpt::Common::generatedMemberComment»
	protected org.eclipse.emf.common.notify.AdapterFactory getItemProvidersAdapterFactory() {
		return «sheet.editorGen.plugin.getActivatorQualifiedClassName()».getInstance().getItemProvidersAdapterFactory();
	}
}
«ENDDEFINE»

Back to the top