本文整理汇总了Java中org.eclipse.swt.widgets.Button.setImage方法的典型用法代码示例。如果您正苦于以下问题:Java Button.setImage方法的具体用法?Java Button.setImage怎么用?Java Button.setImage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.widgets.Button
的用法示例。
在下文中一共展示了Button.setImage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createFilterControls
import org.eclipse.swt.widgets.Button; //导入方法依赖的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("");
}
});
}
示例2: TrendControlImage
import org.eclipse.swt.widgets.Button; //导入方法依赖的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 ();
}
} );
}
示例3: createCopyButton
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
/**
* 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: setButtonImage
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
public Image setButtonImage(Button btn, final String key) {
Image bg = getImage(key);
btn.setImage(bg);
btn.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
releaseImage(key);
}
});
return( bg );
}
示例5: addButtonPanel
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
private void addButtonPanel(Composite container) {
Composite composite_1 = new Composite(container, SWT.NONE);
composite_1.setLayout(new GridLayout(4, false));
ColumnLayoutData cld_composite_1 = new ColumnLayoutData();
cld_composite_1.horizontalAlignment = ColumnLayoutData.RIGHT;
cld_composite_1.heightHint = 30;
composite_1.setLayoutData(cld_composite_1);
Button addButton = new Button(composite_1, SWT.NONE);
addButton.setToolTipText(Messages.ADD_KEY_SHORTCUT_TOOLTIP);
addButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
addButton.setImage(ImagePathConstant.ADD_BUTTON.getImageFromRegistry());
attachAddButtonListern(addButton);
deleteButton = new Button(composite_1, SWT.NONE);
deleteButton.setToolTipText(Messages.DELETE_KEY_SHORTCUT_TOOLTIP);
deleteButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
deleteButton.setImage(ImagePathConstant.DELETE_BUTTON.getImageFromRegistry());
attachDeleteButtonListener(deleteButton);
upButton = new Button(composite_1, SWT.NONE);
upButton.setToolTipText(Messages.MOVE_UP_KEY_SHORTCUT_TOOLTIP);
upButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
upButton.setImage(ImagePathConstant.MOVEUP_BUTTON.getImageFromRegistry());
attachUpButtonListener(upButton);
downButton = new Button(composite_1, SWT.NONE);
downButton.setToolTipText(Messages.MOVE_DOWN_KEY_SHORTCUT_TOOLTIP);
downButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
downButton.setImage(ImagePathConstant.MOVEDOWN_BUTTON.getImageFromRegistry());
attachDownButtonListerner(downButton);
deleteButton.setEnabled(false);
upButton.setEnabled(false);
downButton.setEnabled(false);
}
示例6: addButtonPanel
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
protected Composite addButtonPanel(Composite container) {
container_1.setLayout(new GridLayout(1, false));
Composite composite_1 = new Composite(container, SWT.NONE);
composite_1.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
composite_1.setLayout(new GridLayout(5, false));
addButton = new Button(composite_1, SWT.NONE);
addButton.setToolTipText(Messages.ADD_KEY_SHORTCUT_TOOLTIP);
addButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
addButton.setImage(ImagePathConstant.ADD_BUTTON.getImageFromRegistry());
attachAddButtonListern(addButton);
deleteButton = new Button(composite_1, SWT.NONE);
deleteButton.setToolTipText(Messages.DELETE_KEY_SHORTCUT_TOOLTIP);
deleteButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
deleteButton.setImage(ImagePathConstant.DELETE_BUTTON.getImageFromRegistry());
attachDeleteButtonListener(deleteButton);
upButton = new Button(composite_1, SWT.NONE);
upButton.setToolTipText(Messages.MOVE_UP_KEY_SHORTCUT_TOOLTIP);
upButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
upButton.setImage(ImagePathConstant.MOVEUP_BUTTON.getImageFromRegistry());
attachUpButtonListener(upButton);
downButton = new Button(composite_1, SWT.NONE);
downButton.setToolTipText(Messages.MOVE_DOWN_KEY_SHORTCUT_TOOLTIP);
downButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
downButton.setImage( ImagePathConstant.MOVEDOWN_BUTTON.getImageFromRegistry());
attachDownButtonListerner(downButton);
deleteButton.setEnabled(false);
upButton.setEnabled(false);
downButton.setEnabled(false);
new Label(composite_1, SWT.NONE);
return composite_1;
}
示例7: createOperationOutputFieldTable
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
private void createOperationOutputFieldTable() {
Composite operationOutputFieldComposite = new Composite(mainComposite, SWT.NONE);
operationOutputFieldComposite.setLayout(new GridLayout(1, false));
GridData gridDataOperationOutputFieldComposite = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
gridDataOperationOutputFieldComposite.heightHint = 200;
gridDataOperationOutputFieldComposite.widthHint = 159;
operationOutputFieldComposite.setLayoutData(gridDataOperationOutputFieldComposite);
Composite buttonCompositeForOperationOutputField = new Composite(operationOutputFieldComposite, SWT.NONE);
buttonCompositeForOperationOutputField.setLayout(new GridLayout(2, false));
GridData gd_buttonCompositeForOperationOutputField = new GridData(SWT.LEFT, SWT.FILL, false, false, 1, 1);
gd_buttonCompositeForOperationOutputField.heightHint = 36;
gd_buttonCompositeForOperationOutputField.widthHint = 139;
buttonCompositeForOperationOutputField.setLayoutData(gd_buttonCompositeForOperationOutputField);
addButtonOutputTable = new Button(buttonCompositeForOperationOutputField, SWT.NONE);
addButtonOutputTable.setImage(ImagePathConstant.ADD_BUTTON.getImageFromRegistry());
deletButtonOutputTable = new Button(buttonCompositeForOperationOutputField, SWT.NONE);
deletButtonOutputTable.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
deletButtonOutputTable.setImage(ImagePathConstant.DELETE_BUTTON.getImageFromRegistry());
outputTableViewer = new TableViewer(operationOutputFieldComposite, SWT.BORDER | SWT.FULL_SELECTION|SWT.MULTI);
outputTable = outputTableViewer.getTable();
outputTable.setLinesVisible(true);
outputTable.setHeaderVisible(true);
outputTable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
outputTable.setVisible(true);
}
示例8: createUpButton
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
private void createUpButton(Composite composite_11) {
btnUp = new Button(composite_11, SWT.NONE);
btnUp.setToolTipText(Messages.MOVE_UP_KEY_SHORTCUT_TOOLTIP);
btnUp.setImage(ImagePathConstant.MOVEUP_BUTTON.getImageFromRegistry());
btnUp.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
moveRowUp();
}
});
}
示例9: createDeleteButton
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
private void createDeleteButton(Composite composite_11) {
btnDelete = new Button(composite_11, SWT.NONE);
btnDelete.setToolTipText(Messages.DELETE_KEY_SHORTCUT_TOOLTIP);
btnDelete.setImage(ImagePathConstant.DELETE_BUTTON.getImageFromRegistry());
btnDelete.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
deleteRow();
}
});
}
示例10: createAddButton
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
private void createAddButton(Composite composite_11) {
btnAdd = new Button(composite_11, SWT.NONE);
btnAdd.setToolTipText(Messages.ADD_KEY_SHORTCUT_TOOLTIP);
btnAdd.setImage(ImagePathConstant.ADD_BUTTON.getImageFromRegistry());
btnAdd.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
addNewRow();
}
});
}
示例11: createDownButton
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
private void createDownButton(Composite composite_11) {
btnDown = new Button(composite_11, SWT.NONE);
btnDown.setImage(ImagePathConstant.MOVEDOWN_BUTTON.getImageFromRegistry());
btnDown.setToolTipText(Messages.MOVE_DOWN_KEY_SHORTCUT_TOOLTIP);
btnDown.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
moveRowDown();
}
});
}
示例12: createUpButton
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
private void createUpButton(Composite composite_11) {
btnUp = new Button(composite_11, SWT.NONE);
btnUp.setImage(ImagePathConstant.MOVEUP_BUTTON.getImageFromRegistry());
btnUp.setToolTipText(Messages.MOVE_UP_KEY_SHORTCUT_TOOLTIP);
btnUp.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
moveRowUp();
}
});
}
示例13: createDeleteButton
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
private void createDeleteButton(Composite composite_11) {
btnDelete = new Button(composite_11, SWT.NONE);
btnDelete.setImage(ImagePathConstant.DELETE_BUTTON.getImageFromRegistry());
btnDelete.setToolTipText(Messages.DELETE_KEY_SHORTCUT_TOOLTIP);
btnDelete.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
deleteRow();
}
});
}
示例14: createAddButton
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
private void createAddButton(Composite composite_11) {
btnAdd = new Button(composite_11, SWT.NONE);
btnAdd.setImage(ImagePathConstant.ADD_BUTTON.getImageFromRegistry());
btnAdd.setToolTipText(Messages.ADD_KEY_SHORTCUT_TOOLTIP);
btnAdd.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
addNewRow();
}
});
}
示例15: createTopComposite
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
private void createTopComposite(Composite main_composite) {
top_composite = new Composite(main_composite, SWT.NONE);
top_composite.setLayout(new GridLayout(4, false));
GridData gd_composite_1 = new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1);
gd_composite_1.heightHint = 45;
top_composite.setLayoutData(gd_composite_1);
Label applyAllLabel = new Label(top_composite, SWT.NONE);
applyAllLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
applyAllLabel.setText(Messages.REMAINING_FIELDS);
applyAllLabel.setToolTipText(Messages.REMAINING_FIELDS_TOOLTIP);
combo = new CCombo(top_composite, SWT.NONE);
GridData gd_combo = new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1);
gd_combo.widthHint = 143;
combo.setLayoutData(gd_combo);
draggedFields.add(0,"Select");
combo.setItems(convertToArray(draggedFields));
combo.select(0);
Composite composite_2 = new Composite(top_composite, SWT.NONE);
composite_2.setLayout(new GridLayout(3, false));
composite_2.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, true, true, 1, 1));
deleteButton = new Button(composite_2, SWT.NONE);
deleteButton.setLayoutData(new GridData(SWT.RIGHT, SWT.FILL, true, false, 1, 1));
deleteButton.setImage(ImagePathConstant.DELETE_BUTTON.getImageFromRegistry());
attachDeleteButtonListener(deleteButton);
deleteButton.setEnabled(false);
}