| //------------------------------------------------------------------------------ |
| // Copyright (c) 2005, 2007 IBM 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: |
| // IBM Corporation - initial implementation |
| //------------------------------------------------------------------------------ |
| package org.eclipse.epf.diagram.add.edit.parts; |
| |
| import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; |
| import org.eclipse.gmf.runtime.notation.View; |
| import org.eclipse.draw2d.IFigure; |
| import org.eclipse.draw2d.MarginBorder; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.epf.diagram.add.edit.policies.WorkProductCompositeWorkProductCompartmentItemSemanticEditPolicy; |
| |
| import org.eclipse.epf.diagram.add.part.Messages; |
| import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart; |
| |
| import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure; |
| |
| /** |
| * @generated |
| */ |
| public class WorkProductCompositeWorkProductCompartmentEditPart extends |
| ListCompartmentEditPart { |
| |
| /** |
| * @generated |
| */ |
| public static final int VISUAL_ID = 5002; |
| |
| /** |
| * @generated |
| */ |
| public WorkProductCompositeWorkProductCompartmentEditPart(View view) { |
| super(view); |
| } |
| |
| /** |
| * @generated |
| */ |
| protected boolean hasModelChildrenChanged(Notification evt) { |
| return false; |
| } |
| |
| /** |
| * @modified |
| */ |
| public String getCompartmentName() { |
| return ""; //$NON-NLS-1$ |
| } |
| |
| /** |
| * @modified |
| */ |
| public IFigure createFigure() { |
| ResizableCompartmentFigure result = (ResizableCompartmentFigure) super |
| .createFigure(); |
| |
| // remove the spacing |
| result.getScrollPane().getContents().setBorder( |
| new MarginBorder(0, 0, 0, 0)); |
| |
| result.setTitleVisibility(false); |
| result.setBorder(null); |
| |
| // disable scrollpane & compartment title |
| result.getScrollPane().setEnabled(false); |
| return result; |
| } |
| |
| /** |
| * @generated |
| */ |
| protected void createDefaultEditPolicies() { |
| super.createDefaultEditPolicies(); |
| installEditPolicy( |
| EditPolicyRoles.SEMANTIC_ROLE, |
| new WorkProductCompositeWorkProductCompartmentItemSemanticEditPolicy()); |
| } |
| |
| /** |
| * @generated |
| */ |
| protected void setRatio(Double ratio) { |
| // nothing to do -- parent layout does not accept Double constraints as ratio |
| // super.setRatio(ratio); |
| } |
| } |