本文整理汇总了Java中org.eclipse.swt.SWT.PUSH属性的典型用法代码示例。如果您正苦于以下问题:Java SWT.PUSH属性的具体用法?Java SWT.PUSH怎么用?Java SWT.PUSH使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.swt.SWT
的用法示例。
在下文中一共展示了SWT.PUSH属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createContent
private void createContent() {
toolBar = new ToolBar(this, SWT.HORIZONTAL);
toolBar.setEnabled(false);
GridLayout layout = new GridLayout();
GridData layoutData = new GridData(SWT.FILL, SWT.TOP, true, false);
toolBar.setLayout(layout);
toolBar.setLayoutData(layoutData);
ToolItem cancelProcessToolItem = new ToolItem(toolBar, SWT.PUSH);
cancelProcessToolItem.setText(resourceBundle.getString("cancel_process"));
cancelProcessToolItem.addListener(SWT.Selection, event -> {
listeners.forEach(DBProcessInfoViewListener::dbProcessInfoViewCancelProcessToolItemClicked);
});
ToolItem terminateProcessToolItem = new ToolItem(toolBar, SWT.PUSH);
terminateProcessToolItem.setText(resourceBundle.getString("kill_process"));
terminateProcessToolItem.addListener(SWT.Selection, event -> {
listeners.forEach(DBProcessInfoViewListener::dbProcessInfoViewTerminateProcessToolItemClicked);
});
processInfoText = new Text(this, SWT.MULTI | SWT.READ_ONLY | SWT.WRAP | SWT.V_SCROLL);
GridData textLayoutData = new GridData(SWT.FILL, SWT.BOTTOM, true, false);
textLayoutData.heightHint = 200;
processInfoText.setLayoutData(textLayoutData);
}
示例2: setupTrackers
private void setupTrackers(SWTSkinObjectContainer so) {
Composite parent = so.getComposite();
Button button = new Button( parent, SWT.PUSH );
Messages.setLanguageText( button, "label.edit.trackers" );
TOTorrent torrent = torrentOptions.getTorrent();
button.setEnabled( torrent != null && !TorrentUtils.isReallyPrivate( torrent ));
button.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
List<List<String>> trackers = torrentOptions.getTrackers( false );
new MultiTrackerEditor( shell, null, trackers, new TrackerEditorListener() {
@Override
public void trackersChanged(String str, String str2, List<List<String>> updatedTrackers) {
torrentOptions.setTrackers(updatedTrackers);
}
}, true, true );
}});
}
示例3: createCopyButton
/**
* Creates the copy button
* @param buttonComposite
*/
private void createCopyButton(Composite buttonComposite){
Button copyButton = new Button(buttonComposite, SWT.PUSH);
copyButton.setImage(ImagePathConstant.ENABLE_COPY_ICON.getImageFromRegistry());
copyButton.setToolTipText(COPY_BUTTON_TOOL_TIP);
copyButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if (StringUtils.isNotBlank(styledText.getSelectionText())) {
styledText.copy();
} else {
styledText.selectAll();
styledText.copy();
styledText.setSelection(0);
}
}
});
copyButton.pack();
}
示例4: createDestinationGroup
/**
* Create the export destination specification widgets
*/
protected void createDestinationGroup(Composite parent) {
Font font = parent.getFont();
// destination specification group
Composite destinationSelectionGroup = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
layout.numColumns = 3;
destinationSelectionGroup.setLayout(layout);
destinationSelectionGroup.setLayoutData(new GridData(
GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL));
destinationSelectionGroup.setFont(font);
Label destinationLabel = new Label(destinationSelectionGroup, SWT.NONE);
destinationLabel.setText(getTargetLabel());
destinationLabel.setFont(font);
// destination name entry field
destinationNameField = new Combo(destinationSelectionGroup, SWT.SINGLE
| SWT.BORDER);
destinationNameField.addListener(SWT.Modify, this);
destinationNameField.addListener(SWT.Selection, this);
GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL
| GridData.GRAB_HORIZONTAL);
data.widthHint = SIZING_TEXT_FIELD_WIDTH;
destinationNameField.setLayoutData(data);
destinationNameField.setFont(font);
// destination browse button
destinationBrowseButton = new Button(destinationSelectionGroup,
SWT.PUSH);
destinationBrowseButton.setText(N4ExportMessages.DataTransfer_browse);
destinationBrowseButton.addListener(SWT.Selection, this);
destinationBrowseButton.setFont(font);
setButtonLayoutData(destinationBrowseButton);
// new Label(parent, SWT.NONE); // vertical spacer
}
示例5: initSaveButton
private void initSaveButton() {
Composite cButtons = new Composite(cConfig, SWT.NONE);
GridLayout gridLayout = new GridLayout();
gridLayout.verticalSpacing = gridLayout.marginHeight = 0;
//gridLayout.horizontalSpacing = gridLayout.verticalSpacing = gridLayout.marginHeight = gridLayout.marginWidth = 0;
gridLayout.numColumns = 2;
cButtons.setLayout(gridLayout);
Utils.setLayoutData(cButtons, new GridData(GridData.FILL_HORIZONTAL));
GridData gridData;
LinkLabel ll = new LinkLabel( cButtons, "label.help", Constants.URL_WIKI );
gridData = new GridData(GridData.FILL_HORIZONTAL);
ll.getlabel().setLayoutData( gridData );
final Button save = new Button(cButtons, SWT.PUSH);
Messages.setLanguageText(save, "ConfigView.button.save"); //$NON-NLS-1$
gridData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
gridData.horizontalSpan = 1;
gridData.widthHint = 80;
Utils.setLayoutData(save, gridData);
save.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
// force focusout on osx
save.setFocus();
save();
}
});
}
示例6: createDialogArea
@Override
protected Control createDialogArea(Composite parent) {
Composite container = (Composite) super.createDialogArea(parent);
Button button = new Button(container, SWT.PUSH);
button.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
button.setText("Press me");
button.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
System.out.println("Pressed");
}
});
return container;
}
示例7: createViewer
private void createViewer(Composite parent) {
viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.BORDER | SWT.CHECK | SWT.READ_ONLY | SWT.PUSH);
createColumns(parent, viewer);
final Table table = viewer.getTable();
table.setHeaderVisible(true);
table.setLinesVisible(true);
viewer.getTable().addListener(SWT.Selection, new Listener() {
@Override
public void handleEvent(org.eclipse.swt.widgets.Event event) {
if (highlightNodes.getSelection())
highlightNodesOnGraph(highlightNodes.getSelection());
}
});
viewer.setContentProvider(new ArrayContentProvider());
viewer.setInput(this.units);
getSite().setSelectionProvider(viewer);
GridData gridData = new GridData();
gridData.verticalAlignment = GridData.FILL;
gridData.horizontalSpan = 2;
gridData.grabExcessHorizontalSpace = true;
gridData.grabExcessVerticalSpace = true;
gridData.horizontalAlignment = GridData.FILL;
viewer.getControl().setLayoutData(gridData);
Hashtable<String, Object> properties = new Hashtable<>();
String[] topics = new String[] { DataModel.EA_TOPIC_DATA_SELECTION, DataModel.EA_TOPIC_DATA_UNIT_CHANGED, DataModel.EA_TOPIC_DATA_VIEW_REFRESH };
properties.put(EventConstants.EVENT_TOPIC, topics);
ServiceUtil.registerService(EventHandler.class, this, properties);
}
示例8: createCopyToolItem
/**
* Create the copy tool item (button).
*/
protected ToolItem createCopyToolItem() {
ToolItem toolItem = new ToolItem(toolBar, SWT.PUSH);
toolItem.setImage(imageManager.get(ImageManager.ICON_COPY));
toolItem.setText(textBundle.get("FileViewerWindow.CopyButton")); //$NON-NLS-1$
toolItem.setToolTipText(textBundle.get("FileViewerWindow.CopyTooltip")); //$NON-NLS-1$
toolItem.setEnabled(true);
toolItem.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
getContentTypeAdapter().copy();
}
});
return toolItem;
}
示例9: PluginDirectoryParameter
public PluginDirectoryParameter(final Composite pluginGroup,DirectoryParameterImpl parameter) {
controls = new Control[3];
controls[0] = new Label(pluginGroup,SWT.NULL);
Messages.setLanguageText(controls[0],parameter.getLabelKey());
final com.biglybt.ui.swt.config.StringParameter sp =
new com.biglybt.ui.swt.config.StringParameter(
pluginGroup,
parameter.getKey(),
parameter.getDefaultValue());
controls[1] = sp.getControl();
GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
controls[1].setLayoutData(gridData);
Button browse = new Button(pluginGroup, SWT.PUSH);
ImageLoader.getInstance().setButtonImage(browse, "openFolderButton");
browse.setToolTipText(MessageText.getString("ConfigView.button.browse"));
browse.addListener(SWT.Selection, new Listener() {
@Override
public void handleEvent(Event event) {
DirectoryDialog dialog = new DirectoryDialog(pluginGroup.getShell(), SWT.APPLICATION_MODAL);
dialog.setFilterPath(sp.getValue());
String path = dialog.open();
if (path != null) {
sp.setValue(path);
}
}
});
controls[2] = browse;
}
示例10: createSortMenu
protected void createSortMenu(String menuNames[]) {
if (table == null)
return;
sortMenu = new Menu(table.getShell(), SWT.POP_UP);
for (int x = 0; x < menuNames.length; x++) {
MenuItem item = new MenuItem(sortMenu, SWT.PUSH);
Integer ID = x;
item.setData(ID);
item.setText(menuNames[x]);
item.addSelectionListener(this);
}
table.setMenu(sortMenu);
}
示例11: fillMenu
@Override
public void fillMenu(String sColumnName, Menu menu) {
List<Object> ds = tv.getSelectedDataSources();
final MenuItem menuTagIt = new MenuItem(menu, SWT.PUSH);
Messages.setLanguageText(menuTagIt, "TagDiscoveriesView.menu.tagit");
menuTagIt.addListener(SWT.Selection, new TableSelectedRowsListener(tv) {
@Override
public void run(TableRowCore row) {
TagDiscovery tagDiscovery = (TagDiscovery) row.getDataSource(true);
TagManager tm = TagManagerFactory.getTagManager();
TagType manual_tt = tm.getTagType(TagType.TT_DOWNLOAD_MANUAL);
Tag tag = manual_tt.getTag(tagDiscovery.getName(), true);
if (tag == null) {
try {
tag = manual_tt.createTag(tagDiscovery.getName(), true);
tag.setPublic(true);
tag.setGroup("Discovery");
tag.setVisible(true);
} catch (TagException e) {
return;
}
}
byte[] hash = tagDiscovery.getHash();
DownloadManager dm = CoreFactory.getSingleton().getGlobalManager().getDownloadManager(
new HashWrapper(hash));
tag.addTaggable(dm);
String key = Base32.encode(hash) + tag.getTagName(true);
mapTagDiscoveries.remove(key);
tv.removeDataSource(tagDiscovery);
ViewTitleInfoManager.refreshTitleInfo(SBC_TagDiscovery.this);
}
});
}
示例12: createControl
@Override
public void createControl ( final Composite parent )
{
final Composite wrapper = new Composite ( parent, SWT.NONE );
wrapper.setLayout ( new GridLayout ( 3, false ) );
final Label label = new Label ( wrapper, SWT.NONE );
label.setText ( Messages.FileSelectionPage_Label_OutputFile );
label.setLayoutData ( new GridData ( SWT.CENTER, SWT.CENTER, false, false ) );
this.text = new Text ( wrapper, SWT.SINGLE | SWT.BORDER );
this.text.setLayoutData ( new GridData ( SWT.FILL, SWT.CENTER, true, false ) );
final Button button = new Button ( wrapper, SWT.PUSH );
button.setText ( Messages.FileSelectionPage_Button_Browse );
button.addSelectionListener ( new SelectionAdapter () {
@Override
public void widgetSelected ( final SelectionEvent e )
{
updateFile ();
}
} );
setControl ( wrapper );
update ();
}
示例13: SWTOtherEditor
/**
* Creates a new instance.
*
* @param parent the parent.
* @param style the style.
* @param chart the chart.
*/
public SWTOtherEditor(Composite parent, int style, JFreeChart chart)
{
super(parent, style);
FillLayout layout = new FillLayout();
layout.marginHeight = layout.marginWidth = 4;
setLayout(layout);
Group general = new Group(this, SWT.NONE);
general.setLayout(new GridLayout(3, false));
general.setText(localizationResources.getString("General"));
// row 1: antialiasing
antialias = new Button(general, SWT.CHECK);
antialias.setText(localizationResources.getString("Draw_anti-aliased"));
antialias.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false,
3, 1));
antialias.setSelection(chart.getAntiAlias());
//row 2: background paint for the chart
new Label(general, SWT.NONE).setText(localizationResources.getString(
"Background_paint"));
backgroundPaintCanvas = new SWTPaintCanvas(general, SWT.NONE,
SWTUtils.toSwtColor(getDisplay(), chart.getBackgroundPaint()));
GridData bgGridData = new GridData(SWT.FILL, SWT.CENTER, true, false);
bgGridData.heightHint = 20;
backgroundPaintCanvas.setLayoutData(bgGridData);
Button selectBgPaint = new Button(general, SWT.PUSH);
selectBgPaint.setText(localizationResources.getString("Select..."));
selectBgPaint.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false,
false));
selectBgPaint.addSelectionListener(
new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
ColorDialog dlg = new ColorDialog(getShell());
dlg.setText(localizationResources.getString(
"Background_paint"));
dlg.setRGB(backgroundPaintCanvas.getColor().getRGB());
RGB rgb = dlg.open();
if (rgb != null) {
backgroundPaintCanvas.setColor(
new Color(getDisplay(), rgb));
}
}
}
);
}
示例14: createBuildPoliciesGeneratorSection
private void createBuildPoliciesGeneratorSection(Composite parent) {
composite = new Composite(parent_1, SWT.NONE);
composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1));
GridLayout gl_composite = new GridLayout(1, false);
gl_composite.marginWidth = 0;
composite.setLayout(gl_composite);
Button fRefreshButton = new Button(composite, SWT.PUSH);
fRefreshButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
fRefreshButton.setEnabled(true);
fRefreshButton.setText(MessageUtil.getString("refresh"));
fRefreshButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent evt) {
refreshStartElement();
}
});
lblNewLabel_1 = new Label(parent_1, SWT.NONE);
lblNewLabel_1.setText(MessageUtil.getString("additionalGraphModels"));
gd = new GridData();
gd.horizontalIndent = 25;
lblNewLabel_1.setLayoutData(gd);
mpg = new ModelPathGenerator(parent_1, SWT.NONE, new Listener() {
@Override
public void handleEvent(Event event) {
updateConfigState();
}
});
mpg.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
GridLayout gridLayout = (GridLayout) mpg.getLayout();
gridLayout.marginWidth = 0;
composite_1 = new Composite(parent_1, SWT.NONE);
composite_1.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1));
composite_1.setLayout(new GridLayout(1, false));
hintButton = new Button(composite_1, SWT.CHECK);
hintButton.setText(MessageUtil.getString("hint"));
filterGraphmlButton = new Button(composite_1, SWT.CHECK);
filterGraphmlButton.setText(MessageUtil.getString("filter_graphml_file"));
Label fDummyGeneratorLabel = new Label(parent, SWT.NONE);
GridData gd_1 = new GridData();
gd_1.horizontalSpan = 1;
fDummyGeneratorLabel.setLayoutData(gd_1);
mpg.setButtons(hintButton, filterGraphmlButton);
composite_3 = new Composite(parent_1, SWT.NONE);
GridLayout gl_composite_3 = new GridLayout(1, false);
gl_composite_3.marginWidth = 0;
composite_3.setLayout(gl_composite_3);
composite_3.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
}
示例15: createDialogArea
@Override
protected Control createDialogArea( Composite parent ) {
Composite comp = (Composite) super.createDialogArea( parent );
GridLayout layout = (GridLayout) comp.getLayout();
layout.numColumns = 3;
Label nameLabel = new Label( comp, SWT.RIGHT );
nameLabel.setText( "Name: " );
nameLabel.setLayoutData( new GridData( GridData.END, GridData.CENTER, false, false ) );
nameText = new Text( comp, SWT.SINGLE | SWT.BORDER );
nameText.setText( Const.NVL( repo.getName(), "" ) );
nameText.setLayoutData( new GridData( GridData.FILL, GridData.CENTER, true, false, 2, 1 ) );
Label descLabel = new Label( comp, SWT.RIGHT );
descLabel.setText( "Description: " );
descLabel.setLayoutData( new GridData( GridData.END, GridData.CENTER, false, false ) );
descText = new Text( comp, SWT.SINGLE | SWT.BORDER );
descText.setLayoutData( new GridData( GridData.FILL, GridData.CENTER, true, false, 2, 1 ) );
descText.setText( Const.NVL( repo.getDescription(), "" ) );
Label directoryLabel = new Label( comp, SWT.RIGHT );
directoryLabel.setText( "Directory: " );
directoryLabel.setLayoutData( new GridData( GridData.END, GridData.CENTER, false, false ) );
directoryText = new Text( comp, SWT.SINGLE | SWT.BORDER );
directoryText.setLayoutData( new GridData( GridData.FILL, GridData.CENTER, true, false ) );
directoryText.setText( Const.NVL( repo.getDirectory(), "" ) );
Button directoryButton = new Button( comp, SWT.PUSH );
directoryButton.setText( "Browse" );
directoryButton.addSelectionListener( new SelectionAdapter() {
@Override
public void widgetSelected( SelectionEvent e ) {
DirectoryDialog dialog = new DirectoryDialog( getShell(), SWT.OPEN );
if ( dialog.open() != null ) {
directoryText.setText( dialog.getFilterPath() );
}
}
} );
Label typeLabel = new Label( comp, SWT.RIGHT );
typeLabel.setText( "Type: " );
typeLabel.setLayoutData( new GridData( GridData.END, GridData.CENTER, false, false ) );
typeCombo = new Combo( comp, SWT.READ_ONLY );
typeCombo.setItems( IVCS.GIT, IVCS.SVN );
if ( repo.getType() != null ) {
if ( repo.getType().equals( IVCS.GIT ) ) {
typeCombo.select( 0 );
} else {
typeCombo.select( 1 );
}
}
typeCombo.setLayoutData( new GridData( GridData.FILL, GridData.CENTER, true, false, 2, 1 ) );
return comp;
}