本文整理汇总了Java中org.eclipse.swt.widgets.Button.getShell方法的典型用法代码示例。如果您正苦于以下问题:Java Button.getShell方法的具体用法?Java Button.getShell怎么用?Java Button.getShell使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.widgets.Button
的用法示例。
在下文中一共展示了Button.getShell方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: importSchema
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
private void importSchema(Button importButton) {
GenericImportExportFileDialog importFileDialog = new GenericImportExportFileDialog(
importButton.getShell(), SWT.OPEN);
importFileDialog.setFileName(StringUtils.EMPTY);
importFileDialog.setTitle(Messages.IMPORT_SCHEMA_DIALOG_TITLE);
importFileDialog.setFilterNames(new String[] { IMPORT_SCHEMA_FILE_EXTENSION_NAME });
importFileDialog.setFilterExtensions(new String[] { IMPORT_SCHEMA_FILE_EXTENSION_FILTER });
String filePath = importFileDialog.open();
if (StringUtils.isNotBlank(filePath)) {
File schemaFile = new File(filePath);
if (schemaFile == null || !schemaFile.exists()){
return;
}
loadSchemaIntoTable(schemaFile);
setSchemaUpdated(true);
propertyDialogButtonBar.enableApplyButton(true);
}
}
示例2: exportSchemaIntoFile
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
private void exportSchemaIntoFile(Button exportButton) {
GenericImportExportFileDialog exportFileDialog = new GenericImportExportFileDialog(
exportButton.getShell(), SWT.SAVE);
exportFileDialog.setTitle(Messages.EXPORT_SCHEMA_DIALOG_TITLE);
exportFileDialog.setFilterExtensions(new String[] { EXPORT_XML_FILE_EXTENSION_FILTER, EXPORT_SCHEMA_FILE_EXTENSION_FILTER });
String filePath = exportFileDialog.open();
if (StringUtils.isNotBlank(filePath)) {
File schemaFile = new File(filePath);
if (schemaFile != null) {
if (!isSchemaValid) {
if (WidgetUtility.createMessageBox(Messages.SCHEMA_IS_INVALID_DO_YOU_WISH_TO_CONTINUE,
Messages.EXPORT_SCHEMA, SWT.ICON_QUESTION | SWT.YES | SWT.NO) == SWT.YES) {
exportSchema(schemaFile);
}
} else {
exportSchema(schemaFile);
}
}
}
}
示例3: getListener
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
@Override
public Listener getListener(final PropertyDialogButtonBar propertyDialogButtonBar,
ListenerHelper helpers, final Widget... widgets) {
final Button button = ((Button)widgets[0]);
button.getShell();
if(helpers != null){
txtDecorator = (ControlDecoration) helpers.get(HelperType.CONTROL_DECORATION);
file_extension=(String)helpers.get(HelperType.FILE_EXTENSION);
}
Listener listener=new Listener() {
@Override
public void handleEvent(Event event) {
if(event.type==SWT.Selection){
FilterOperationClassUtility.INSTANCE.browseFile(file_extension,((Text) widgets[0]));
propertyDialogButtonBar.enableApplyButton(true);
txtDecorator.hide();
}
}
};
return listener;
}
示例4: getListener
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
@Override
public Listener getListener(final PropertyDialogButtonBar propertyDialogButtonBar, ListenerHelper helpers,
final Widget... widgets) {
final Button button = ((Button) widgets[0]);
button.getShell();
if (helpers != null) {
txtDecorator = (ControlDecoration) helpers.get(HelperType.CONTROL_DECORATION);
}
Listener listener = new Listener() {
@Override
public void handleEvent(Event event) {
LOGGER.debug("Launching Directory Dialog for selecting directory path");
if (event.type == SWT.Selection) {
String path = null;
DirectoryDialog filedialog = new DirectoryDialog(button.getShell(), SWT.None);
filedialog.setFilterPath(((Text) widgets[1]).getText());
path=filedialog.open();
if (StringUtils.isNotEmpty(path)) {
((Text) widgets[1]).setText(path);
propertyDialogButtonBar.enableApplyButton(true);
txtDecorator.hide();
}
}
}
};
return listener;
}