Mercurial > hg > RemoteEditor > Eclipse
changeset 94:78f6f6ce9d3c
*** empty log message ***
author | pin |
---|---|
date | Sat, 22 Dec 2007 02:04:27 +0900 |
parents | cda18e429dfa |
children | 771c2e03edb6 |
files | .classpath plugin.xml src/remoteeditor/action/RemoteEditorAction.java |
diffstat | 3 files changed, 74 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/.classpath Fri Dec 21 19:33:02 2007 +0900 +++ b/.classpath Sat Dec 22 02:04:27 2007 +0900 @@ -3,5 +3,6 @@ <classpathentry kind="src" path="src"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="lib" path="/Applications/eclipse3.2.1/plugins/org.eclipse.core.resources_3.2.1.R32x_v20060914.jar"/> <classpathentry kind="output" path="bin"/> </classpath>
--- a/plugin.xml Fri Dec 21 19:33:02 2007 +0900 +++ b/plugin.xml Sat Dec 22 02:04:27 2007 +0900 @@ -28,5 +28,31 @@ </action> </actionSet> </extension> + <extension + point="org.eclipse.ui.actionSets"> + <actionSet + id="EclipseRemoteEditor.actionSet1" + label="EclipseRemoteEditor.actionSet1" + visible="true"> + <menu + id="EclipseRemoteEditor.menu1" + label="RemoteEditor" + > + <separator name="EclipseRemoteEditor.separator1"/> + <separator name="EclipseRemoteEditor.separator2"/> + </menu> + <action + class="remoteeditor.action.RemoteEditorAction" + id="EclipseRemoteEditor.action1" + label="SMCMD_PUT" + menubarPath="EclipseRemoteEditor.menu1/EclipseRemoteEditor.separator1" + /> + <action + id="EclipseRemoteEditor.action2" + label="SMCMD_JOIN" + menubarPath="EclipseRemoteEditor.menu1/EclipseRemoteEditor.separator2" + style="push"/> + </actionSet> + </extension> </plugin>
--- a/src/remoteeditor/action/RemoteEditorAction.java Fri Dec 21 19:33:02 2007 +0900 +++ b/src/remoteeditor/action/RemoteEditorAction.java Sat Dec 22 02:04:27 2007 +0900 @@ -1,10 +1,24 @@ package remoteeditor.action; +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.InputStream; + +import org.eclipse.core.resources.IContainer; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IWorkspace; +import org.eclipse.core.resources.IWorkspaceRoot; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Path; import org.eclipse.jface.action.IAction; import org.eclipse.jface.viewers.ISelection; import org.eclipse.swt.widgets.Display; import org.eclipse.ui.IEditorInput; import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IViewPart; import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.IWorkbenchWindow; @@ -13,6 +27,7 @@ import org.eclipse.ui.PlatformUI; import org.eclipse.ui.internal.Workbench; import org.eclipse.ui.internal.WorkbenchPage; +import org.eclipse.ui.views.IViewDescriptor; import remoteeditor.ui.REPSelectWindow; import remoteeditor.ui.RepInputDialog; @@ -38,20 +53,51 @@ IWorkbenchPage workbenchPage = workbenchWindow.getActivePage(); IEditorPart editorPart = workbenchPage.getActiveEditor(); - System.out.println(editorPart.getEditorInput().toString()); + //System.out.println(editorPart.getEditorInput().toString()); IEditorInput editorinput = editorPart.getEditorInput(); workbenchPage.closeEditor(editorPart, true); + /*** ŠëŒ¯ ***/ + IWorkspace workspace = ResourcesPlugin.getWorkspace(); + IWorkspaceRoot root = workspace.getRoot(); + IProject project = root.getProject("Pin"); + //IProject[] project = root.getProjects(); + IContainer container = project; + System.out.println(project.getFullPath().toOSString()); + IFile file = container.getFile(new Path("hoge.txt")); + String string = "hugo"; + InputStream is = new ByteArrayInputStream(string.getBytes()); + try { + file.create(is, false, null); + } catch (CoreException e1) { + e1.printStackTrace(); + } +// if(!project.exists()) { +// try { +// System.out.println("afro"); +// project.create(null); +// } catch (CoreException e) { +// e.printStackTrace(); +// } +// } + + //org.eclipse.ui.part.FileEditorInput(); + + //File file = new File("/Users/j02054/Desktop/SessionManager/sessionmanager.sh"); + //System.out.println(editorinput.getName()); //ComboSample1 combo = new ComboSample1(display); //combo.addText(); //combo.open(); + //IWorkbenchPage page = workbenchWindow.getActivePage(); + //editorPart = IDE.openEditor(workbenchPage,null); try { editorPart = workbenchPage.openEditor(editorinput, "remoteeditor.editors.RemoteEditor"); + //editorPart = workbenchPage.openEditor(null, "remoteeditor.editors.RemoteEditor"); System.out.println("test"); } catch (PartInitException e) { e.printStackTrace();