[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.platform] Re: creating an Editor without showing it on view - Got it

Hi Paul

Thank you very much , I got it., I am posting my code here

- Regards
Vinu

>>>>>> CODE >>>>>>>>>

	private TextEditor getDefaultHtmlEditor()
	{
		try
		{
			IEditorDescriptor desc = IDE.getEditorDescriptor("test.html");
			
			IConfigurationElement elements[] = Platform.getExtensionRegistry()
					.getExtensionPoint("org.eclipse.ui.editors")
					.getConfigurationElements();

			IConfigurationElement element = null;

for (int i = 0; i < elements.length; i++)
{
if (elements[i].getAttribute("id").equals(desc.getId()))
{
element = elements[i];
break;
}
}

if(element == null)
return null;

TextEditor editor = (TextEditor) element.createExecutableExtension("class");

return editor;


		}
		catch (PartInitException e)
		{

		}
		catch (CoreException e)
		{
			
		}
		return null;
	}

>>>>>> CODE >>>>>>>>>


Paul Webster wrote:
Check out EditorDescriptor#createEditor() ... it's internal, but you can follow the code to find out how eclipse turns a configuration element (mentioned in your other thread) into an Object.

Later,
PW

-- ........................................

Vinu Varghese
www.x-minds.org