本文整理汇总了Java中org.eclipse.jface.dialogs.IDialogConstants类的典型用法代码示例。如果您正苦于以下问题:Java IDialogConstants类的具体用法?Java IDialogConstants怎么用?Java IDialogConstants使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IDialogConstants类属于org.eclipse.jface.dialogs包,在下文中一共展示了IDialogConstants类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createButtonsForButtonBar
import org.eclipse.jface.dialogs.IDialogConstants; //导入依赖的package包/类
@Override
protected void createButtonsForButtonBar(Composite parent) {
super.createButtonsForButtonBar(parent);
Button ok = getButton(IDialogConstants.OK_ID);
ok.setText("Create");
ok.setEnabled(false);
setButtonLayoutData(ok);
Button cancel = getButton(IDialogConstants.CANCEL_ID);
cancel.setText("Cancel");
setButtonLayoutData(cancel);
cancel.addListener(SWT.Selection, e -> {
function.setFunctionName(null);
function.setPackageName(null);
});
}
示例2: createButtonsForButtonBar
import org.eclipse.jface.dialogs.IDialogConstants; //导入依赖的package包/类
@Override
protected void createButtonsForButtonBar(Composite parent) {
super.createButtonsForButtonBar(parent);
Button ok = getButton(IDialogConstants.OK_ID);
ok.setText("Apply");
ok.setEnabled(false);
setButtonLayoutData(ok);
Button cancel = getButton(IDialogConstants.CANCEL_ID);
cancel.setText("Cancel");
setButtonLayoutData(cancel);
cancel.addListener(SWT.Selection, e -> {
if (futureTask != null && ! futureTask.isDone()) {
futureTask.cancel(true);
}
code.setFunctionName(null);
code.setFunctionGivenName(null);
code.setResultType(null);
code.setReturnedType(null);
});
}
示例3: redrawTables
import org.eclipse.jface.dialogs.IDialogConstants; //导入依赖的package包/类
private void redrawTables() {
Table sourceTable = sourceTableViewer.getTable();
sourceTable.setRedraw(false);
clean(sourceTable);
source.sort(Plugin::compareTo);
sourceTableViewer.setInput(source);
btnSelectAll.setEnabled(source.size() > 0);
sourceTable.setRedraw(true);
checkSelection(sourceTable);
Table targetTable = targetTableViewer.getTable();
targetTable.setRedraw(false);
clean(targetTable);
target.sort(Plugin::compareTo);
targetTableViewer.setInput(target);
btnDeselectAll.setEnabled(target.size() > 0);
targetTable.setRedraw(true);
checkSelection(targetTable);
if (getButton(IDialogConstants.OK_ID) != null) {
getButton(IDialogConstants.OK_ID).setEnabled(! targetOriginal.equals(target));
}
}
示例4: createButtonBar
import org.eclipse.jface.dialogs.IDialogConstants; //导入依赖的package包/类
@Override
protected Control createButtonBar(Composite parent) {
final Composite buttonBar = new Composite(parent, SWT.NONE);
buttonBar.setBackground(backColor);
final GridLayout layout = new GridLayout();
layout.marginLeft = 10;
layout.numColumns = 2;
layout.makeColumnsEqualWidth = false;
layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
buttonBar.setLayout(layout);
final GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false);
data.grabExcessHorizontalSpace = true;
data.grabExcessVerticalSpace = false;
buttonBar.setLayoutData(data);
buttonBar.setFont(parent.getFont());
// add the dialog's button bar to the right
buttonControl = super.createButtonBar(buttonBar);
buttonControl.setBackground(backColor);
buttonControl.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false));
return buttonBar;
}
示例5: createButtonsForButtonBar
import org.eclipse.jface.dialogs.IDialogConstants; //导入依赖的package包/类
@Override
protected void createButtonsForButtonBar(Composite parent) {
super.createButtonsForButtonBar(parent);
Button ok = getButton(IDialogConstants.OK_ID);
ok.setText("Apply");
ok.setEnabled(false);
setButtonLayoutData(ok);
Button cancel = getButton(IDialogConstants.CANCEL_ID);
cancel.setText("Cancel");
setButtonLayoutData(cancel);
cancel.addListener(SWT.Selection, e -> {
if (futureTask != null && ! futureTask.isDone()) {
futureTask.cancel(true);
}
credentials.setApplication(null);
});
}
示例6: chooseWorkspace
import org.eclipse.jface.dialogs.IDialogConstants; //导入依赖的package包/类
protected void chooseWorkspace ()
{
final ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog ( getShell (), new WorkbenchLabelProvider (), new WorkbenchContentProvider () );
dialog.setTitle ( "Select driver exporter configuration file" );
dialog.setMessage ( "Choose a driver exporter file for the configuration" );
dialog.setInput ( ResourcesPlugin.getWorkspace ().getRoot () );
dialog.setComparator ( new ResourceComparator ( ResourceComparator.NAME ) );
dialog.setAllowMultiple ( true );
dialog.setDialogBoundsSettings ( getDialogBoundsSettings ( HiveTab.WORKSPACE_SELECTION_DIALOG ), Dialog.DIALOG_PERSISTSIZE );
if ( dialog.open () == IDialogConstants.OK_ID )
{
final IResource resource = (IResource)dialog.getFirstResult ();
if ( resource != null )
{
final String arg = resource.getFullPath ().toString ();
final String fileLoc = VariablesPlugin.getDefault ().getStringVariableManager ().generateVariableExpression ( "workspace_loc", arg ); //$NON-NLS-1$
this.fileText.setText ( fileLoc );
makeDirty ();
}
}
}
示例7: okPressed
import org.eclipse.jface.dialogs.IDialogConstants; //导入依赖的package包/类
@Override
protected void okPressed() {
try {
getButton(IDialogConstants.OK_ID).setEnabled(false);
getButton(IDialogConstants.CANCEL_ID).setEnabled(false);
if (schemaObjectsDialogComposite != null) {
qname = (QName)schemaObjectsDialogComposite.getValue(null);
}
Thread thread = new Thread(this);
thread.start();
}
catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to import objects");
}
finally {
getButton(IDialogConstants.OK_ID).setEnabled(true);
getButton(IDialogConstants.CANCEL_ID).setEnabled(true);
}
}
示例8: okPressed
import org.eclipse.jface.dialogs.IDialogConstants; //导入依赖的package包/类
@Override
protected void okPressed() {
try {
getButton(IDialogConstants.OK_ID).setEnabled(false);
getButton(IDialogConstants.CANCEL_ID).setEnabled(false);
if (schemaObjectsDialogComposite != null) {
xml = (String)schemaObjectsDialogComposite.getValue(null);
}
Thread thread = new Thread(this);
thread.start();
}
catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to import objects");
}
finally {
getButton(IDialogConstants.OK_ID).setEnabled(true);
getButton(IDialogConstants.CANCEL_ID).setEnabled(true);
}
}
示例9: initGridLayout
import org.eclipse.jface.dialogs.IDialogConstants; //导入依赖的package包/类
private GridLayout initGridLayout(GridLayout layout, boolean margins)
{
layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
if( margins )
{
layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
}
else
{
layout.marginWidth = 0;
layout.marginHeight = 0;
}
return layout;
}
示例10: createButtonsForButtonBar
import org.eclipse.jface.dialogs.IDialogConstants; //导入依赖的package包/类
@Override
protected void createButtonsForButtonBar(Composite parent) {
createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
Button btnReset = createButton(parent, IDialogConstants.NO_ID, Messages.FilterDialog_reset, false);
createButton(parent, IDialogConstants.CANCEL_ID, Messages.FilterDialog_cancel, false);
btnReset.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
text.setText(""); //$NON-NLS-1$
btnRegEx.setSelection(false);
objViewer.setAllChecked(false);
chgViewer.setAllChecked(false);
}
});
}
示例11: buttonPressed
import org.eclipse.jface.dialogs.IDialogConstants; //导入依赖的package包/类
protected void buttonPressed(int buttonId) {
if (IDialogConstants.OK_ID == buttonId) {
okPressed();
} else if (IDialogConstants.CANCEL_ID == buttonId) {
cancelPressed();
} else if (UPDATE_ID == buttonId) {
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
try {
propEditor.updatePropertyBrowser();
treeViewer.setInput(XmlReader.loadXmlReader(path));
} catch (Exception e) {
e.printStackTrace();
// TODO: handle exception
} finally {
treeViewer.refresh();
}
}
});
}
}
示例12: setErrorMessage
import org.eclipse.jface.dialogs.IDialogConstants; //导入依赖的package包/类
/**
* Sets or clears the error message.
* If not <code>null</code>, the OK button is disabled.
*
* @param errorMessage
* the error message, or <code>null</code> to clear
* @since 3.0
*/
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
if (errorMessageText != null && !errorMessageText.isDisposed()) {
errorMessageText.setText(errorMessage == null ? " \n " : errorMessage); //$NON-NLS-1$
// Disable the error message text control if there is no error, or
// no error text (empty or whitespace only). Hide it also to avoid
// color change.
// See https://bugs.eclipse.org/bugs/show_bug.cgi?id=130281
boolean hasError = errorMessage != null && (StringConverter.removeWhiteSpaces(errorMessage)).length() > 0;
errorMessageText.setEnabled(hasError);
errorMessageText.setVisible(hasError);
errorMessageText.getParent().update();
// Access the ok button by id, in case clients have overridden button creation.
// See https://bugs.eclipse.org/bugs/show_bug.cgi?id=113643
Control button = getButton(IDialogConstants.OK_ID);
if (button != null) {
button.setEnabled(errorMessage == null);
}
}
}
示例13: createButtonBar
import org.eclipse.jface.dialogs.IDialogConstants; //导入依赖的package包/类
@Override
protected Control createButtonBar(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
// create a layout with spacing and margins appropriate for the font
// size.
GridLayout layout = new GridLayout();
layout.numColumns = 0; // this is incremented by createButton
layout.makeColumnsEqualWidth = true;
layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN );
layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN - 4);
layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING -2);
composite.setLayout(layout);
GridData data = new GridData(GridData.HORIZONTAL_ALIGN_END
| GridData.VERTICAL_ALIGN_CENTER);
composite.setLayoutData(data);
composite.setFont(parent.getFont());
// Add the buttons to the button bar.
createButtonsForButtonBar(composite);
return composite;
}
示例14: browseXMLSelectionDialog
import org.eclipse.jface.dialogs.IDialogConstants; //导入依赖的package包/类
/**
* @param filterExtension
* @param fileName
* Open the dialog to browse .xml file for expression, operation or outputfields
*/
private void browseXMLSelectionDialog(String filterExtension, Text fileName) {
String externalSchemaTextBoxValue = "";
ExternalSchemaFileSelectionDialog dialog = new ExternalSchemaFileSelectionDialog("Project",
"Select Input File (.xml)", new String[]{filterExtension,Extensions.XML.toString()}, this);
if (dialog.open() == IDialogConstants.OK_ID) {
String file = fileNameTextBoxValue;
IResource resource = (IResource) dialog.getFirstResult();
String path[] = resource.getFullPath().toString().split("/");
if (file.isEmpty()) {
for (int i = 1; i < path.length; i++) {
externalSchemaTextBoxValue = externalSchemaTextBoxValue + path[i] + "/";
}
} else {
for (int i = 1; i < path.length; i++) {
if (!path[i].endsWith(".xml")) {
externalSchemaTextBoxValue = externalSchemaTextBoxValue + path[i] + "/";
}
}
externalSchemaTextBoxValue = externalSchemaTextBoxValue + file;
}
fileName.setText(externalSchemaTextBoxValue);
}
}
示例15: createButtonsForButtonBar
import org.eclipse.jface.dialogs.IDialogConstants; //导入依赖的package包/类
@Override
protected void createButtonsForButtonBar(Composite parent) {
fBackButton = createButton(parent, IDialogConstants.BACK_ID, IDialogConstants.BACK_LABEL, false);
// XXX: Workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=279425
boolean HAS_BUG_279425 = true;
fNextButton = createButton(parent, IDialogConstants.NEXT_ID, IDialogConstants.NEXT_LABEL, !HAS_BUG_279425);
fFinishButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.FINISH_LABEL, HAS_BUG_279425);
createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}