Package OntoUML.diagram.part

Source Code of OntoUML.diagram.part.OntoUMLMatchingStrategy

package OntoUML.diagram.part;

import org.eclipse.emf.common.ui.URIEditorInput;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorMatchingStrategy;
import org.eclipse.ui.IEditorReference;
import org.eclipse.ui.PartInitException;

/**
* @generated
*/
public class OntoUMLMatchingStrategy implements IEditorMatchingStrategy {

  /**
   * @generated
   */
  public boolean matches(IEditorReference editorRef, IEditorInput input) {
    IEditorInput editorInput;
    try {
      editorInput = editorRef.getEditorInput();
    } catch (PartInitException e) {
      return false;
    }

    if (editorInput.equals(input)) {
      return true;
    }
    if (editorInput instanceof URIEditorInput
        && input instanceof URIEditorInput) {
      return ((URIEditorInput) editorInput).getURI().equals(
          ((URIEditorInput) input).getURI());
    }
    return false;
  }

}
TOP

Related Classes of OntoUML.diagram.part.OntoUMLMatchingStrategy

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.