An Editor problem - double clicking a resource file won't ope it! [message #175858] |
Mon, 05 January 2004 14:36 |
Eclipse User |
|
|
|
Hi,
I have an editor which can display the architecture of a system as shown
below.
http://swag.uwaterloo.ca/~jsychi/screenshots/latest.jpg
The UI part of it is working fine.
My problem is that I don't get anything opened when I double click the
resource file. The editor tab is there but inside the tab, it is blank.
I must leave the tab opened and restart Eclipse, then it works fine.
Ellipse open this editor for me when it starts. createPartControl method
is only called when Eclipse starts.
In other words, I can't double click the resource file to open this
editor because double-clicking does not invoke the createPartControl
method. What do I need to do to fix this problem?
I paste the class source below. Can anyone give me some suggestions?
Thanks
Jack
/*
* Created on 2003/9/12
*
* To change the template for this generated file go to
* Window - Preferences - Java - Code Generation - Code and Comments
*/
package lseditplugin.editors;
import lsedit2.LandscapeEditorFrame;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Decorations;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.part.EditorPart;
import org.eclipse.ui.part.FileEditorInput;
import test.HelloWorldFrameAndTable;
import vwt.VWT;
/**
* @author jsychi
*
* To change the template for this generated type comment go to
* Window - Preferences - Java - Code Generation - Code and Comments
*/
public class LSEditor extends EditorPart {
//IEditorSite site;
/* (non-Javadoc)
* @see
org.eclipse.ui.ISaveablePart#doSave(org.eclipse.core.runtime .IProgressMonitor)
*/
public void doSave(IProgressMonitor monitor) {
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.ui.ISaveablePart#doSaveAs()
*/
public void doSaveAs() {
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see
org.eclipse.ui.IEditorPart#gotoMarker(org.eclipse.core.resou rces.IMarker)
*/
public void gotoMarker(IMarker marker) {
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.ui.IEditorPart#init(org.eclipse.ui.IEditorSite,
org.eclipse.ui.IEditorInput)
*/
public void init(IEditorSite site, IEditorInput input)
throws PartInitException {
// TODO Auto-generated method stub
//this.site = site;.
setSite(site);
setInput(input);
}
/* (non-Javadoc)
* @see org.eclipse.ui.ISaveablePart#isDirty()
*/
public boolean isDirty() {
// TODO Auto-generated method stub
return false;
}
/* (non-Javadoc)
* @see org.eclipse.ui.ISaveablePart#isSaveAsAllowed()
*/
public boolean isSaveAsAllowed() {
// TODO Auto-generated method stub
return false;
}
/* (non-Javadoc)
* @see
org.eclipse.ui.IWorkbenchPart#createPartControl(org.eclipse. swt.widgets.Composite)
*/
public void createPartControl(Composite parent) {
// TODO Auto-generated method stub
//parent.setLayout(new RowLayout());
parent.setLayout(null);
try {
VWT.editPart = parent;
} catch (Exception e) {
e.printStackTrace();
}
String args[] =
{
ResourcesPlugin
.getWorkspace()
.getRoot()
.getLocation()
.toString()
+ ((FileEditorInput) getEditorInput())
.getFile()
.getFullPath()
.toString()};
if (false) {
HelloWorldFrameAndTable.main(args);
return;
}
if (true) {
for (int i = 0; i <1; i++) {
LandscapeEditorFrame.main(args);
}
return;
}
}
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchPart#setFocus()
*/
public void setFocus() {
// TODO Auto-generated method stub
}
}
|
|
|
Powered by
FUDForum. Page generated in 0.03218 seconds