當前位置: 首頁>>代碼示例>>Java>>正文


Java SelectionListener類代碼示例

本文整理匯總了Java中org.eclipse.swt.events.SelectionListener的典型用法代碼示例。如果您正苦於以下問題:Java SelectionListener類的具體用法?Java SelectionListener怎麽用?Java SelectionListener使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


SelectionListener類屬於org.eclipse.swt.events包,在下文中一共展示了SelectionListener類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addComboInTable

import org.eclipse.swt.events.SelectionListener; //導入依賴的package包/類
private CCombo addComboInTable(TableViewer tableViewer, TableItem tableItem, String comboName, String comboPaneName, 
		String editorName, int columnIndex,	String[] relationalOperators, SelectionListener dropDownSelectionListener,
		ModifyListener modifyListener,FocusListener focusListener) {
	final Composite buttonPane = new Composite(tableViewer.getTable(), SWT.NONE);
	buttonPane.setLayout(new FillLayout());
	final CCombo combo = new CCombo(buttonPane, SWT.NONE);
	combo.setItems(relationalOperators);
	combo.setData(FilterConstants.ROW_INDEX, tableViewer.getTable().indexOf(tableItem));
	tableItem.setData(comboName, combo);
	tableItem.setData(comboPaneName, buttonPane);
	combo.addSelectionListener(dropDownSelectionListener);
	combo.addModifyListener(modifyListener);
	combo.addFocusListener(focusListener);
	new AutoCompleteField(combo, new CComboContentAdapter(), combo.getItems());
	final TableEditor editor = new TableEditor(tableViewer.getTable());
	editor.grabHorizontal = true;
	editor.grabVertical = true;
	editor.setEditor(buttonPane, tableItem, columnIndex);
	editor.layout();
	combo.setData(editorName, editor);
	return combo;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:23,代碼來源:FilterConditionsDialog.java

示例2: addButtonInTable

import org.eclipse.swt.events.SelectionListener; //導入依賴的package包/類
private void addButtonInTable(TableViewer tableViewer, TableItem tableItem, String columnName, 
		String buttonPaneName, String editorName, int columnIndex, SelectionListener buttonSelectionListener,
		ImagePathConstant imagePath) {
	final Composite buttonPane = new Composite(tableViewer.getTable(), SWT.NONE);
	buttonPane.setLayout(new FillLayout());
	final Button button = new Button(buttonPane, SWT.NONE);
	//button.setText(columnName);
	button.setData(FilterConstants.ROW_INDEX, tableViewer.getTable().indexOf(tableItem));
	tableItem.setData(columnName, button);
	tableItem.setData(buttonPaneName, buttonPane);
	button.addSelectionListener(buttonSelectionListener);
	button.setImage(imagePath.getImageFromRegistry());
	
	final TableEditor editor = new TableEditor(tableViewer.getTable());
	editor.grabHorizontal = true;
	editor.grabVertical = true;
	editor.setEditor(buttonPane, tableItem, columnIndex);
	editor.layout();
	button.setData(editorName, editor);
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:21,代碼來源:FilterConditionsDialog.java

示例3: addCheckButtonInTable

import org.eclipse.swt.events.SelectionListener; //導入依賴的package包/類
private void addCheckButtonInTable(TableViewer tableViewer, TableItem tableItem, String columnName, 
		String groupPaneName, String editorName, int columnIndex, SelectionListener buttonSelectionListener) {
	final Composite buttonPane = new Composite(tableViewer.getTable(), SWT.NONE);
	buttonPane.setLayout(new FillLayout());
	final Button button = new Button(buttonPane, SWT.CHECK);
	button.setData(FilterConstants.ROW_INDEX, tableViewer.getTable().indexOf(tableItem));
	if(null != buttonSelectionListener){
		button.addSelectionListener(buttonSelectionListener);
	}
	tableItem.setData(columnName, button);
	tableItem.setData(groupPaneName, buttonPane);
	
	final TableEditor editor = new TableEditor(tableViewer.getTable());
	editor.grabHorizontal = true;
	editor.grabVertical = true;
	editor.setEditor(buttonPane, tableItem, columnIndex);
	editor.layout();
	button.setData(editorName, editor);
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:20,代碼來源:FilterConditionsDialog.java

示例4: getBrowseButtonSelectionListener

import org.eclipse.swt.events.SelectionListener; //導入依賴的package包/類
@Override
protected SelectionListener getBrowseButtonSelectionListener(final Shell shell) {
    return new SelectionAdapter() {
        @Override
        public void widgetSelected(final SelectionEvent e) {
            String initialPath = projectFileTabPage.getConfigFolderText();
            if (initialPath.length() == 0) {
                initialPath = null;
            }

            final ServerItemSource serverItemSource = new VersionedItemSource(buildServer.getConnection());
            final ServerItemTreeDialog dialog = new ServerItemTreeDialog(
                projectFileTabPage.getControl().getShell(),
                Messages.getString("BuildDefinitionDialog.BrowseDialogTitle"), //$NON-NLS-1$
                initialPath,
                serverItemSource,
                ServerItemType.ALL_FOLDERS);

            if (IDialogConstants.OK_ID == dialog.open()) {
                projectFileTabPage.getControl().getConfigFolderText().setText(dialog.getSelectedServerPath());
                validate();
            }
        }
    };
}
 
開發者ID:Microsoft,項目名稱:team-explorer-everywhere,代碼行數:26,代碼來源:TfsBuildDefinitionDialog.java

示例5: getCreateButtonSelectionListener

import org.eclipse.swt.events.SelectionListener; //導入依賴的package包/類
@Override
protected SelectionListener getCreateButtonSelectionListener(final Shell shell) {
    return new SelectionAdapter() {
        @Override
        public void widgetSelected(final SelectionEvent e) {
            final CreateBuildConfigurationWizard wizard = new CreateBuildConfigurationWizard();

            // update the build definition to contain values as
            // currently defined, that way
            // information inside is available in the creation wizard.
            updateAndVerifyBuildDefinition(true);

            wizard.init(buildDefinition);

            final WizardDialog dialog = new WizardDialog(getShell(), wizard);
            final int rc = dialog.open();

            if (rc == IDialogConstants.OK_ID) {
                checkForBuildFileExistence(true);
                validate();
            }
        }
    };
}
 
開發者ID:Microsoft,項目名稱:team-explorer-everywhere,代碼行數:25,代碼來源:TfsBuildDefinitionDialog.java

示例6: getSelectionListener

import org.eclipse.swt.events.SelectionListener; //導入依賴的package包/類
private SelectionListener getSelectionListener() {
	SelectionListener selectionListener = new SelectionAdapter() {
		public void widgetSelected(SelectionEvent e) {
			if (e.getSource() == selectFromRevisionButton) {
				showLog(fromRevisionText);
			}
			else if (e.getSource() == toHeadButton || e.getSource() == toRevisionButton) {
				toRevisionText.setEnabled(toRevisionButton.getSelection());
				selectToRevisionButton.setEnabled(toRevisionButton.getSelection());
				if (toRevisionButton.getSelection()) toRevisionText.setFocus();					
			}
			else if (e.getSource() == selectToRevisionButton) {
				showLog(toRevisionText);					
			}
			setPageComplete(canFinish());
		}	
	};
	return selectionListener;
}
 
開發者ID:subclipse,項目名稱:subclipse,代碼行數:20,代碼來源:SvnWizardAnnotatePage.java

示例7: showDefaultOrCustomValueListener

import org.eclipse.swt.events.SelectionListener; //導入依賴的package包/類
private SelectionListener showDefaultOrCustomValueListener(final String defaultValue) {
  return new SelectionAdapter() {
    private String customValue = ""; //$NON-NLS-1$

    @Override
    public void widgetSelected(SelectionEvent event) {
      boolean customLocation = !useDefaultLocation.getSelection();

      // Update the targetCreator
      targetCreator.setCustomLocation(customLocation);

      // Enable/disable the location inputs as appropriate
      locationBrowse.setEnabled(customLocation);
      locationInput.setEnabled(customLocation);

      // Capture the current customValue if we're disabling custom values.
      if (!customLocation) {
        customValue = locationInput.getText();
      }

      // Update the locationInput box
      locationInput.setText(customLocation ? customValue : defaultValue);
    }
  };
}
 
開發者ID:GoogleCloudPlatform,項目名稱:google-cloud-eclipse,代碼行數:26,代碼來源:NewDataflowProjectWizardLandingPage.java

示例8: newMenuItem

import org.eclipse.swt.events.SelectionListener; //導入依賴的package包/類
/**
 * Creates a new MenuItem.
 */
public static MenuItem newMenuItem(final Menu parent, final int style, final String text, final SelectionListener selectionListener)
{
  if (Thread.currentThread() != getDisplay().getThread())
  {
    Resultable res = new Resultable() {public void run() {result = newMenuItem(parent, style, text, selectionListener);}};
    getDisplay().syncExec(res);
    return (MenuItem) res.result;
  }
  else
  {
    MenuItem menuItem = new MenuItem(parent, style);
    if (text != null)
    {
      menuItem.setText(text);
    }
    if (selectionListener != null)
    {
      menuItem.addSelectionListener(selectionListener);
    }
    return menuItem;
  }
}
 
開發者ID:spurious,項目名稱:kawa-mirror,代碼行數:26,代碼來源:SwtHelper.java

示例9: removeMetadataListener

import org.eclipse.swt.events.SelectionListener; //導入依賴的package包/類
public void removeMetadataListener(Listener listener) {
	if (listener == null)
		return;
	
	pageStyleCombo.removeSelectionListener((SelectionListener)listener);
	if (regionTypeCombo!=null)
		regionTypeCombo.removeSelectionListener((SelectionListener)listener);
	
	structureText.removeModifyListener((ModifyListener) listener);
	for (Button b : structureRadios)
		b.removeSelectionListener((SelectionListener) listener);
			
	applyStructBtn.removeSelectionListener((SelectionListener)listener);
	applyStructRecBtn.removeSelectionListener((SelectionListener) listener);
	
	linkList.removeSelectionListener((SelectionListener) listener);
	deleteLinkMenuItem.removeSelectionListener((SelectionListener) listener);
	
	linkBtn.removeSelectionListener((SelectionListener) listener);
	breakLinkBtn.removeSelectionListener((SelectionListener) listener);
	
	shapeTypeCombo.removeSelectionListener((SelectionListener) listener);
}
 
開發者ID:Transkribus,項目名稱:TranskribusSwtGui,代碼行數:24,代碼來源:StructuralMetadataWidget.java

示例10: removeTextStyleListener

import org.eclipse.swt.events.SelectionListener; //導入依賴的package包/類
public void removeTextStyleListener(Listener listener) {
	if (listener == null)
		return;
	
	bgColorCombo.removeSelectionListener((SelectionListener)listener);		
	boldCheck.removeSelectionListener((SelectionListener)listener);
	fontFamilyText.removeModifyListener((ModifyListener)listener);
	fontSizeSpinner.removeSelectionListener((SelectionListener)listener);
	italicCheck.removeSelectionListener((SelectionListener)listener);
	kerningSpinner.removeSelectionListener((SelectionListener)listener);
	letterSpacedCheck.removeSelectionListener((SelectionListener)listener);
	monospaceCheck.removeSelectionListener((SelectionListener)listener);
	reverseVideoCheck.removeSelectionListener((SelectionListener)listener);
	serifCheck.removeSelectionListener((SelectionListener)listener);
	smallCapsCheck.removeSelectionListener((SelectionListener)listener);
	strikethroughCheck.removeSelectionListener((SelectionListener)listener);
	underlinedCheck.removeSelectionListener((SelectionListener)listener);
	subscriptCheck.removeSelectionListener((SelectionListener)listener);
	superscriptCheck.removeSelectionListener((SelectionListener)listener);
	textColorCombo.removeSelectionListener((SelectionListener)listener);
	
	applyBtn.removeSelectionListener((SelectionListener)listener);
	applyRecursiveBtn.removeSelectionListener((SelectionListener)listener);
}
 
開發者ID:Transkribus,項目名稱:TranskribusSwtGui,代碼行數:25,代碼來源:TextStyleTypeWidget.java

示例11: addTextStyleListener

import org.eclipse.swt.events.SelectionListener; //導入依賴的package包/類
public void addTextStyleListener(Listener listener) {
	if (listener == null)
		return;
	
	this.listener = listener;
	
	bgColorCombo.addSelectionListener((SelectionListener)listener);
	boldCheck.addSelectionListener((SelectionListener)listener);
	fontFamilyText.addModifyListener((ModifyListener)listener);
	fontSizeSpinner.addSelectionListener((SelectionListener)listener);
	italicCheck.addSelectionListener((SelectionListener)listener);
	kerningSpinner.addSelectionListener((SelectionListener)listener);
	letterSpacedCheck.addSelectionListener((SelectionListener)listener);
	monospaceCheck.addSelectionListener((SelectionListener)listener);
	reverseVideoCheck.addSelectionListener((SelectionListener)listener);
	serifCheck.addSelectionListener((SelectionListener)listener);
	smallCapsCheck.addSelectionListener((SelectionListener)listener);
	strikethroughCheck.addSelectionListener((SelectionListener)listener);
	underlinedCheck.addSelectionListener((SelectionListener)listener);
	subscriptCheck.addSelectionListener((SelectionListener)listener);
	superscriptCheck.addSelectionListener((SelectionListener)listener);
	textColorCombo.addSelectionListener((SelectionListener)listener);
	
	applyBtn.addSelectionListener((SelectionListener)listener);
	applyRecursiveBtn.addSelectionListener((SelectionListener)listener);		
}
 
開發者ID:Transkribus,項目名稱:TranskribusSwtGui,代碼行數:27,代碼來源:TextStyleTypeWidget.java

示例12: widgetSelected

import org.eclipse.swt.events.SelectionListener; //導入依賴的package包/類
@Override
		public void widgetSelected(SelectionEvent e) {
//			e.doit = false; 
			if (e.getSource() instanceof Button) {
				Button b = (Button) e.getSource();
				String text = b.getText();
				
				if (!text.isEmpty()) {
					Event e1 = new Event();
					e1.widget = VirtualKeyboard.this;
					e1.detail = text.charAt(0);
					e1.text = b.getToolTipText();
					
					for (SelectionListener l : selListener) {
						l.widgetSelected(new SelectionEvent(e1));
					}
				}
			}
		}
 
開發者ID:Transkribus,項目名稱:TranskribusSwtGui,代碼行數:20,代碼來源:VirtualKeyboard.java

示例13: addSelectionListener

import org.eclipse.swt.events.SelectionListener; //導入依賴的package包/類
public static void addSelectionListener(Widget w, SelectionListener l) {
	if (w instanceof MenuItem)
		addSelectionListener((MenuItem) w, l);
	else if (w instanceof ToolItem)
		addSelectionListener((ToolItem) w, l);
	else if (w instanceof Button)
		addSelectionListener((Button) w, l);
	else if (w instanceof DropDownToolItem) {
		addSelectionListener((DropDownToolItem) w, l);
	} 
	else if (w instanceof CTabFolder) {
		addSelectionListener((CTabFolder) w, l);
	}
	else if (w instanceof Combo){
		addSelectionListener((Combo) w, l);
	}
	else
		throw new RuntimeException("Widget type not supported for selection events: " + w);
}
 
開發者ID:Transkribus,項目名稱:TranskribusSwtGui,代碼行數:20,代碼來源:SWTUtil.java

示例14: createButton

import org.eclipse.swt.events.SelectionListener; //導入依賴的package包/類
protected Button createButton(Composite parent, String label,
		SelectionListener listener) {
	Button button = new Button(parent, SWT.PUSH);
	button.setFont(parent.getFont());
	button.setText(label);
	button.addSelectionListener(listener);
	GridData gd = new GridData();
	gd.horizontalAlignment = GridData.FILL;
	gd.grabExcessHorizontalSpace = true;
	gd.verticalAlignment = GridData.BEGINNING;
	gd.widthHint = SWTUtil.getButtonWidthHint(button);

	button.setLayoutData(gd);

	return button;
}
 
開發者ID:cplutte,項目名稱:bts,代碼行數:17,代碼來源:ListDialogField.java

示例15: addSelectionListener

import org.eclipse.swt.events.SelectionListener; //導入依賴的package包/類
/**
 * Adds a {@link SelectionListener} to the {@link #spinner}. If the widget
 * has not yet been created, the listener will be added when the widget is
 * created.
 * 
 * @param listener
 *            The listener to add.
 */
public void addSelectionListener(final SelectionListener listener) {
	if (spinner != null) {
		spinner.getDisplay().asyncExec(new Runnable() {
			@Override
			public void run() {
				spinner.addSelectionListener(listener);
			}
		});
	} else {
		if (selectionListeners == null) {
			selectionListeners = new ArrayList<SelectionListener>();
		}
		selectionListeners.add(listener);
	}
	return;
}
 
開發者ID:eclipse,項目名稱:eavp,代碼行數:25,代碼來源:SpinnerContribution.java


注:本文中的org.eclipse.swt.events.SelectionListener類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。