Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IFileState


  private static IStorage wrapStorage(final IStorage storage,
      final String charset) {
    if (charset == null)
      return storage;
    if (storage instanceof IFileState) {
      return new IFileState() {
        public Object getAdapter(Class adapter) {
          return storage.getAdapter(adapter);
        }

        public boolean isReadOnly() {
View Full Code Here


    IFileRevision rev = (IFileRevision) getAdapter(IFileRevision.class);
    if (rev != null)
      return NLS.bind(
          UIText.FileRevisionEditorInput_NameAndRevisionTitle,
          new String[] { rev.getName(), rev.getContentIdentifier() });
    IFileState state = (IFileState) getAdapter(IFileState.class);
    if (state != null)
      return state.getName()
          + " " + DateFormat.getInstance().format(new Date(state.getModificationTime())); //$NON-NLS-1$
    return storage.getName();

  }
View Full Code Here

    if (states == null || states.length <= 0) {
      return;
    }
    fHasHistory = true;

    IFileState found = null;
    // find edition just before the given time stamp
    for (IFileState state : states) {
      long d = state.getModificationTime();
      if (d < timestamp) {
        found = state;
        break;
      }
    }

    if (found == null) {
      found = states[states.length - 1];
    }

    InputStream oldContents = null;
    InputStream newContents = null;
    try {
      oldContents = found.getContents();
      newContents = file.getContents();
    } catch (CoreException ex) {
      return;
    }
View Full Code Here

TOP

Related Classes of org.eclipse.core.resources.IFileState

Copyright © 2018 www.massapicom. 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.