use of org.eclipse.core.runtime.IConfigurationElement in project che by eclipse.
the class ExtensionsRegistry method getDocumentSetupParticipants.
/**
* Returns the set of setup participants for the given file name or extension.
*
* @param nameOrExtension the name or extension to be used for lookup
* @return the sharable set of document setup participants
*/
protected List getDocumentSetupParticipants(String nameOrExtension) {
Set set = (Set) fSetupParticipantDescriptors.get(nameOrExtension);
if (set == null)
return null;
List participants = new ArrayList();
Iterator e = set.iterator();
while (e.hasNext()) {
IConfigurationElement entry = (IConfigurationElement) e.next();
Object participant = getExtension(entry, fSetupParticipants, IDocumentSetupParticipant.class);
if (participant != null)
participants.add(participant);
}
return participants;
}
use of org.eclipse.core.runtime.IConfigurationElement in project translationstudio8 by heartsome.
the class ProjectSettingHandler method runWizardPageExtension.
/**
* 加载扩展向导页 ;
*/
private void runWizardPageExtension() {
IConfigurationElement[] config = Platform.getExtensionRegistry().getConfigurationElementsFor("net.heartsome.cat.ts.ui.extensionpoint.projectsetting");
try {
// 修改术语库重复
extensionPages.clear();
for (IConfigurationElement e : config) {
final Object o = e.createExecutableExtension("class");
if (o instanceof AbstractProjectSettingPage) {
ISafeRunnable runnable = new ISafeRunnable() {
public void handleException(Throwable exception) {
logger.error(Messages.getString("handlers.ProjectSettingHandler.logger1"), exception);
}
public void run() throws Exception {
extensionPages.add((AbstractProjectSettingPage) o);
}
};
SafeRunner.run(runnable);
}
}
} catch (CoreException ex) {
logger.error(Messages.getString("handlers.ProjectSettingHandler.logger1"), ex);
}
}
use of org.eclipse.core.runtime.IConfigurationElement in project translationstudio8 by heartsome.
the class SelfHelpDisplay method createHelpDisplay.
private static void createHelpDisplay() {
IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(HELP_DISPLAY_EXTENSION_ID);
if (point != null) {
IExtension[] extensions = point.getExtensions();
if (extensions.length != 0) {
// We need to pick up the non-default configuration
IConfigurationElement[] elements = extensions[0].getConfigurationElements();
if (elements.length == 0)
return;
IConfigurationElement displayElement = elements[0];
// Instantiate the help display
try {
helpDisplay = (AbstractHelpDisplay) (displayElement.createExecutableExtension(HELP_DISPLAY_CLASS_ATTRIBUTE));
} catch (CoreException e) {
HelpBasePlugin.logStatus(e.getStatus());
}
}
}
}
use of org.eclipse.core.runtime.IConfigurationElement in project translationstudio8 by heartsome.
the class AutomaticQATrigger method runExtension.
/**
* 加载自动品质检查的扩展
*/
private void runExtension() {
IConfigurationElement[] config = Platform.getExtensionRegistry().getConfigurationElementsFor(CONSTANT_automaticQA_EXTENSION_ID);
try {
for (IConfigurationElement e : config) {
final Object o = e.createExecutableExtension("class");
if (o instanceof IAutomaticQA) {
ISafeRunnable runnable = new ISafeRunnable() {
public void handleException(Throwable exception) {
exception.printStackTrace();
}
public void run() throws Exception {
autoQA = (IAutomaticQA) o;
}
};
SafeRunner.run(runnable);
}
}
} catch (CoreException e) {
LOGGER.error("", e);
e.printStackTrace();
}
}
use of org.eclipse.core.runtime.IConfigurationElement in project translationstudio8 by heartsome.
the class RealTimeSpellCheckTrigger method runExtension.
/**
* 加哉实时拼写检查 ;
*/
private void runExtension() {
IConfigurationElement[] config = Platform.getExtensionRegistry().getConfigurationElementsFor(CONSTANT_realTimeSpell_extentionId);
try {
for (IConfigurationElement e : config) {
final Object o = e.createExecutableExtension("class");
if (o instanceof IRealTimeSpellCheck) {
ISafeRunnable runnable = new ISafeRunnable() {
public void handleException(Throwable exception) {
exception.printStackTrace();
}
public void run() throws Exception {
realTimeSpell = (IRealTimeSpellCheck) o;
}
};
SafeRunner.run(runnable);
}
}
} catch (CoreException e) {
LOGGER.error("", e);
e.printStackTrace();
}
}
Aggregations