Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-dev] editor in RCP app not working

Hi,

if this isn't the right list for the question, please feel free to direct me
to the proper mailing list.

I created a very basic RCP application with 3 views and wanted to create an
editor for it now. So I added a new extension to the plugin.xml havin class
and id point to the class for the edior and gave a name. contributors is
filled with org.eclipse.ui.part.EditorActionBarContributor, as I don't need
that now.

Then i created the class as subclass of FormEditor (I want to display such
forms) and created a FormPage subclass to display a label and a text field.
But it seems that the code for my Editor is never run, so question is: What
have I forgotten to do.

I'm new to Eclipse and RCP programming and a little bit lost on where to
look for any errors (I do see some errors from classes in
org.eclipse.update.ui but they don't seem to be related to my problem)

Thanks,

Andreas

PS: parts of my soruces:

plugin.xml:
--------------------------------------
<extension
         point="org.eclipse.ui.editors">
      <editor           
            class="de.test1.workflowaddon.FormularEditor"
            default="true"
            name="Formulareditor"                           
            
contributorClass="org.eclipse.ui.part.EditorActionBarContributor"
            id="de.test1.workflowaddon.FormularEditor"
            />
   </extension>
--------------------------------------
FormularEditor.java:
---------------------------------------------------
package de.test1.workflowaddon;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.forms.IManagedForm;
import org.eclipse.ui.forms.editor.FormEditor;
import org.eclipse.ui.forms.editor.FormPage;
import org.eclipse.ui.forms.widgets.ScrolledForm;

public class FormularEditor extends FormEditor {

	class FormularFormPage extends FormPage {
		
		FormularFormPage(FormEditor fe, String id, String title)
		{
			super (fe,id,title);
		}
		
		protected void createFormContent(IManagedForm mf)
		{
			super.createFormContent(mf);
			ScrolledForm f = mf.getForm();
			f.setText("Formular:");
			f.getBody().setLayout(new GridLayout());
			mf.getToolkit().createLabel(f.getBody(), "Feld1:");
			mf.getToolkit().createText(f.getBody(), "Wert1");
			mf.getToolkit().createHyperlink(f.getBody(), "Dies ist der Text", 0);
			mf.refresh();
		}
	}
	protected void addPages() {
		
		FormularFormPage fp = new FormularFormPage(this, "MainFormpage",
"Formular");
		try {
			addPage(fp);
		}catch ( PartInitException pie ) {			
		}
	}

	public void doSave(IProgressMonitor monitor) {

	}

	public void doSaveAs() {

	}

	public boolean isSaveAsAllowed() {
		return false;
	}
}


Back to the top