|
From: <caw...@us...> - 2007-09-07 16:28:58
|
Revision: 3109
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3109&view=rev
Author: cawilliams
Date: 2007-09-07 09:28:56 -0700 (Fri, 07 Sep 2007)
Log Message:
-----------
include non ruby resources inside external source folders. Wrap them in LocalFileStorage class. Use that class in UI, instead of SystemFileStorage (since it's the same implemntation).
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/ExternalRubyFileEditorInput.java
Removed Paths:
-------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/SystemFileStorage.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/ExternalRubyFileEditorInput.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/ExternalRubyFileEditorInput.java 2007-09-07 15:36:30 UTC (rev 3108)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/ExternalRubyFileEditorInput.java 2007-09-07 16:28:56 UTC (rev 3109)
@@ -11,16 +11,17 @@
import org.eclipse.ui.IPersistableElement;
import org.eclipse.ui.IStorageEditorInput;
import org.eclipse.ui.editors.text.ILocationProvider;
+import org.rubypeople.rdt.core.LocalFileStorage;
/**
* @since 3.0
*/
public class ExternalRubyFileEditorInput implements IStorageEditorInput, ILocationProvider, IPersistableElement {
- private SystemFileStorage storage;
+ private LocalFileStorage storage;
public ExternalRubyFileEditorInput(File file) {
- storage = new SystemFileStorage(file);
+ storage = new LocalFileStorage(file);
}
public boolean exists() {
Deleted: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/SystemFileStorage.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/SystemFileStorage.java 2007-09-07 15:36:30 UTC (rev 3108)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/SystemFileStorage.java 2007-09-07 16:28:56 UTC (rev 3109)
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.rubypeople.rdt.internal.ui.rubyeditor;
-
-import java.io.*;
-import org.eclipse.core.runtime.*;
-import org.eclipse.core.resources.*;
-import org.rubypeople.rdt.internal.ui.RubyPlugin;
-
-
-public class SystemFileStorage extends PlatformObject implements IStorage {
- private File file;
- /**
- * Constructor for SystemFileStorage.
- */
- public SystemFileStorage(File file) {
- this.file = file;
- }
-
- public File getFile() {
- return file;
- }
- public InputStream getContents() throws CoreException {
- try {
- return new FileInputStream(file);
- } catch (FileNotFoundException e) {
- IStatus status =
- new Status(IStatus.ERROR, RubyPlugin.PLUGIN_ID, IStatus.OK, null, e);
- throw new CoreException(status);
- }
- }
- public IPath getFullPath() {
- return new Path(file.getAbsolutePath());
- }
- public String getName() {
- return file.getName();
- }
- public boolean isReadOnly() {
- return true;
- }
-
- public boolean equals(Object object) {
- return object instanceof SystemFileStorage
- && getFile().equals(((SystemFileStorage) object).getFile());
- }
-
- public int hashCode() {
- return getFile().hashCode();
- }
-}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|