當前位置: 首頁>>代碼示例>>Java>>正文


Java IConfigurationElement.getAttribute方法代碼示例

本文整理匯總了Java中org.eclipse.core.runtime.IConfigurationElement.getAttribute方法的典型用法代碼示例。如果您正苦於以下問題:Java IConfigurationElement.getAttribute方法的具體用法?Java IConfigurationElement.getAttribute怎麽用?Java IConfigurationElement.getAttribute使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.core.runtime.IConfigurationElement的用法示例。


在下文中一共展示了IConfigurationElement.getAttribute方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createWizardElement

import org.eclipse.core.runtime.IConfigurationElement; //導入方法依賴的package包/類
protected WizardElement createWizardElement(IConfigurationElement config) {
	String name = config.getAttribute(WizardElement.ATT_NAME);
	String id = config.getAttribute(WizardElement.ATT_ID);
	String className = config.getAttribute(WizardElement.ATT_CLASS);
	if (name == null || id == null || className == null)
		return null;
	WizardElement element = new WizardElement(config);
	element.id = id;
	String imageName = config.getAttribute(WizardElement.ATT_ICON);
	if (imageName != null) {
		String pluginID = config.getNamespaceIdentifier();
		Image image = PDEPlugin.getDefault().getLabelProvider().getImageFromPlugin(pluginID, imageName);
		element.setImage(image);
	}
	return element;
}
 
開發者ID:eclipse,項目名稱:gemoc-studio,代碼行數:17,代碼來源:AbstractNewProjectWizardWithTemplates.java

示例2: readExtensions

import org.eclipse.core.runtime.IConfigurationElement; //導入方法依賴的package包/類
private static void readExtensions(Map<Class<? extends IScanPathModel>, Class<? extends IPointGenerator<?>>> gens,
		                           Map<String,   GeneratorInfo> tids) throws CoreException {

	if (Platform.getExtensionRegistry()!=null) {
		final IConfigurationElement[] eles = Platform.getExtensionRegistry().getConfigurationElementsFor("org.eclipse.scanning.api.generator");
		for (IConfigurationElement e : eles) {
			final IPointGenerator<?>    generator = (IPointGenerator<?>)e.createExecutableExtension("class");
			final IScanPathModel     model = (IScanPathModel)e.createExecutableExtension("model");

			final Class<? extends IScanPathModel> modelClass = model.getClass();
			@SuppressWarnings("unchecked")
			final Class<? extends IPointGenerator<?>> generatorClass = (Class<? extends IPointGenerator<?>>) generator.getClass();
			gens.put(modelClass, generatorClass);

			final GeneratorInfo info = new GeneratorInfo();
			info.setModelClass(model.getClass());
			info.setGeneratorClass(generator.getClass());
			info.setLabel(e.getAttribute("label"));
			info.setDescription(e.getAttribute("description"));

			String id = e.getAttribute("id");
			tids.put(id, info);
		}
	}
}
 
開發者ID:eclipse,項目名稱:scanning,代碼行數:26,代碼來源:PointGeneratorService.java

示例3: createConnection

import org.eclipse.core.runtime.IConfigurationElement; //導入方法依賴的package包/類
public static ConnectionService createConnection ( final ConnectionInformation info, final Integer autoReconnectDelay, final boolean lazyActivation )
{
    if ( info == null )
    {
        return null;
    }

    for ( final IConfigurationElement ele : Platform.getExtensionRegistry ().getConfigurationElementsFor ( Activator.EXTP_CONNECTON_CREATOR ) )
    {
        final String interfaceName = ele.getAttribute ( "interface" );
        final String driverName = ele.getAttribute ( "driver" );
        if ( interfaceName == null || driverName == null )
        {
            continue;
        }
        if ( interfaceName.equals ( info.getInterface () ) && driverName.equals ( info.getDriver () ) )
        {
            final ConnectionService service = createConnection ( info, ele, autoReconnectDelay, lazyActivation );
            if ( service != null )
            {
                return service;
            }
        }
    }
    return null;
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:27,代碼來源:ConnectionCreatorHelper.java

示例4: list

import org.eclipse.core.runtime.IConfigurationElement; //導入方法依賴的package包/類
public static List<StyleGeneratorInformation> list ()
{
    final List<StyleGeneratorInformation> result = new LinkedList<StyleGeneratorInformation> ();

    for ( final IConfigurationElement ele : Platform.getExtensionRegistry ().getConfigurationElementsFor ( EXTP_STYLE_GENERATOR ) )
    {
        if ( !ELE_STYLE_GENERATOR.equals ( ele.getName () ) )
        {
            continue;
        }

        final String id = ele.getAttribute ( "id" ); //$NON-NLS-1$
        final String name = ele.getAttribute ( "name" ); //$NON-NLS-1$
        final String description = getText ( ele.getChildren ( "description" ) ); //$NON-NLS-1$

        result.add ( new StyleGeneratorInformation ( id, name, description ) );
    }

    return result;
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:21,代碼來源:StyleGeneratorInformation.java

示例5: convertMonitor

import org.eclipse.core.runtime.IConfigurationElement; //導入方法依賴的package包/類
private static MonitorViewConfiguration convertMonitor ( final IConfigurationElement ele )
{
    try
    {
        final String id = ele.getAttribute ( "id" ); //$NON-NLS-1$
        final String monitorQueryId = ele.getAttribute ( "monitorQueryId" ); //$NON-NLS-1$
        final String connectionString = ele.getAttribute ( "connectionString" ); //$NON-NLS-1$
        final ConnectionType connectionType = ConnectionType.valueOf ( ele.getAttribute ( "connectionType" ) ); //$NON-NLS-1$
        final String label = ele.getAttribute ( "label" ); //$NON-NLS-1$
        final List<ColumnProperties> columns = parseColumnSettings ( ele.getAttribute ( "columns" ) ); //$NON-NLS-1$

        return new MonitorViewConfiguration ( id, monitorQueryId, connectionString, connectionType, label, columns );
    }
    catch ( final Exception e )
    {
        logger.warn ( "Failed to convert monitor configuration: {}", ele ); //$NON-NLS-1$
        return null;
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:20,代碼來源:ConfigurationHelper.java

示例6: createIcons

import org.eclipse.core.runtime.IConfigurationElement; //導入方法依賴的package包/類
private void createIcons() {
	icons   = new HashMap<String, Image>(7);

	final IConfigurationElement[] eles = Platform.getExtensionRegistry().getConfigurationElementsFor("org.eclipse.scanning.api.generator");
	for (IConfigurationElement e : eles) {
		final String     identity = e.getAttribute("id");

		final String icon = e.getAttribute("icon");
		if (icon !=null) {
			final String   cont  = e.getContributor().getName();
			final Bundle   bundle= Platform.getBundle(cont);
			final URL      entry = bundle.getEntry(icon);
			final ImageDescriptor des = ImageDescriptor.createFromURL(entry);
			icons.put(identity, des.createImage());
		}

	}
}
 
開發者ID:eclipse,項目名稱:scanning,代碼行數:19,代碼來源:GeneratorDescriptor.java

示例7: openView

import org.eclipse.core.runtime.IConfigurationElement; //導入方法依賴的package包/類
public static DetailView openView ( final String id, final Map<String, String> properties ) throws CoreException
{
    logger.info ( "Searching view: {}", id ); //$NON-NLS-1$

    for ( final IConfigurationElement ele : Platform.getExtensionRegistry ().getConfigurationElementsFor ( EXTP_DETAIL_VIEW ) )
    {
        final String cfgId = ele.getAttribute ( "id" ); //$NON-NLS-1$

        logger.debug ( "Checking: {}", cfgId ); //$NON-NLS-1$

        if ( cfgId != null && cfgId.equals ( id ) )
        {
            return createDetailView ( id, ele, properties );
        }
    }
    return null;
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:18,代碼來源:DetailViewManager.java

示例8: convertAlarmNotifier

import org.eclipse.core.runtime.IConfigurationElement; //導入方法依賴的package包/類
private static AlarmNotifierConfiguration convertAlarmNotifier ( final IConfigurationElement ele )
{
    try
    {
        final String connectionId = ele.getAttribute ( "connectionId" ); //$NON-NLS-1$
        final String prefix = ele.getAttribute ( "prefix" ) == null ? "ae.server.info" : ele.getAttribute ( "prefix" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ $NON-NLS-2$
        final URL soundFile = Platform.getBundle ( ele.getContributor ().getName () ).getEntry ( ele.getAttribute ( "soundFile" ) ); //$NON-NLS-1$
        final ParameterizedCommand ackAlarmsAvailableCommand = convertCommand ( ele.getChildren ( "ackAlarmsAvailableCommand" )[0] ); //$NON-NLS-1$
        final ParameterizedCommand alarmsAvailableCommand = convertCommand ( ele.getChildren ( "alarmsAvailableCommand" )[0] ); //$NON-NLS-1$
        return new AlarmNotifierConfiguration ( connectionId, prefix, soundFile, ackAlarmsAvailableCommand, alarmsAvailableCommand );
    }
    catch ( final Exception e )
    {
        logger.warn ( "Failed to convert alarm notifier configuration: {}", ele ); //$NON-NLS-1$
        return null;
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:18,代碼來源:ConfigurationHelper.java

示例9: createConnections

import org.eclipse.core.runtime.IConfigurationElement; //導入方法依賴的package包/類
private void createConnections ()
{
    for ( final IConfigurationElement ele : Platform.getExtensionRegistry ().getConfigurationElementsFor ( "org.eclipse.scada.core.ui.connection.provider.connectionInstance" ) )
    {
        if ( !"connectionInstance".equals ( ele.getName () ) )
        {
            continue;
        }
        final String id = ele.getAttribute ( "servicePid" );
        final String uri = ele.getAttribute ( "uri" );
        final String autoReconnect = ele.getAttribute ( "autoReconnect" );
        createConnection ( id, uri, autoReconnect );
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:15,代碼來源:Activator.java

示例10: initialize

import org.eclipse.core.runtime.IConfigurationElement; //導入方法依賴的package包/類
/**
 * Read information from extensions defined in plugin.xml files
 */
private void initialize() {
	if (isInitialized) {
		throw new IllegalStateException("may invoke method initialize() only once");
	}
	isInitialized = true;

	final IExtensionRegistry registry = RegistryFactory.getRegistry();
	if (registry != null) {
		final IExtension[] extensions = registry.getExtensionPoint(SUBGENERATORS_EXTENSIONS_POINT_ID)
				.getExtensions();
		for (IExtension extension : extensions) {
			final IConfigurationElement[] configElems = extension.getConfigurationElements();
			for (IConfigurationElement elem : configElems) {
				try {
					String fileExtensions = elem.getAttribute(ATT_FILE_EXTENSIONS);
					List<String> fileExtensionList = Splitter.on(',').trimResults().omitEmptyStrings()
							.splitToList(fileExtensions);
					ISubGenerator generator = (ISubGenerator) elem
							.createExecutableExtension(ATT_SUB_GENERATOR_CLASS);
					for (String fileExtension : fileExtensionList) {
						register(generator, fileExtension);
					}

				} catch (Exception ex) {
					LOGGER.error(
							"Error while reading extensions for extension point "
									+ SUBGENERATORS_EXTENSIONS_POINT_ID,
							ex);
				}
			}
		}
	}
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:37,代碼來源:SubGeneratorRegistry.java

示例11: getLanguageURI

import org.eclipse.core.runtime.IConfigurationElement; //導入方法依賴的package包/類
/**
 * @param languageId
 * @return the URI of the given language or null if no such language exists in the registry
 */
public static String getLanguageURI(String languageId){
	IConfigurationElement[] melangeLanguages = Platform
			.getExtensionRegistry().getConfigurationElementsFor(
					"fr.inria.diverse.melange.language");
	for (IConfigurationElement lang : melangeLanguages) {
		if(lang.getAttribute("id").equals(languageId)){
			return lang.getAttribute("uri");
		}
	}
	return null;
}
 
開發者ID:eclipse,項目名稱:gemoc-studio-modeldebugging,代碼行數:16,代碼來源:MelangeHelper.java

示例12: getLanguageNameForURI

import org.eclipse.core.runtime.IConfigurationElement; //導入方法依賴的package包/類
/**
 * Note: in some situations, the same uri can be declared for several languages ! (for example using external keyword)
 * this is usually a deployment issue
 * @param uri
 * @return the first language with the given URI or null if no such language exists in the registry
 */
public static String getLanguageNameForURI(String uri){
	IConfigurationElement[] melangeLanguages = Platform
			.getExtensionRegistry().getConfigurationElementsFor(
					"fr.inria.diverse.melange.language");
	for (IConfigurationElement lang : melangeLanguages) {
		if(lang.getAttribute("uri").equals(uri)){
			return lang.getAttribute("id");
		}
	}
	return null;
}
 
開發者ID:eclipse,項目名稱:gemoc-studio-modeldebugging,代碼行數:18,代碼來源:MelangeHelper.java

示例13: getLanguageNamesForURI

import org.eclipse.core.runtime.IConfigurationElement; //導入方法依賴的package包/類
public static List<String> getLanguageNamesForURI(String uri){
	List<String> languagesNames = new ArrayList<String>();
	IConfigurationElement[] melangeLanguages = Platform
			.getExtensionRegistry().getConfigurationElementsFor(
					"fr.inria.diverse.melange.language");
	for (IConfigurationElement lang : melangeLanguages) {
		if(lang.getAttribute("uri").equals(uri)){
			String id = lang.getAttribute("id");
			if(!languagesNames.contains(id)){
				languagesNames.add(id);
			}
		}
	}
	return languagesNames;
}
 
開發者ID:eclipse,項目名稱:gemoc-studio-modeldebugging,代碼行數:16,代碼來源:MelangeHelper.java

示例14: getModelType

import org.eclipse.core.runtime.IConfigurationElement; //導入方法依賴的package包/類
/**
 * Return the  ModelType for 'language' or null if not found
 */
public static String getModelType(String language){
	IConfigurationElement[] melangeLanguages = Platform
			.getExtensionRegistry().getConfigurationElementsFor(
					"fr.inria.diverse.melange.language");
	for (IConfigurationElement lang : melangeLanguages) {
		if (lang.getAttribute("id").equals(language)) {
			return lang.getAttribute("modeltypeId");
		}
	}
	return null;
}
 
開發者ID:eclipse,項目名稱:gemoc-studio-modeldebugging,代碼行數:15,代碼來源:MelangeHelper.java

示例15: initializeDefaultPreferences

import org.eclipse.core.runtime.IConfigurationElement; //導入方法依賴的package包/類
@Override
public void initializeDefaultPreferences ()
{
    String defaultTimeZone = TimeZone.getDefault ().getID ();
    for ( final IConfigurationElement ele : Platform.getExtensionRegistry ().getConfigurationElementsFor ( EXTP_CFG_ID ) )
    {
        if ( !Activator.TIME_ZONE_KEY.equals ( ele.getName () ) )
        {
            continue;
        }
        defaultTimeZone = ele.getAttribute ( "id" ); //$NON-NLS-1$
    }
    final Preferences node = DefaultScope.INSTANCE.getNode ( Activator.PLUGIN_ID );
    node.put ( Activator.TIME_ZONE_KEY, defaultTimeZone );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:16,代碼來源:TimeZoneInitializer.java


注:本文中的org.eclipse.core.runtime.IConfigurationElement.getAttribute方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。