All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.eclipse.ui.part.ShowInContext Maven / Gradle / Ivy

Go to download

This plug-in contains the bulk of the Workbench implementation, and depends on JFace, SWT, and Core Runtime. It cannot be used independently from org.eclipse.ui. Workbench client plug-ins should not depend directly on this plug-in.

The newest version!
/*******************************************************************************
 * Copyright (c) 2000, 2006 IBM Corporation and others.
 * 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:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

package org.eclipse.ui.part;

import org.eclipse.jface.viewers.ISelection;

/**
 * Carries the context for the Show In action.
 * The default implementation carries an input and a selection.
 * Subclasses may extend.
 *
 * @see IShowInSource
 * @see IShowInTarget
 * 
 * @since 2.1
 */
public class ShowInContext {

    private Object input;

    private ISelection selection;

    /**
     * Constructs a new ShowInContext with the given input and 
     * selection.
     * 
     * @param input the input or null 
     * @param selection the selection or null
     */
    public ShowInContext(Object input, ISelection selection) {
        setInput(input);
        setSelection(selection);
    }

    /**
     * Returns the input, or null to indicate no input
     * 
     * @return the input or null.
     */
    public Object getInput() {
        return input;
    }

    /**
     * Returns the selection, or null to indicate no selection.
     * 
     * @return the selection or null
     */
    public ISelection getSelection() {
        return selection;
    }

    /**
     * Sets the input, or null to indicate no input.
     * 
     * @param input the input or null 
     */
    public void setInput(Object input) {
        this.input = input;
    }

    /**
     * Sets the selection, or null to indicate no selection.
     * 
     * @param selection the selection or null
     */
    public void setSelection(ISelection selection) {
        this.selection = selection;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy