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


Java SelectionAdapter类代码示例

本文整理汇总了Java中org.eclipse.swt.events.SelectionAdapter的典型用法代码示例。如果您正苦于以下问题:Java SelectionAdapter类的具体用法?Java SelectionAdapter怎么用?Java SelectionAdapter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: createBottomControls

import org.eclipse.swt.events.SelectionAdapter; //导入依赖的package包/类
/**
 * Creates the bottom controls.
 */
private void createBottomControls(Composite parent) {
	Composite bottomControls = new Composite(parent, SWT.NONE);

	bottomControls
			.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).align(SWT.RIGHT, SWT.CENTER).create());
	bottomControls.setLayout(GridLayoutFactory.fillDefaults().numColumns(1).extendedMargins(0, 5, 0, 0).create());

	previewToggleButton = new Button(bottomControls, SWT.PUSH);
	previewToggleButton.setText(HIDE_PREVIEW_TEXT);
	previewToggleButton.setSelection(true);
	previewToggleButton.setLayoutData(GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.BOTTOM).create());
	previewToggleButton.setToolTipText(PREVIEW_BUTTON_TOOLTIP);

	previewToggleButton.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			if (!previewVisible) {
				showContentPreview();
			} else {
				hideContentPreview();
			}
		}
	});
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:28,代码来源:PreviewableWizardPage.java

示例2: createFilterControls

import org.eclipse.swt.events.SelectionAdapter; //导入依赖的package包/类
protected void createFilterControls(Composite con) {
	Label filterLabel = new Label(con,SWT.NONE);
	filterLabel.setText("Filter:");
	GridDataFactory.swtDefaults().applyTo(filterLabel);
	Text filterText = new Text(con, SWT.BORDER);
	filterText.setMessage("(" + PreferenceFilter.MIN_FILTER_CHARS + " chars at least)");
	filterText.addModifyListener(event -> {
		filterChanged(filterText.getText());
	});
	GridDataFactory.fillDefaults().grab(true,false).applyTo(filterText);
	Button clearBtn = new Button(con, SWT.PUSH);
	clearBtn.setImage(AbstractUIPlugin.imageDescriptorFromPlugin(PrefEditorPlugin.PLUGIN_ID,"icons/clear.gif").createImage());
	GridDataFactory.swtDefaults().applyTo(clearBtn);
	clearBtn.addSelectionListener(new SelectionAdapter() {
		
		@Override
		public void widgetSelected(SelectionEvent e) {
			filterText.setText("");
			filterChanged("");
		}
		
	});
}
 
开发者ID:32kda,项目名称:com.onpositive.prefeditor,代码行数:24,代码来源:ViewerPage.java

示例3: setupButtonGroup

import org.eclipse.swt.events.SelectionAdapter; //导入依赖的package包/类
private void
setupButtonGroup(
	final List<Button>		buttons )
{
	for ( final Button b: buttons ){

		b.addSelectionListener(new SelectionAdapter() {
			@Override
			public void widgetSelected(SelectionEvent e) {
				if ( !b.getSelection()){

					b.setSelection( true );
				}
				for ( Button b2: buttons ){

					if ( b2 != b ){
						b2.setSelection( false );
					}
				}
			}});
	}

	Utils.makeButtonsEqualWidth( buttons );
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:25,代码来源:BuddyPluginView.java

示例4: attachButtonListner

import org.eclipse.swt.events.SelectionAdapter; //导入依赖的package包/类
private void attachButtonListner(Button selectKeysButton) {
	selectKeysButton.addSelectionListener(new SelectionAdapter() {

		@Override
		public void widgetSelected(SelectionEvent e) {
			
			String buttonText = Messages.UPDATE_KEYS_WINDOW_LABEL;
			FieldDialog fieldDialog = new FieldDialog(new Shell(), propertyDialogButtonBar);
			fieldDialog.setComponentName(buttonText);
			fieldDialog.setSourceFieldsFromPropagatedSchema(getPropagatedSchema());
			if(StringUtils.isNotBlank(updateByKeysTextBox.getText())){
				fieldDialog.setPropertyFromCommaSepratedString(updateByKeysTextBox.getText());
			}
			fieldDialog.open();
			String valueForNewTableTextBox = fieldDialog.getResultAsCommaSeprated();
			if(valueForNewTableTextBox !=null){
				updateByKeysTextBox.setText(valueForNewTableTextBox);
			}
			showHideErrorSymbol(widgets);
		}
	});
	
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:24,代码来源:UpdateByKeysWidget.java

示例5: createContents

import org.eclipse.swt.events.SelectionAdapter; //导入依赖的package包/类
@Override
protected Control createContents ( final Composite parent )
{
    final Composite wrapper = new Composite ( parent, SWT.NONE );
    wrapper.setLayout ( new GridLayout ( 1, false ) );

    final Label label = new Label ( wrapper, SWT.NONE );
    label.setText ( "Preferences for Eclipse SCADA Security" );

    final Button testButton = new Button ( wrapper, SWT.NONE );
    testButton.setText ( "Test key selection…" );
    testButton.addSelectionListener ( new SelectionAdapter () {
        @Override
        public void widgetSelected ( final SelectionEvent e )
        {
            openDialog ();
        }
    } );

    return wrapper;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:22,代码来源:DefaultPage.java

示例6: ResetControllerImpl

import org.eclipse.swt.events.SelectionAdapter; //导入依赖的package包/类
public ResetControllerImpl ( final ControllerManager controllerManager, final ChartContext chartContext, final ResetController controller )
{
    final Composite space = chartContext.getExtensionSpaceProvider ().getExtensionSpace ();
    this.resetHandler = chartContext.getResetHandler ();
    if ( space != null && this.resetHandler != null )
    {
        this.button = new Button ( space, SWT.PUSH );
        this.button.setText ( Messages.ResetControllerImpl_Label );
        this.button.addSelectionListener ( new SelectionAdapter () {
            @Override
            public void widgetSelected ( final SelectionEvent e )
            {
                action ();
            }
        } );
        space.layout ();
    }
    else
    {
        this.button = null;
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:23,代码来源:ResetControllerImpl.java

示例7: createDownButtonListener

import org.eclipse.swt.events.SelectionAdapter; //导入依赖的package包/类
private void createDownButtonListener() {
    if (downButton != null && selectedElementsTableViewer != null) {
        downButton.addSelectionListener(new SelectionAdapter() {
            // event is null when featureTableViewer is double clicked
            @Override
            public void widgetSelected(final SelectionEvent event) {
                final IStructuredSelection selection = (IStructuredSelection) selectedElementsTableViewer.getSelection();
                final Iterator<EObject> i = Iterators.filter(selection.iterator(), EObject.class);
                int maxIndex = selectedElements.size() - selection.size();
                while (i.hasNext()) {
                    final EObject value = i.next();
                    final int index = selectedElements.indexOf(value);
                    selectedElements.move(Math.min(index + 1, maxIndex++), value);
                }
                selectedElementsTableViewer.refresh();
            }
        });
    }
}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:20,代码来源:ShowHideWizardPage.java

示例8: TrendControlImage

import org.eclipse.swt.events.SelectionAdapter; //导入依赖的package包/类
public TrendControlImage ( final Composite parent, final int style, final String connectionId, final String itemId, final String queryString )
{
    super ( parent, style );

    this.connectionId = connectionId;
    this.itemId = itemId;
    this.queryString = queryString;

    setLayout ( new FillLayout () );

    final Button button = new Button ( parent, SWT.PUSH | SWT.FLAT );
    button.setImage ( org.eclipse.scada.vi.details.swt.Activator.getDefault ().getImageRegistry ().get ( org.eclipse.scada.vi.details.swt.Activator.IMG_TREND ) );
    button.addSelectionListener ( new SelectionAdapter () {
        @Override
        public void widgetSelected ( final SelectionEvent e )
        {
            startHdView ();
        }
    } );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:21,代码来源:TrendControlImage.java

示例9: LinkComposite

import org.eclipse.swt.events.SelectionAdapter; //导入依赖的package包/类
public LinkComposite ( final Composite parent, final int style, final String format )
{
    super ( parent, style );

    final RowLayout layout = new RowLayout ();
    layout.wrap = false;
    layout.center = true;
    layout.spacing = 7;
    layout.pack = true;
    setLayout ( layout );

    this.textLabel = new Link ( this, SWT.NONE );
    this.textLabel.setText ( format );

    this.textLabel.addSelectionListener ( new SelectionAdapter () {

        @Override
        public void widgetSelected ( final SelectionEvent event )
        {
            logger.info ( "LinkComponent selected: {}", event.text ); //$NON-NLS-1$
            Program.launch ( event.text );
        }
    } );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:25,代码来源:LinkComposite.java

示例10: createAdvancedContent

import org.eclipse.swt.events.SelectionAdapter; //导入依赖的package包/类
private Composite createAdvancedContent ( final Composite advWrapper )
{
    final Composite advContent = new Composite ( advWrapper, SWT.NONE );
    advContent.setLayout ( new GridLayout ( 1, false ) );

    final Button credentialsAsProperties = new Button ( advContent, SWT.CHECK );
    credentialsAsProperties.setText ( Messages.LoginDialog_CredentialsButtons_Text );
    credentialsAsProperties.setToolTipText ( Messages.LoginDialog_CredentialsButtons_ToolTip );

    credentialsAsProperties.setSelection ( this.flagCredentialsAsProperties );
    credentialsAsProperties.addSelectionListener ( new SelectionAdapter () {
        @Override
        public void widgetSelected ( final SelectionEvent e )
        {
            LoginDialog.this.flagCredentialsAsProperties = credentialsAsProperties.getSelection ();
        }
    } );

    return advContent;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:21,代码来源:LoginDialog.java

示例11: updateAndPrimaryWidgetSelection

import org.eclipse.swt.events.SelectionAdapter; //导入依赖的package包/类
/**
 * The Function will cal on update and primary key button selection listener
 * @param butoon
 * @param textBox
 * @return Selection Adapter
 */
private SelectionAdapter updateAndPrimaryWidgetSelection(Button butoon, Text textBox){
	SelectionAdapter adapter = new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			String buttonText;
			//TODO as above
			/*if(StringUtils.equalsIgnoreCase(butoon.getText(), Messages.UPDATE_BY_KEYS)){
				buttonText = Messages.UPDATE_KEYS_WINDOW_LABEL;
			}else{*/
			buttonText = Messages.PRIMARY_KEYS_WINDOW_LABEL;
			FieldDialog fieldDialog = new FieldDialog(new Shell(), propertyDialogButtonBar);
			fieldDialog.setComponentName(buttonText);
			fieldDialog.setSourceFieldsFromPropagatedSchema(schemaFields);
			if(StringUtils.isNotBlank(textBox.getText())){
				fieldDialog.setPropertyFromCommaSepratedString(textBox.getText());
			}
			fieldDialog.open();
			String valueForNewTableTextBox = fieldDialog.getResultAsCommaSeprated();
			if(valueForNewTableTextBox !=null){
				textBox.setText(valueForNewTableTextBox);
			}
		}
	};
	return adapter;	
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:32,代码来源:LoadTypeConfigurationDialog.java

示例12: LabelizedCheckBoxes

import org.eclipse.swt.events.SelectionAdapter; //导入依赖的package包/类
/**
 * Create the composite.
 * @param parent
 * @param style
 */
public LabelizedCheckBoxes(Composite parent,
		int style, 
		String [] labels,
		boolean [] enabled,
		boolean [] checked,
		SelectionAdapter [] checkBoxSelectionAdapters) {
	super(parent, style);
	setLayout(new GridLayout(10, false));
	buttons = new Button [labels.length]; 
	for (int i = 0; i < labels.length; i++) {
		buttons [i] = new Button(parent, SWT.CHECK);
		buttons [i].setEnabled(enabled [i]);
		buttons [i].setSelection(checked [i]);
		buttons [i].setText(labels [i]);
		if (checkBoxSelectionAdapters[i]!=null) {
			buttons [i].addSelectionListener(checkBoxSelectionAdapters[i]);
		}
		buttons [i].setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 6, 1));
		buttons [i].setData(PROJECT_PROPERTY_PAGE_WIDGET_ID, BUTTON+"."+i);

		}
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:28,代码来源:LabelizedCheckBoxes.java

示例13: createRemoveBlockedElementGroup

import org.eclipse.swt.events.SelectionAdapter; //导入依赖的package包/类
private void createRemoveBlockedElementGroup (Composite parent) {
Label lfiller = new Label(parent, SWT.NONE);
lfiller.setText("");

Label lblRemoveBlockedElement = new Label(parent, SWT.NONE);
lblRemoveBlockedElement.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
lblRemoveBlockedElement.setText(MessageUtil.getString("removeBlockedElement"));

removeBockedElementButton = new Button(parent, SWT.CHECK);
removeBockedElementButton.setText("");
removeBockedElementButton.setSelection(true);
 
removeBockedElementButton.addSelectionListener(new SelectionAdapter() {
	@Override
	public void widgetSelected(SelectionEvent evt) {
		validatePage();
	}
});

	
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:22,代码来源:GW4ELaunchConfigurationTab.java

示例14: createDisplayReportElementGroup

import org.eclipse.swt.events.SelectionAdapter; //导入依赖的package包/类
private void createDisplayReportElementGroup (Composite parent) {
Label lfiller = new Label(parent, SWT.NONE);
lfiller.setText("");

Label lblDisplayReporElement = new Label(parent, SWT.NONE);
lblDisplayReporElement.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
lblDisplayReporElement.setText(MessageUtil.getString("displayReport"));

displayDetailsButton = new Button(parent, SWT.CHECK);
displayDetailsButton.setText("");
displayDetailsButton.setSelection(true);
new Label(parent, SWT.NONE);
displayDetailsButton.addSelectionListener(new SelectionAdapter() {
	@Override
	public void widgetSelected(SelectionEvent evt) {
		validatePage();
	}
});
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:20,代码来源:GW4ELaunchConfigurationTab.java

示例15: createButtonsForButtonBar

import org.eclipse.swt.events.SelectionAdapter; //导入依赖的package包/类
@Override
protected void createButtonsForButtonBar(Composite parent) {
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    Button btnReset = createButton(parent, IDialogConstants.NO_ID, Messages.FilterDialog_reset, false);
    createButton(parent, IDialogConstants.CANCEL_ID, Messages.FilterDialog_cancel, false);

    btnReset.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            text.setText(""); //$NON-NLS-1$
            btnRegEx.setSelection(false);
            objViewer.setAllChecked(false);
            chgViewer.setAllChecked(false);
        }
    });
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:18,代码来源:FilterDialog.java


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