本文整理汇总了Java中org.eclipse.swt.events.SelectionEvent类的典型用法代码示例。如果您正苦于以下问题:Java SelectionEvent类的具体用法?Java SelectionEvent怎么用?Java SelectionEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SelectionEvent类属于org.eclipse.swt.events包,在下文中一共展示了SelectionEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: attachTableButtonListner
import org.eclipse.swt.events.SelectionEvent; //导入依赖的package包/类
/**
*
* @param selectionComposite
* @param layout
*/
private void attachTableButtonListner(final ELTSubGroupCompositeWithStack selectionComposite,
final StackLayout layout) {
final Button tableRadioBtn = (Button) tableNameRadioButton.getSWTWidgetControl();
tableRadioBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if (tableRadioBtn.getSelection()) {
unRegisterTableOrSQLQueryTextListner();
layout.topControl = tableComposite.getContainerControl();
selectionComposite.getContainerControl().layout();
if (databaseSelectionConfig != null) {
databaseSelectionConfig.setTableNameSelection(true);
databaseSelectionConfig.setTableName(textBoxTableName.getText());
populateWidget();
}
showHideErrorSymbol(widgets);
propertyDialogButtonBar.enableApplyButton(true);
}
}
});
}
示例2: createFilterControls
import org.eclipse.swt.events.SelectionEvent; //导入依赖的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("");
}
});
}
示例3: attachButtonListner
import org.eclipse.swt.events.SelectionEvent; //导入依赖的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);
}
});
}
示例4: createDialogArea
import org.eclipse.swt.events.SelectionEvent; //导入依赖的package包/类
@Override
protected Control createDialogArea(Composite parentShell) {
Composite parent = (Composite) super.createDialogArea(parentShell);
Composite c = new Composite(parent, SWT.NONE);
c.setLayout(new GridLayout(2, false));
Label l = new Label(c, SWT.NONE);
l.setText("Select device: ");
final Combo combo = new Combo(c, SWT.BORDER | SWT.READ_ONLY);
combo.setItems(mDeviceNames);
int defaultSelection =
sSelectedDeviceIndex < mDevices.size() ? sSelectedDeviceIndex : 0;
combo.select(defaultSelection);
sSelectedDeviceIndex = defaultSelection;
combo.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent arg0) {
sSelectedDeviceIndex = combo.getSelectionIndex();
}
});
return parent;
}
示例5: createControl
import org.eclipse.swt.events.SelectionEvent; //导入依赖的package包/类
@Override
public void createControl(Composite parent, FormToolkit toolkit, AvroAttribute<Boolean> element, AvroContext context) {
initialize(element, context);
button = toolkit.createButton(parent, "", SWT.CHECK);
update();
button.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
changeAttribute(getAttribute().getValue(), button.getSelection());
}
});
}
示例6: ButtonProfileEntry
import org.eclipse.swt.events.SelectionEvent; //导入依赖的package包/类
public ButtonProfileEntry ( final DataBindingContext dbc, final Composite parent, final ProfileManager profileManager, final Profile profile, final ChartContext chartContext )
{
super ( dbc, profileManager, profile, chartContext );
this.widget = new Button ( parent, SWT.TOGGLE );
addBinding ( dbc.bindValue ( SWTObservables.observeText ( this.widget ), EMFObservables.observeValue ( profile, ChartPackage.Literals.PROFILE__LABEL ) ) );
this.widget.addSelectionListener ( new SelectionAdapter () {
@Override
public void widgetSelected ( final SelectionEvent e )
{
fireSelection ( ButtonProfileEntry.this.widget.getSelection () );
};
} );
}
示例7: TimeNowActionController
import org.eclipse.swt.events.SelectionEvent; //导入依赖的package包/类
public TimeNowActionController ( final ControllerManager controllerManager, final ChartContext chartContext, final TimeNowAction controller )
{
super ( controllerManager.getContext (), chartContext, controller );
final Composite space = chartContext.getExtensionSpaceProvider ().getExtensionSpace ();
if ( space != null )
{
this.button = new Button ( space, SWT.PUSH );
this.button.setText ( Messages.TimeNowActionController_Label );
this.button.setToolTipText ( Messages.TimeNowActionController_Description );
this.button.addSelectionListener ( new SelectionAdapter () {
@Override
public void widgetSelected ( final SelectionEvent e )
{
action ();
};
} );
space.layout ();
}
else
{
this.button = null;
}
}
示例8: createButton
import org.eclipse.swt.events.SelectionEvent; //导入依赖的package包/类
private void createButton ( final Composite parent )
{
this.wrapper = new Composite ( parent, SWT.NONE );
final GridLayout layout = new GridLayout ( 1, true );
layout.marginHeight = layout.marginWidth = 0;
this.wrapper.setLayout ( layout );
this.startButton = new Button ( this.wrapper, SWT.PUSH );
this.startButton.setLayoutData ( new GridData ( SWT.CENTER, SWT.CENTER, true, true ) );
this.startButton.setText ( Messages.DetailsPart_startButton_label );
this.startButton.addSelectionListener ( new SelectionAdapter () {
@Override
public void widgetSelected ( final SelectionEvent e )
{
try
{
start ();
}
catch ( final Exception ex )
{
logger.error ( "Failed to start chart", ex ); //$NON-NLS-1$
StatusManager.getManager ().handle ( StatusHelper.convertStatus ( Activator.PLUGIN_ID, ex ), StatusManager.BLOCK );
}
}
} );
}
示例9: buttonWidgetSelectionListener
import org.eclipse.swt.events.SelectionEvent; //导入依赖的package包/类
private SelectionAdapter buttonWidgetSelectionListener(Text textWidget){
SelectionAdapter adapter = new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
String text = textWidget.getText();
SQLQueryStatementDialog sqlQueryStatementDialog = new SQLQueryStatementDialog(
Display.getCurrent().getActiveShell(), text);
sqlQueryStatementDialog.open();
if(sqlQueryStatementDialog.getStyleTextSqlQuery() != null){
textWidget.setText(sqlQueryStatementDialog.getStyleTextSqlQuery());
}
if(sqlQueryStatementDialog.isTextValueChanged()){
propertyDialogButtonBar.enableApplyButton(true);
}
}
};
return adapter;
}
示例10: createAssertionCombo
import org.eclipse.swt.events.SelectionEvent; //导入依赖的package包/类
private Combo createAssertionCombo ()
{
final Combo c = new Combo ( this, SWT.NONE );
for ( final Assertion assertion : Assertion.values () )
{
c.add ( assertion.toString () );
}
c.select ( 0 );
c.addSelectionListener ( new SelectionAdapter () {
@Override
public void widgetSelected ( final SelectionEvent e )
{
AssertionComposite.this.orCondition.updateFilter ();
}
} );
final RowData rowData = new RowData ();
rowData.width = 75;
c.setLayoutData ( rowData );
return c;
}
示例11: widgetSelected
import org.eclipse.swt.events.SelectionEvent; //导入依赖的package包/类
@Override
public void widgetSelected ( final SelectionEvent e )
{
final Table table = this.tableViewer.getTable ();
final TableColumn newColumn = (TableColumn)e.widget;
final TableColumn currentColumn = table.getSortColumn ();
final int currentDir = table.getSortDirection ();
int newDir = SWT.UP;
if ( newColumn == currentColumn )
{
newDir = currentDir == SWT.UP ? SWT.DOWN : SWT.UP;
}
else
{
table.setSortColumn ( newColumn );
}
table.setSortDirection ( newDir );
this.tableViewer.setSorter ( new Sorter ( (Columns)newColumn.getData ( COLUMN_KEY ), newDir ) );
}
示例12: widgetSelected
import org.eclipse.swt.events.SelectionEvent; //导入依赖的package包/类
@Override
public void widgetSelected ( final SelectionEvent e )
{
final Table table = this.tableViewer.getTable ();
final TableColumn newColumn = (TableColumn)e.widget;
final TableColumn currentColumn = table.getSortColumn ();
final EventTableColumn column = (EventTableColumn)newColumn.getData ( COLUMN_KEY );
if ( column == EventTableColumn.reservedColumnSourceTimestamp || column == EventTableColumn.reservedColumnEntryTimestamp )
{
final int currentDir = table.getSortDirection ();
int newDir = SWT.UP;
if ( newColumn == currentColumn )
{
newDir = currentDir == SWT.UP ? SWT.DOWN : SWT.UP;
}
else
{
table.setSortColumn ( newColumn );
}
table.setSortDirection ( newDir );
this.tableViewer.setSorter ( new EventTableSorter ( column, newDir ) );
}
}
示例13: DropDownSelectionListener
import org.eclipse.swt.events.SelectionEvent; //导入依赖的package包/类
/**
* Construct the DropDownSelectionListener with the specific menu to be used.
*/
public DropDownSelectionListener(Menu menu) {
this.menu = menu;
MenuItem[] menuItems = menu.getItems();
for (int i=0; i<menuItems.length; i++) {
/*
* Add a menu selection listener so that the menu is hidden
* when the user selects an item from the drop down menu.
*/
menuItems[i].addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
setMenuVisible(false);
}
});
}
}
示例14: ToggleButton
import org.eclipse.swt.events.SelectionEvent; //导入依赖的package包/类
public ToggleButton(Composite parent, int style) {
super(parent, style);
if (colorOn == null) {
colorOn = getDisplay().getSystemColor(SWT.COLOR_GREEN);
colorOff = getDisplay().getSystemColor(SWT.COLOR_RED);
}
FillLayout layout = new FillLayout();
layout.marginHeight = layout.marginWidth = 2;
setLayout(layout);
button = new Button(this, SWT.TOGGLE);
button.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
updateColor();
}
});
}
示例15: createDownButtonListener
import org.eclipse.swt.events.SelectionEvent; //导入依赖的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();
}
});
}
}