[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
|
- From: Vinu Varghese <vinusemail@xxxxxxxxx>
- Date: Thu, 16 Mar 2006 01:37:03 +0530
- Newsgroups: eclipse.platform
- Organization: EclipseCorner
- User-agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
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