當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。