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