blob: 47a336beceb472e8ef86823820987d5f8d5f9aba [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2006 Borland Software Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Borland Software Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.gmf.examples.mindmap.diagram.view.factories;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.emf.ecore.EAnnotation;
import org.eclipse.emf.ecore.EcoreFactory;
import org.eclipse.gmf.examples.mindmap.diagram.edit.parts.MapEditPart;
import org.eclipse.gmf.examples.mindmap.diagram.part.MindmapVisualIDRegistry;
import org.eclipse.gmf.runtime.diagram.ui.view.factories.ListCompartmentViewFactory;
import org.eclipse.gmf.runtime.notation.View;
/**
* @generated
*/
public class Topic_ThreadCompartmentViewFactory extends ListCompartmentViewFactory {
/**
* @generated
*/
protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
if (semanticHint == null) {
semanticHint = MindmapVisualIDRegistry.getType(org.eclipse.gmf.examples.mindmap.diagram.edit.parts.Topic_ThreadCompartmentEditPart.VISUAL_ID);
view.setType(semanticHint);
}
super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
if (!MapEditPart.MODEL_ID.equals(MindmapVisualIDRegistry.getModelID(containerView))) {
EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
shortcutAnnotation.getDetails().put("modelID", MapEditPart.MODEL_ID);
view.getEAnnotations().add(shortcutAnnotation);
}
}
}