Example #1
0
  /** @generated */
  protected NodeFigure createNodePlate() {
    String prefElementId = "Port";
    IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
    String preferenceConstantWitdh =
        PreferenceInitializerForElementHelper.getpreferenceKey(
            getNotationView(), prefElementId, PreferenceConstantHelper.WIDTH);
    String preferenceConstantHeight =
        PreferenceInitializerForElementHelper.getpreferenceKey(
            getNotationView(), prefElementId, PreferenceConstantHelper.HEIGHT);
    DefaultSizeNodeFigure result =
        new DefaultSizeNodeFigure(
            store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));

    // FIXME: workaround for #154536
    result.getBounds().setSize(result.getPreferredSize());
    return result;
  }
/** The Class UmlComponentDiagramForMultiEditor. */
public class UmlComponentDiagramForMultiEditor extends UMLDiagramEditor {

  /** The location of diagram icon in the plug-in. */
  private static final String DIAG_IMG_PATH = "icons/obj16/ComponentDiagram.gif";

  /** The image descriptor of the diagram icon. */
  private static final ImageDescriptor DIAG_IMG_DESC =
      UMLDiagramEditorPlugin.getBundledImageDescriptor(
          UmlComponentDiagramForMultiEditor.DIAG_IMG_PATH);

  /** The editor splitter. */
  private Composite splitter;

  /**
   * Constructor for SashSystem v2. Context and required objects are retrieved from the
   * ServiceRegistry.
   *
   * @param servicesRegistry the services registry
   * @param diagram the diagram
   * @throws BackboneException the backbone exception
   * @throws ServiceException the service exception
   */
  public UmlComponentDiagramForMultiEditor(ServicesRegistry servicesRegistry, Diagram diagram)
      throws BackboneException, ServiceException {
    super(servicesRegistry, diagram);
  }

  /**
   * Inits the.
   *
   * @param site the site
   * @param input the input
   * @throws PartInitException the part init exception
   * @see
   *     org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor#init(org.eclipse.ui.IEditorSite,
   *     org.eclipse.ui.IEditorInput)
   */
  @Override
  public void init(IEditorSite site, IEditorInput input) throws PartInitException {
    super.init(site, input);
    setPartName(getDiagram().getName());
    setTitleImage(DIAG_IMG_DESC.createImage());
  }

  /**
   * Sets the input.
   *
   * @param input the new input
   * @see
   *     org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor#setInput(org.eclipse.ui.IEditorInput)
   */
  @Override
  public void setInput(IEditorInput input) {
    try {
      // Provide an URI with fragment in order to reuse the same Resource
      // and set the diagram to the fragment.
      URIEditorInput uriInput = new URIEditorInput(EcoreUtil.getURI(getDiagram()));
      doSetInput(uriInput, true);
    } catch (CoreException x) {
      String title = "Problem opening";
      String msg = "Cannot open input element:";
      Shell shell = getSite().getShell();
      ErrorDialog.openError(shell, title, msg, x.getStatus());
    }
  }

  /**
   * Creates the graphical viewer.
   *
   * @param parent the parent
   * @see
   *     org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor#createGraphicalViewer(org.eclipse.swt.widgets.Composite)
   */
  @Override
  protected void createGraphicalViewer(Composite parent) {
    splitter = parent;
    super.createGraphicalViewer(parent);
  }

  /**
   * Sets the focus.
   *
   * @see org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorWithFlyOutPalette#setFocus()
   */
  @Override
  public void setFocus() {
    splitter.setFocus();
    super.setFocus();
  }

  /**
   * Gets the editing domain id.
   *
   * @return the editing domain id
   * @see
   *     org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor#getEditingDomainID()
   */
  @Override
  public String getEditingDomainID() {
    return "org.eclipse.papyrus.diagram.component.EditingDomain";
  }
}
Example #3
0
 /** Access restriction on constructors */
 private Log() {
   super(UMLDiagramEditorPlugin.getInstance());
 }
 /** @generated */
 public DiagramPrintingPreferencePage() {
   setPreferenceStore(UMLDiagramEditorPlugin.getInstance().getPreferenceStore());
 }