⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 patheditorinput.java

📁 eclise rcp 项目,是非常好的学习源码
💻 JAVA
字号:
/*******************************************************************************
 * Copyright (c) 2007 Siemens AG
 * 
 * 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:
 *    Kai T鰀ter - initial API and implementation
 *******************************************************************************/

package com.siemens.ct.mp3m.ui.views;

import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.IPathEditorInput;
import org.eclipse.ui.IPersistableElement;

public class PathEditorInput implements IPathEditorInput {

    private Path path;

    public PathEditorInput(String fullPath) {
        path = new Path(fullPath);
    }

    public IPath getPath() {
        return path;
    }

    public boolean exists() {
        return false;
    }

    public ImageDescriptor getImageDescriptor() {
        return null;
    }

    public String getName() {
        return ""; //$NON-NLS-1$
    }

    public IPersistableElement getPersistable() {
        return null;
    }

    public String getToolTipText() {
        return ""; //$NON-NLS-1$
    }

    @SuppressWarnings("unchecked")
	public Object getAdapter(Class adapter) {
        return null;
    }

    /* (non-Javadoc)
     * @see java.lang.Object#equals(java.lang.Object)
     */
    @Override
    public boolean equals(Object obj) {
        if(obj == null || !(obj instanceof IPathEditorInput)) {
            return false;
        }
        return path.equals(((IPathEditorInput)obj).getPath());
    }

    /* (non-Javadoc)
     * @see java.lang.Object#hashCode()
     */
    @Override
    public int hashCode() {
        return super.hashCode() | path.hashCode();
    }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -