
org.eclipse.compare.IEditableContentExtension Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of org.eclipse.compare Show documentation
Show all versions of org.eclipse.compare Show documentation
This is org.eclipse.compare jar used by Scout SDK
The newest version!
/*******************************************************************************
* Copyright (c) 2006, 2011 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.compare;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.texteditor.IDocumentProviderExtension;
/**
* Extends the {@link IEditableContent} interface to support validate edit.
* Clients should only use this interface if they obtained the content
* from an {@link IStreamContentAccessor}. If content was obtained through an
* {@link ISharedDocumentAdapter} then validation should be performed through
* the {@link IDocumentProviderExtension} interface.
* @see IWorkspace#validateEdit(org.eclipse.core.resources.IFile[], Object)
* @since 3.3
*/
public interface IEditableContentExtension {
/**
* Return whether the typed element being displayed
* is read-only. a read-only element will require a
* call to validateEdit before the element can be modified on disk.
* @return whether the typed element is read-only
*/
boolean isReadOnly();
/**
* If the element is read-only, this method should be called
* to attempt to make it writable.
* @param shell a shell used to prompt the user if required.
* @return a status object that is OK
if things are fine,
* otherwise a status describing reasons why modifying the given files is not
* reasonable. A status with a severity of CANCEL
is returned
* if the validation was canceled, indicating the edit should not proceed.
*/
IStatus validateEdit(Shell shell);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy