X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.editors.win32%2Fsrc%2Forg%2Fsimantics%2Feditors%2Fwin32%2FOLEEditorInput.java;h=d6896ee1be4feee8ea63491ceac40d5b1235bfb7;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hp=bef0f10313a7744bd7492b05372c893a133077af;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.editors.win32/src/org/simantics/editors/win32/OLEEditorInput.java b/bundles/org.simantics.editors.win32/src/org/simantics/editors/win32/OLEEditorInput.java index bef0f1031..d6896ee1b 100644 --- a/bundles/org.simantics.editors.win32/src/org/simantics/editors/win32/OLEEditorInput.java +++ b/bundles/org.simantics.editors.win32/src/org/simantics/editors/win32/OLEEditorInput.java @@ -1,117 +1,117 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * 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: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.editors.win32; - -import java.io.File; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IPersistableElement; -import org.simantics.editors.win32.ole.EditorDefinition; - -/** - * EditorInput for the OLEEditor component. - * Input can be configured in two ways: - * - * 1) giving an input file and the system tries to find proper ActiveX component for it. - * 2) giving both input file, and ActiveX component's progID. - * - * @author Marko Luukkainen - * - */ -public class OLEEditorInput implements IEditorInput { - - private String name; - private EditorDefinition factory; - private File file; - private boolean fullscreen; - - public OLEEditorInput(EditorDefinition factory, File file) { - this(factory,file,false); - } - - public OLEEditorInput(EditorDefinition factory, File file, boolean fullscreen) { - this(factory,file,file.getName(),fullscreen); - } - - public OLEEditorInput(EditorDefinition factory, File file, String name, boolean fullscreen) { - if (file == null || factory == null || name == null) - throw new NullPointerException(); - this.file = file; - this.factory = factory; - this.fullscreen = fullscreen; - this.name = name; - } - - - @Override - public boolean exists() { - return false; - } - - @Override - public ImageDescriptor getImageDescriptor() { - return null; - } - - @Override - public String getName() { - return name; - } - - @Override - public IPersistableElement getPersistable() { - return null; - } - - @Override - public String getToolTipText() { - return getName(); - } - - @SuppressWarnings({ "rawtypes" }) - @Override - public Object getAdapter(Class adapter) { - return null; - } - - public File getFile() { - return file; - } - - public EditorDefinition getFactory() { - return factory; - } - - public boolean isFullscreen() { - return fullscreen; - } - - @Override - public boolean equals(Object arg0) { - if (arg0 == null) - return false; - if (arg0.getClass() != getClass()) - return false; - OLEEditorInput other = (OLEEditorInput)arg0; - return other.file.equals(file); - - } - - @Override - public int hashCode() { - return file.hashCode(); - } - - - -} +/******************************************************************************* + * Copyright (c) 2007, 2010 Association for Decentralized Information Management + * in Industry THTH ry. + * 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: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.editors.win32; + +import java.io.File; + +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.IPersistableElement; +import org.simantics.editors.win32.ole.EditorDefinition; + +/** + * EditorInput for the OLEEditor component. + * Input can be configured in two ways: + * + * 1) giving an input file and the system tries to find proper ActiveX component for it. + * 2) giving both input file, and ActiveX component's progID. + * + * @author Marko Luukkainen + * + */ +public class OLEEditorInput implements IEditorInput { + + private String name; + private EditorDefinition factory; + private File file; + private boolean fullscreen; + + public OLEEditorInput(EditorDefinition factory, File file) { + this(factory,file,false); + } + + public OLEEditorInput(EditorDefinition factory, File file, boolean fullscreen) { + this(factory,file,file.getName(),fullscreen); + } + + public OLEEditorInput(EditorDefinition factory, File file, String name, boolean fullscreen) { + if (file == null || factory == null || name == null) + throw new NullPointerException(); + this.file = file; + this.factory = factory; + this.fullscreen = fullscreen; + this.name = name; + } + + + @Override + public boolean exists() { + return false; + } + + @Override + public ImageDescriptor getImageDescriptor() { + return null; + } + + @Override + public String getName() { + return name; + } + + @Override + public IPersistableElement getPersistable() { + return null; + } + + @Override + public String getToolTipText() { + return getName(); + } + + @SuppressWarnings({ "rawtypes" }) + @Override + public Object getAdapter(Class adapter) { + return null; + } + + public File getFile() { + return file; + } + + public EditorDefinition getFactory() { + return factory; + } + + public boolean isFullscreen() { + return fullscreen; + } + + @Override + public boolean equals(Object arg0) { + if (arg0 == null) + return false; + if (arg0.getClass() != getClass()) + return false; + OLEEditorInput other = (OLEEditorInput)arg0; + return other.file.equals(file); + + } + + @Override + public int hashCode() { + return file.hashCode(); + } + + + +}