当前位置: 首页>>代码示例>>Java>>正文


Java ExecutionEvent.getParameter方法代码示例

本文整理汇总了Java中org.eclipse.core.commands.ExecutionEvent.getParameter方法的典型用法代码示例。如果您正苦于以下问题:Java ExecutionEvent.getParameter方法的具体用法?Java ExecutionEvent.getParameter怎么用?Java ExecutionEvent.getParameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.core.commands.ExecutionEvent的用法示例。


在下文中一共展示了ExecutionEvent.getParameter方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: execute

import org.eclipse.core.commands.ExecutionEvent; //导入方法依赖的package包/类
@Override
public final Object execute ( final ExecutionEvent event ) throws ExecutionException
{
    final IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked ( event );

    final Object value = event.getParameter ( PARAMETER_NAME_VIEW_ID );

    try
    {
        final String[] viewIds = ( (String)value ).split ( ":" );
        if ( viewIds.length == 1 )
        {
            openView ( viewIds[0], null, window );
        }
        else if ( viewIds.length == 2 )
        {
            openView ( viewIds[0], viewIds[1], window );
        }
    }
    catch ( final PartInitException e )
    {
        throw new ExecutionException ( "Part could not be initialized", e ); //$NON-NLS-1$
    }

    return null;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:27,代码来源:ShowViewHandler.java

示例2: execute

import org.eclipse.core.commands.ExecutionEvent; //导入方法依赖的package包/类
public Object execute ( final ExecutionEvent event ) throws ExecutionException
{
    final String data = event.getParameter ( "org.eclipse.scada.ae.ui.testing.loadMore.count" );
    final int count;

    if ( data == null )
    {
        count = 1000;
    }
    else
    {
        count = Integer.parseInt ( data );
    }

    for ( final QueryBean query : getQueryList () )
    {
        query.getQuery ().loadMore ( count );
    }
    return null;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:21,代码来源:LoadMoreHandler.java

示例3: execute

import org.eclipse.core.commands.ExecutionEvent; //导入方法依赖的package包/类
@Override
public Object execute ( final ExecutionEvent event ) throws ExecutionException
{
    final String connectionId = event.getParameter ( "org.eclipse.scada.da.client.dataitem.details.connectionId" ); //$NON-NLS-1$
    final String connectionUri = event.getParameter ( "org.eclipse.scada.da.client.dataitem.details.connectionUri" ); //$NON-NLS-1$
    final String itemId = event.getParameter ( "org.eclipse.scada.da.client.dataitem.details.itemId" ); //$NON-NLS-1$

    if ( connectionId == null && connectionUri == null || itemId == null )
    {
        return null;
    }

    if ( connectionId != null )
    {
        open ( connectionId, itemId, Type.ID );
    }
    else
    {
        open ( connectionUri, itemId, Type.URI );
    }
    return null;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:23,代码来源:DefaultDialogHandler.java

示例4: execute

import org.eclipse.core.commands.ExecutionEvent; //导入方法依赖的package包/类
@SuppressWarnings ( "unchecked" )
@Override
public Object execute ( final ExecutionEvent event ) throws ExecutionException
{
    final String detailViewId = event.getParameter ( "org.eclipse.scada.vi.details.showDetailDialog.id" );
    final Map<String, String> parameters = (Map<String, String>)event.getObjectParameterForExecution ( "org.eclipse.scada.vi.details.showDetailDialog.parameters" );

    try
    {
        if ( this.useWaitShell )
        {
            openWithWaitShell ( getShell (), detailViewId, parameters );
        }
        else
        {
            open ( getShell (), detailViewId, parameters );
        }
    }
    catch ( final Exception e )
    {
        StatusManager.getManager ().handle ( StatusHelper.convertStatus ( Activator.PLUGIN_ID, "Failed to open detail view", e ), StatusManager.SHOW );
    }

    return null;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:26,代码来源:ShowDetailDialog.java

示例5: getContext

import org.eclipse.core.commands.ExecutionEvent; //导入方法依赖的package包/类
protected AvroContext getContext(ExecutionEvent event, AvroSchemaEditor schemaEditor) {
	Kind kind = null;
	String contextName = event.getParameter(AvroContext.ID);		
	if (contextName == null) {
		// use the active context
		kind = schemaEditor.getActiveContext().getKind();
	} else {
		kind = AvroContext.Kind.valueOf(contextName.toUpperCase());
	}
	AvroContext context = schemaEditor.getContext();
	if (kind == Kind.MASTER) {
		return context.getMaster();
	} else {
		return context.getSlave();
	}
}
 
开发者ID:Talend,项目名称:avro-schema-editor,代码行数:17,代码来源:ContextualHandler.java

示例6: execute

import org.eclipse.core.commands.ExecutionEvent; //导入方法依赖的package包/类
@Override
public Object execute ( final ExecutionEvent event ) throws ExecutionException
{
    final String connectionId = event.getParameter ( "org.eclipse.scada.ui.chart.connectionId" ); //$NON-NLS-1$
    final String connectionString = event.getParameter ( "org.eclipse.scada.ui.chart.connectionString" ); //$NON-NLS-1$
    final String itemId = event.getParameter ( "org.eclipse.scada.ui.chart.itemId" ); //$NON-NLS-1$
    final String itemType = event.getParameter ( "org.eclipse.scada.ui.chart.itemType" ); //$NON-NLS-1$

    if ( connectionId == null && connectionString == null )
    {
        throw new ExecutionException ( "No connection ID or string set" );
    }
    if ( itemType == null )
    {
        throw new ExecutionException ( "Item type is not set" );
    }

    final Chart configuration = makeConfiguration ( event );

    if ( "da".equals ( itemType ) ) //$NON-NLS-1$
    {
        openDaChartView ( Arrays.asList ( new Item ( connectionId != null ? connectionId : connectionString, itemId, connectionId != null ? Type.ID : Type.URI ) ), configuration );
    }
    else if ( "hd".equals ( itemType ) ) //$NON-NLS-1$
    {
        openHdChartView ( Arrays.asList ( new org.eclipse.scada.hd.ui.connection.data.Item ( connectionId != null ? connectionId : connectionString, itemId, connectionId != null ? org.eclipse.scada.hd.ui.connection.data.Item.Type.ID : org.eclipse.scada.hd.ui.connection.data.Item.Type.URI ) ), configuration );
    }
    else
    {
        throw new ExecutionException ( String.format ( "The item type '%s' is unsupported", itemType ) );
    }

    return null;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:35,代码来源:OpenChartViewWithParameters.java

示例7: makeConfiguration

import org.eclipse.core.commands.ExecutionEvent; //导入方法依赖的package包/类
private Chart makeConfiguration ( final ExecutionEvent event )
{
    final String queryTimespec = event.getParameter ( "org.eclipse.scada.ui.chart.queryTimespec" ); //$NON-NLS-1$

    final Chart configuration = Charts.makeDefaultConfiguration ();

    final XAxis x = configuration.getSelectedXAxis ().get ( 0 );
    final YAxis y = configuration.getSelectedYAxis ().get ( 0 );

    if ( queryTimespec != null && !queryTimespec.isEmpty () )
    {
        final String toks[] = queryTimespec.split ( "[: ]+" ); //$NON-NLS-1$

        final long now = System.currentTimeMillis ();

        final int left = Integer.parseInt ( toks[0] );
        final int right = Integer.parseInt ( toks[1] );
        x.setMinimum ( now - left );
        x.setMaximum ( now + right );

        if ( toks.length >= 4 )
        {
            final double min = Double.parseDouble ( toks[2] );
            final double max = Double.parseDouble ( toks[3] );
            y.setMinimum ( min );
            y.setMaximum ( max );
        }
    }

    Charts.addCompositeQuality ( configuration );

    return configuration;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:34,代码来源:OpenChartViewWithParameters.java

示例8: getDirection

import org.eclipse.core.commands.ExecutionEvent; //导入方法依赖的package包/类
protected Direction getDirection(ExecutionEvent event) {
	String directionName = event.getParameter(Direction.ID);
	return Direction.valueOf(directionName.toUpperCase());
}
 
开发者ID:Talend,项目名称:avro-schema-editor,代码行数:5,代码来源:MoveElementHandler.java

示例9: execute

import org.eclipse.core.commands.ExecutionEvent; //导入方法依赖的package包/类
@Override
protected Object execute(SchemaRegistryView registryView, AvroSchemaEditor editor, ExecutionEvent event) {

	String displayModeStr = event.getParameter(PARAMETER);
	DisplayMode displayMode = DisplayMode.valueOf(displayModeStr.toUpperCase());
	
	registryView.setDisplayMode(displayMode);
	
	return null;
}
 
开发者ID:Talend,项目名称:avro-schema-editor,代码行数:11,代码来源:SetDisplayModeHandler.java


注:本文中的org.eclipse.core.commands.ExecutionEvent.getParameter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。