/*
* Copyright (c) 2007 Borland Software Corporation
*
* 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:
* Dmitry Stadnik (Borland) - initial API and implementation
*/
package org.eclipse.gmf.examples.taipan.port.diagram.edit.parts;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPartFactory;
import org.eclipse.gef.tools.CellEditorLocator;
import org.eclipse.gmf.examples.taipan.port.diagram.part.TaiPanVisualIDRegistry;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.gmf.tooling.runtime.directedit.locator.CellEditorLocatorAccess;
/**
* @generated
*/
public class TaiPanEditPartFactory implements EditPartFactory {
/**
* @generated
*/
public EditPart createEditPart(EditPart context, Object model) {
if (model instanceof View) {
View view = (View) model;
switch (TaiPanVisualIDRegistry.getVisualID(view)) {
case PortEditPart.VISUAL_ID:
return new PortEditPart(view);
case BuildingEditPart.VISUAL_ID:
return new BuildingEditPart(view);
case BuildingInfoEditPart.VISUAL_ID:
return new BuildingInfoEditPart(view);
}
}
return createUnrecognizedEditPart(context, model);
}
/**
* @generated
*/
private EditPart createUnrecognizedEditPart(EditPart context, Object model) {
// Handle creation of unrecognized child node EditParts here
return null;
}
/**
* @generated
*/
public static CellEditorLocator getTextCellEditorLocator(ITextAwareEditPart source) {
return CellEditorLocatorAccess.INSTANCE.getTextCellEditorLocator(source);
}
}