Example usage for org.eclipse.jface.viewers StructuredSelection EMPTY

List of usage examples for org.eclipse.jface.viewers StructuredSelection EMPTY

Introduction

In this page you can find the example usage for org.eclipse.jface.viewers StructuredSelection EMPTY.

Prototype

StructuredSelection EMPTY

To view the source code for org.eclipse.jface.viewers StructuredSelection EMPTY.

Click Source Link

Document

The canonical empty selection.

Usage

From source file:edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.diagram.part.ICSE15_SequenceDiagram_MAVONewDiagramFileWizard.java

License:Open Source License

/**
* @generated/*from  w  w  w.  j  av  a2  s  . c  o  m*/
*/
public ICSE15_SequenceDiagram_MAVONewDiagramFileWizard(URI domainModelURI, EObject diagramRoot,
        TransactionalEditingDomain editingDomain) {
    assert domainModelURI != null : "Domain model uri must be specified"; //$NON-NLS-1$
    assert diagramRoot != null : "Doagram root element must be specified"; //$NON-NLS-1$
    assert editingDomain != null : "Editing domain must be specified"; //$NON-NLS-1$

    myFileCreationPage = new WizardNewFileCreationPage(
            edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.diagram.part.Messages.ICSE15_SequenceDiagram_MAVONewDiagramFileWizard_CreationPageName,
            StructuredSelection.EMPTY);
    myFileCreationPage.setTitle(
            edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.diagram.part.Messages.ICSE15_SequenceDiagram_MAVONewDiagramFileWizard_CreationPageTitle);
    myFileCreationPage.setDescription(NLS.bind(
            edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.diagram.part.Messages.ICSE15_SequenceDiagram_MAVONewDiagramFileWizard_CreationPageDescription,
            edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.diagram.edit.parts.SequenceDiagramEditPart.MODEL_ID));
    IPath filePath;
    String fileName = URI.decode(domainModelURI.trimFileExtension().lastSegment());
    if (domainModelURI.isPlatformResource()) {
        filePath = new Path(domainModelURI.trimSegments(1).toPlatformString(true));
    } else if (domainModelURI.isFile()) {
        filePath = new Path(domainModelURI.trimSegments(1).toFileString());
    } else {
        // TODO : use some default path
        throw new IllegalArgumentException("Unsupported URI: " + domainModelURI); //$NON-NLS-1$
    }
    myFileCreationPage.setContainerFullPath(filePath);
    myFileCreationPage.setFileName(
            edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.diagram.part.ICSE15_SequenceDiagram_MAVODiagramEditorUtil
                    .getUniqueFileName(filePath, fileName, "icse15_sequencediagramdiag_mavo")); //$NON-NLS-1$

    diagramRootElementSelectionPage = new DiagramRootElementSelectionPage(
            edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.diagram.part.Messages.ICSE15_SequenceDiagram_MAVONewDiagramFileWizard_RootSelectionPageName);
    diagramRootElementSelectionPage.setTitle(
            edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.diagram.part.Messages.ICSE15_SequenceDiagram_MAVONewDiagramFileWizard_RootSelectionPageTitle);
    diagramRootElementSelectionPage.setDescription(
            edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.diagram.part.Messages.ICSE15_SequenceDiagram_MAVONewDiagramFileWizard_RootSelectionPageDescription);
    diagramRootElementSelectionPage.setModelElement(diagramRoot);

    myEditingDomain = editingDomain;
}

From source file:edu.toronto.cs.se.modelepedia.istar.diagram.navigator.IStarNavigatorLinkHelper.java

License:Open Source License

/**
 * @generated/*w  ww .j a  v  a  2s .  co m*/
 */
public IStructuredSelection findSelection(IEditorInput anInput) {
    IDiagramDocument document = IStarDiagramEditorPlugin.getInstance().getDocumentProvider()
            .getDiagramDocument(anInput);
    if (document == null) {
        return StructuredSelection.EMPTY;
    }
    Diagram diagram = document.getDiagram();
    if (diagram == null || diagram.eResource() == null) {
        return StructuredSelection.EMPTY;
    }
    IFile file = WorkspaceSynchronizer.getFile(diagram.eResource());
    if (file != null) {
        IStarNavigatorItem item = new IStarNavigatorItem(diagram, file, false);
        return new StructuredSelection(item);
    }
    return StructuredSelection.EMPTY;
}

From source file:edu.toronto.cs.se.modelepedia.istar.diagram.part.IStarDiagramEditor.java

License:Open Source License

/**
 * @generated//from w  ww  . j a  v a 2s.co  m
 */
private ISelection getNavigatorSelection() {
    IDiagramDocument document = getDiagramDocument();
    if (document == null) {
        return StructuredSelection.EMPTY;
    }
    Diagram diagram = document.getDiagram();
    if (diagram == null || diagram.eResource() == null) {
        return StructuredSelection.EMPTY;
    }
    IFile file = WorkspaceSynchronizer.getFile(diagram.eResource());
    if (file != null) {
        IStarNavigatorItem item = new IStarNavigatorItem(diagram, file, false);
        return new StructuredSelection(item);
    }
    return StructuredSelection.EMPTY;
}

From source file:edu.toronto.cs.se.modelepedia.istar.diagram.part.IStarNewDiagramFileWizard.java

License:Open Source License

/**
 * @generated//from   w  ww.  ja  va  2s.c o  m
 */
public IStarNewDiagramFileWizard(URI domainModelURI, EObject diagramRoot,
        TransactionalEditingDomain editingDomain) {
    assert domainModelURI != null : "Domain model uri must be specified"; //$NON-NLS-1$
    assert diagramRoot != null : "Doagram root element must be specified"; //$NON-NLS-1$
    assert editingDomain != null : "Editing domain must be specified"; //$NON-NLS-1$

    myFileCreationPage = new WizardNewFileCreationPage(Messages.IStarNewDiagramFileWizard_CreationPageName,
            StructuredSelection.EMPTY);
    myFileCreationPage.setTitle(Messages.IStarNewDiagramFileWizard_CreationPageTitle);
    myFileCreationPage.setDescription(
            NLS.bind(Messages.IStarNewDiagramFileWizard_CreationPageDescription, IStarEditPart.MODEL_ID));
    IPath filePath;
    String fileName = URI.decode(domainModelURI.trimFileExtension().lastSegment());
    if (domainModelURI.isPlatformResource()) {
        filePath = new Path(domainModelURI.trimSegments(1).toPlatformString(true));
    } else if (domainModelURI.isFile()) {
        filePath = new Path(domainModelURI.trimSegments(1).toFileString());
    } else {
        // TODO : use some default path
        throw new IllegalArgumentException("Unsupported URI: " + domainModelURI); //$NON-NLS-1$
    }
    myFileCreationPage.setContainerFullPath(filePath);
    myFileCreationPage.setFileName(IStarDiagramEditorUtil.getUniqueFileName(filePath, fileName, "istardiag")); //$NON-NLS-1$

    diagramRootElementSelectionPage = new DiagramRootElementSelectionPage(
            Messages.IStarNewDiagramFileWizard_RootSelectionPageName);
    diagramRootElementSelectionPage.setTitle(Messages.IStarNewDiagramFileWizard_RootSelectionPageTitle);
    diagramRootElementSelectionPage
            .setDescription(Messages.IStarNewDiagramFileWizard_RootSelectionPageDescription);
    diagramRootElementSelectionPage.setModelElement(diagramRoot);

    myEditingDomain = editingDomain;
}

From source file:edu.toronto.cs.se.modelepedia.istar_mavo.diagram.navigator.IStar_MAVONavigatorLinkHelper.java

License:Open Source License

/**
* @generated//w w  w.j a v  a2  s  .com
*/
public IStructuredSelection findSelection(IEditorInput anInput) {
    IDiagramDocument document = edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.IStar_MAVODiagramEditorPlugin
            .getInstance().getDocumentProvider().getDiagramDocument(anInput);
    if (document == null) {
        return StructuredSelection.EMPTY;
    }
    Diagram diagram = document.getDiagram();
    if (diagram == null || diagram.eResource() == null) {
        return StructuredSelection.EMPTY;
    }
    IFile file = WorkspaceSynchronizer.getFile(diagram.eResource());
    if (file != null) {
        edu.toronto.cs.se.modelepedia.istar_mavo.diagram.navigator.IStar_MAVONavigatorItem item = new edu.toronto.cs.se.modelepedia.istar_mavo.diagram.navigator.IStar_MAVONavigatorItem(
                diagram, file, false);
        return new StructuredSelection(item);
    }
    return StructuredSelection.EMPTY;
}

From source file:edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.IStar_MAVODiagramEditor.java

License:Open Source License

/**
* @generated/*from w  w w  .  j  a v  a  2s  .  c  o  m*/
*/
private ISelection getNavigatorSelection() {
    IDiagramDocument document = getDiagramDocument();
    if (document == null) {
        return StructuredSelection.EMPTY;
    }
    Diagram diagram = document.getDiagram();
    if (diagram == null || diagram.eResource() == null) {
        return StructuredSelection.EMPTY;
    }
    IFile file = WorkspaceSynchronizer.getFile(diagram.eResource());
    if (file != null) {
        edu.toronto.cs.se.modelepedia.istar_mavo.diagram.navigator.IStar_MAVONavigatorItem item = new edu.toronto.cs.se.modelepedia.istar_mavo.diagram.navigator.IStar_MAVONavigatorItem(
                diagram, file, false);
        return new StructuredSelection(item);
    }
    return StructuredSelection.EMPTY;
}

From source file:edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.IStar_MAVONewDiagramFileWizard.java

License:Open Source License

/**
* @generated/*  www. j  ava2 s  .  c  o  m*/
*/
public IStar_MAVONewDiagramFileWizard(URI domainModelURI, EObject diagramRoot,
        TransactionalEditingDomain editingDomain) {
    assert domainModelURI != null : "Domain model uri must be specified"; //$NON-NLS-1$
    assert diagramRoot != null : "Doagram root element must be specified"; //$NON-NLS-1$
    assert editingDomain != null : "Editing domain must be specified"; //$NON-NLS-1$

    myFileCreationPage = new WizardNewFileCreationPage(
            edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.Messages.IStar_MAVONewDiagramFileWizard_CreationPageName,
            StructuredSelection.EMPTY);
    myFileCreationPage.setTitle(
            edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.Messages.IStar_MAVONewDiagramFileWizard_CreationPageTitle);
    myFileCreationPage.setDescription(NLS.bind(
            edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.Messages.IStar_MAVONewDiagramFileWizard_CreationPageDescription,
            edu.toronto.cs.se.modelepedia.istar_mavo.diagram.edit.parts.IStarEditPart.MODEL_ID));
    IPath filePath;
    String fileName = URI.decode(domainModelURI.trimFileExtension().lastSegment());
    if (domainModelURI.isPlatformResource()) {
        filePath = new Path(domainModelURI.trimSegments(1).toPlatformString(true));
    } else if (domainModelURI.isFile()) {
        filePath = new Path(domainModelURI.trimSegments(1).toFileString());
    } else {
        // TODO : use some default path
        throw new IllegalArgumentException("Unsupported URI: " + domainModelURI); //$NON-NLS-1$
    }
    myFileCreationPage.setContainerFullPath(filePath);
    myFileCreationPage
            .setFileName(edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.IStar_MAVODiagramEditorUtil
                    .getUniqueFileName(filePath, fileName, "istardiag_mavo")); //$NON-NLS-1$

    diagramRootElementSelectionPage = new DiagramRootElementSelectionPage(
            edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.Messages.IStar_MAVONewDiagramFileWizard_RootSelectionPageName);
    diagramRootElementSelectionPage.setTitle(
            edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.Messages.IStar_MAVONewDiagramFileWizard_RootSelectionPageTitle);
    diagramRootElementSelectionPage.setDescription(
            edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.Messages.IStar_MAVONewDiagramFileWizard_RootSelectionPageDescription);
    diagramRootElementSelectionPage.setModelElement(diagramRoot);

    myEditingDomain = editingDomain;
}

From source file:edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.navigator.NECSIS14_ClassDiagramNavigatorLinkHelper.java

License:Open Source License

/**
 * @generated/*from  ww w.  j a  va 2  s .  co  m*/
 */
public IStructuredSelection findSelection(IEditorInput anInput) {
    IDiagramDocument document = edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.part.NECSIS14_ClassDiagramDiagramEditorPlugin
            .getInstance().getDocumentProvider().getDiagramDocument(anInput);
    if (document == null) {
        return StructuredSelection.EMPTY;
    }
    Diagram diagram = document.getDiagram();
    if (diagram == null || diagram.eResource() == null) {
        return StructuredSelection.EMPTY;
    }
    IFile file = WorkspaceSynchronizer.getFile(diagram.eResource());
    if (file != null) {
        edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.navigator.NECSIS14_ClassDiagramNavigatorItem item = new edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.navigator.NECSIS14_ClassDiagramNavigatorItem(
                diagram, file, false);
        return new StructuredSelection(item);
    }
    return StructuredSelection.EMPTY;
}

From source file:edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.part.NECSIS14_ClassDiagramDiagramEditor.java

License:Open Source License

/**
 * @generated//from   ww  w  . j a v a  2  s.com
 */
private ISelection getNavigatorSelection() {
    IDiagramDocument document = getDiagramDocument();
    if (document == null) {
        return StructuredSelection.EMPTY;
    }
    Diagram diagram = document.getDiagram();
    if (diagram == null || diagram.eResource() == null) {
        return StructuredSelection.EMPTY;
    }
    IFile file = WorkspaceSynchronizer.getFile(diagram.eResource());
    if (file != null) {
        edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.navigator.NECSIS14_ClassDiagramNavigatorItem item = new edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.navigator.NECSIS14_ClassDiagramNavigatorItem(
                diagram, file, false);
        return new StructuredSelection(item);
    }
    return StructuredSelection.EMPTY;
}

From source file:edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.part.NECSIS14_ClassDiagramNewDiagramFileWizard.java

License:Open Source License

/**
 * @generated// w  w w  . j a v a  2s  .  com
 */
public NECSIS14_ClassDiagramNewDiagramFileWizard(URI domainModelURI, EObject diagramRoot,
        TransactionalEditingDomain editingDomain) {
    assert domainModelURI != null : "Domain model uri must be specified"; //$NON-NLS-1$
    assert diagramRoot != null : "Doagram root element must be specified"; //$NON-NLS-1$
    assert editingDomain != null : "Editing domain must be specified"; //$NON-NLS-1$

    myFileCreationPage = new WizardNewFileCreationPage(
            edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.part.Messages.NECSIS14_ClassDiagramNewDiagramFileWizard_CreationPageName,
            StructuredSelection.EMPTY);
    myFileCreationPage.setTitle(
            edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.part.Messages.NECSIS14_ClassDiagramNewDiagramFileWizard_CreationPageTitle);
    myFileCreationPage.setDescription(NLS.bind(
            edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.part.Messages.NECSIS14_ClassDiagramNewDiagramFileWizard_CreationPageDescription,
            edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.edit.parts.ClassDiagramEditPart.MODEL_ID));
    IPath filePath;
    String fileName = URI.decode(domainModelURI.trimFileExtension().lastSegment());
    if (domainModelURI.isPlatformResource()) {
        filePath = new Path(domainModelURI.trimSegments(1).toPlatformString(true));
    } else if (domainModelURI.isFile()) {
        filePath = new Path(domainModelURI.trimSegments(1).toFileString());
    } else {
        // TODO : use some default path
        throw new IllegalArgumentException("Unsupported URI: " + domainModelURI); //$NON-NLS-1$
    }
    myFileCreationPage.setContainerFullPath(filePath);
    myFileCreationPage.setFileName(
            edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.part.NECSIS14_ClassDiagramDiagramEditorUtil
                    .getUniqueFileName(filePath, fileName, "necsis14_classdiagramdiag")); //$NON-NLS-1$

    diagramRootElementSelectionPage = new DiagramRootElementSelectionPage(
            edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.part.Messages.NECSIS14_ClassDiagramNewDiagramFileWizard_RootSelectionPageName);
    diagramRootElementSelectionPage.setTitle(
            edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.part.Messages.NECSIS14_ClassDiagramNewDiagramFileWizard_RootSelectionPageTitle);
    diagramRootElementSelectionPage.setDescription(
            edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.part.Messages.NECSIS14_ClassDiagramNewDiagramFileWizard_RootSelectionPageDescription);
    diagramRootElementSelectionPage.setModelElement(diagramRoot);

    myEditingDomain = editingDomain;
}