本文整理匯總了Java中org.eclipse.jface.dialogs.MessageDialogWithToggle.open方法的典型用法代碼示例。如果您正苦於以下問題:Java MessageDialogWithToggle.open方法的具體用法?Java MessageDialogWithToggle.open怎麽用?Java MessageDialogWithToggle.open使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jface.dialogs.MessageDialogWithToggle
的用法示例。
在下文中一共展示了MessageDialogWithToggle.open方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: editEntryParallel
import org.eclipse.jface.dialogs.MessageDialogWithToggle; //導入方法依賴的package包/類
/**
* Go from serial to parallel to serial execution
*/
public void editEntryParallel() {
getJobEntry().setLaunchingInParallel(!getJobEntry().isLaunchingInParallel());
if (getJobEntry().isLaunchingInParallel()) {
// Show a warning (optional)
//
if ("Y".equalsIgnoreCase(spoon.props.getCustomParameter(STRING_PARALLEL_WARNING_PARAMETER, "Y"))) //$NON-NLS-1$ //$NON-NLS-2$
{
MessageDialogWithToggle md = new MessageDialogWithToggle(shell, Messages
.getString("JobGraph.ParallelJobEntriesWarning.DialogTitle"), //$NON-NLS-1$
null, Messages.getString("JobGraph.ParallelJobEntriesWarning.DialogMessage", Const.CR) + Const.CR, //$NON-NLS-1$ //$NON-NLS-2$
MessageDialog.WARNING, new String[] { Messages.getString("JobGraph.ParallelJobEntriesWarning.Option1") }, //$NON-NLS-1$
0, Messages.getString("JobGraph.ParallelJobEntriesWarning.Option2"), //$NON-NLS-1$
"N".equalsIgnoreCase(spoon.props.getCustomParameter(STRING_PARALLEL_WARNING_PARAMETER, "Y")) //$NON-NLS-1$ //$NON-NLS-2$
);
MessageDialogWithToggle.setDefaultImage(GUIResource.getInstance().getImageSpoon());
md.open();
spoon.props.setCustomParameter(STRING_PARALLEL_WARNING_PARAMETER, md.getToggleState() ? "N" : "Y"); //$NON-NLS-1$ //$NON-NLS-2$
spoon.props.saveProps();
}
}
redraw();
}
示例2: messageDialogWithToggle
import org.eclipse.jface.dialogs.MessageDialogWithToggle; //導入方法依賴的package包/類
/**
* Generic popup with a toggle option
*
* @param dialogTitle
* @param image
* @param message
* @param dialogImageType
* @param buttonLabels
* @param defaultIndex
* @param toggleMessage
* @param toggleState
* @return
*/
public Object[] messageDialogWithToggle(Shell shell, String dialogTitle, Image image, String message,
int dialogImageType, String buttonLabels[], int defaultIndex, String toggleMessage,
boolean toggleState)
{
int imageType = 0;
switch (dialogImageType)
{
case Const.WARNING:
imageType = MessageDialog.WARNING;
break;
}
MessageDialogWithToggle md = new MessageDialogWithToggle(shell, dialogTitle, image, message,
imageType, buttonLabels, defaultIndex, toggleMessage, toggleState);
int idx = md.open();
return new Object[] { Integer.valueOf(idx), Boolean.valueOf(md.getToggleState()) };
}
示例3: ok
import org.eclipse.jface.dialogs.MessageDialogWithToggle; //導入方法依賴的package包/類
private void ok()
{
if (Const.isEmpty(wStepname.getText())) return;
getMeta(joinMeta);
// Show a warning (optional)
if ( "Y".equalsIgnoreCase( props.getCustomParameter(STRING_SORT_WARNING_PARAMETER, "Y") )) //$NON-NLS-1$ //$NON-NLS-2$
{
MessageDialogWithToggle md = new MessageDialogWithToggle(shell,
BaseMessages.getString(PKG, "MultiMergeJoinDialog.InputNeedSort.DialogTitle"), //$NON-NLS-1$
null,
BaseMessages.getString(PKG, "MultiMergeJoinDialog.InputNeedSort.DialogMessage", Const.CR )+Const.CR, //$NON-NLS-1$ //$NON-NLS-2$
MessageDialog.WARNING,
new String[] { BaseMessages.getString(PKG, "MultiMergeJoinDialog.InputNeedSort.Option1") }, //$NON-NLS-1$
0,
BaseMessages.getString(PKG, "MultiMergeJoinDialog.InputNeedSort.Option2"), //$NON-NLS-1$
"N".equalsIgnoreCase( props.getCustomParameter(STRING_SORT_WARNING_PARAMETER, "Y") ) //$NON-NLS-1$ //$NON-NLS-2$
);
MessageDialogWithToggle.setDefaultImage(GUIResource.getInstance().getImageSpoon());
md.open();
props.setCustomParameter(STRING_SORT_WARNING_PARAMETER, md.getToggleState()?"N":"Y"); //$NON-NLS-1$ //$NON-NLS-2$
props.saveProps();
}
stepname = wStepname.getText(); // return value
dispose();
}
示例4: editEntryParallel
import org.eclipse.jface.dialogs.MessageDialogWithToggle; //導入方法依賴的package包/類
/**
* Go from serial to parallel to serial execution
*/
public void editEntryParallel() {
getJobEntry().setLaunchingInParallel(!getJobEntry().isLaunchingInParallel());
if (getJobEntry().isLaunchingInParallel()) {
// Show a warning (optional)
//
if ("Y".equalsIgnoreCase(spoon.props.getCustomParameter(STRING_PARALLEL_WARNING_PARAMETER, "Y"))) //$NON-NLS-1$ //$NON-NLS-2$
{
MessageDialogWithToggle md = new MessageDialogWithToggle(shell,
BaseMessages.getString(PKG, "JobGraph.ParallelJobEntriesWarning.DialogTitle"), //$NON-NLS-1$
null, BaseMessages.getString(PKG, "JobGraph.ParallelJobEntriesWarning.DialogMessage", Const.CR) + Const.CR, //$NON-NLS-1$ //$NON-NLS-2$
MessageDialog.WARNING, new String[] { BaseMessages.getString(PKG, "JobGraph.ParallelJobEntriesWarning.Option1") }, //$NON-NLS-1$
0, BaseMessages.getString(PKG, "JobGraph.ParallelJobEntriesWarning.Option2"), //$NON-NLS-1$
"N".equalsIgnoreCase(spoon.props.getCustomParameter(STRING_PARALLEL_WARNING_PARAMETER, "Y")) //$NON-NLS-1$ //$NON-NLS-2$
);
MessageDialogWithToggle.setDefaultImage(GUIResource.getInstance().getImageSpoon());
md.open();
spoon.props.setCustomParameter(STRING_PARALLEL_WARNING_PARAMETER, md.getToggleState() ? "N" : "Y"); //$NON-NLS-1$ //$NON-NLS-2$
spoon.props.saveProps();
}
}
redraw();
}
示例5: handleTransMetaChanges
import org.eclipse.jface.dialogs.MessageDialogWithToggle; //導入方法依賴的package包/類
public void handleTransMetaChanges(TransMeta transMeta) throws KettleException {
if (transMeta.hasChanged()) {
if (spoon.props.getAutoSave()) {
spoon.saveToFile(transMeta);
}
else {
MessageDialogWithToggle md = new MessageDialogWithToggle(
shell,
BaseMessages.getString(PKG, "TransLog.Dialog.FileHasChanged.Title"), //$NON-NLS-1$
null,
BaseMessages.getString(PKG, "TransLog.Dialog.FileHasChanged1.Message") + Const.CR + BaseMessages.getString(PKG, "TransLog.Dialog.FileHasChanged2.Message") + Const.CR, //$NON-NLS-1$ //$NON-NLS-2$
MessageDialog.QUESTION, new String[] {
BaseMessages.getString(PKG, "System.Button.Yes"), BaseMessages.getString(PKG, "System.Button.No") }, //$NON-NLS-1$ //$NON-NLS-2$
0, BaseMessages.getString(PKG, "TransLog.Dialog.Option.AutoSaveTransformation"), //$NON-NLS-1$
spoon.props.getAutoSave());
int answer = md.open();
if ((answer & 0xFF) == 0) {
spoon.saveToFile(transMeta);
}
spoon.props.setAutoSave(md.getToggleState());
}
}
}
示例6: showPaloLibWarningDialog
import org.eclipse.jface.dialogs.MessageDialogWithToggle; //導入方法依賴的package包/類
public static void showPaloLibWarningDialog(Shell shell) {
PropsUI props = PropsUI.getInstance();
if ("Y".equalsIgnoreCase(props.getCustomParameter(STRING_PALO_LIB_WARNING_PARAMETER, "Y"))) //$NON-NLS-1$ //$NON-NLS-2$
{
MessageDialogWithToggle md = new MessageDialogWithToggle(shell,
BaseMessages.getString(PKG, "PaloCellInputDialog.PaloLibWarningDialog.DialogTitle"), //$NON-NLS-1$
null,
BaseMessages.getString(PKG, "PaloCellInputDialog.PaloLibWarningDialog.DialogMessage", Const.CR) + Const.CR, //$NON-NLS-1$ //$NON-NLS-2$
MessageDialog.WARNING, new String[] {
BaseMessages.getString(PKG, "PaloCellInputDialog.PaloLibWarningDialog.Option1") }, //$NON-NLS-1$
0,
BaseMessages.getString(PKG, "PaloCellInputDialog.PaloLibWarningDialog.Option2"), //$NON-NLS-1$
"N".equalsIgnoreCase(props.getCustomParameter(STRING_PALO_LIB_WARNING_PARAMETER, "Y")) //$NON-NLS-1$ //$NON-NLS-2$
);
MessageDialogWithToggle.setDefaultImage(GUIResource.getInstance().getImageSpoon());
md.open();
props.setCustomParameter(STRING_PALO_LIB_WARNING_PARAMETER, md.getToggleState() ? "N" : "Y"); //$NON-NLS-1$ //$NON-NLS-2$
props.saveProps();
}
}
示例7: messageDialogWithToggle
import org.eclipse.jface.dialogs.MessageDialogWithToggle; //導入方法依賴的package包/類
/**
* Generic popup with a toggle option
*
* @param dialogTitle
* @param image
* @param message
* @param dialogImageType
* @param buttonLabels
* @param defaultIndex
* @param toggleMessage
* @param toggleState
* @return
*/
public Object[] messageDialogWithToggle( Shell shell, String dialogTitle, Image image, String message,
int dialogImageType, String[] buttonLabels, int defaultIndex,
String toggleMessage, boolean toggleState ) {
int imageType = 0;
switch ( dialogImageType ) {
case Const.WARNING:
imageType = MessageDialog.WARNING;
break;
default:
break;
}
MessageDialogWithToggle md =
new MessageDialogWithToggle( shell, dialogTitle, image, message, imageType, buttonLabels, defaultIndex,
toggleMessage, toggleState );
int idx = md.open();
return new Object[] { Integer.valueOf( idx ), Boolean.valueOf( md.getToggleState() ) };
}
示例8: transOverwritePrompt
import org.eclipse.jface.dialogs.MessageDialogWithToggle; //導入方法依賴的package包/類
public boolean transOverwritePrompt( TransMeta transMeta ) {
MessageDialogWithToggle md = new MessageDialogWithToggle( shell,
BaseMessages.getString( PKG, "RepositoryImportDialog.OverwriteTrans.Title" ),
null,
BaseMessages.getString( PKG, "RepositoryImportDialog.OverwriteTrans.Message", transMeta.getName() ),
MessageDialog.QUESTION, new String[] {
BaseMessages.getString( PKG, "System.Button.Yes" ),
BaseMessages.getString( PKG, "System.Button.No" ) },
1,
BaseMessages.getString( PKG, "RepositoryImportDialog.DontAskAgain.Label" ), !askOverwrite );
MessageDialogWithToggle.setDefaultImage( GUIResource.getInstance().getImageSpoon() );
int answer = md.open();
askOverwrite = !md.getToggleState();
return ( answer & 0xFF ) == 0;
}
示例9: showPaloLibWarningDialog
import org.eclipse.jface.dialogs.MessageDialogWithToggle; //導入方法依賴的package包/類
public static void showPaloLibWarningDialog( Shell shell ) {
PropsUI props = PropsUI.getInstance();
if ( "Y".equalsIgnoreCase( props.getCustomParameter( STRING_PALO_LIB_WARNING_PARAMETER, "Y" ) ) ) {
MessageDialogWithToggle md =
new MessageDialogWithToggle(
shell,
BaseMessages.getString( PKG, "PaloCellInputDialog.PaloLibWarningDialog.DialogTitle" ),
null,
BaseMessages.getString( PKG, "PaloCellInputDialog.PaloLibWarningDialog.DialogMessage", Const.CR )
+ Const.CR,
MessageDialog.WARNING,
new String[]{ BaseMessages.getString( PKG, "PaloCellInputDialog.PaloLibWarningDialog.Option1" ) },
0,
BaseMessages.getString( PKG, "PaloCellInputDialog.PaloLibWarningDialog.Option2" ),
"N".equalsIgnoreCase( props.getCustomParameter( STRING_PALO_LIB_WARNING_PARAMETER, "Y" )
)
);
MessageDialogWithToggle.setDefaultImage( GUIResource.getInstance().getImageSpoon() );
md.open();
props.setCustomParameter( STRING_PALO_LIB_WARNING_PARAMETER, md.getToggleState() ? "N" : "Y" );
props.saveProps();
}
}
示例10: ok
import org.eclipse.jface.dialogs.MessageDialogWithToggle; //導入方法依賴的package包/類
private void ok() {
if ( Utils.isEmpty( wStepname.getText() ) ) {
return;
}
getMeta( joinMeta );
// Show a warning (optional)
if ( "Y".equalsIgnoreCase( props.getCustomParameter( STRING_SORT_WARNING_PARAMETER, "Y" ) ) ) {
MessageDialogWithToggle md =
new MessageDialogWithToggle( shell,
BaseMessages.getString( PKG, "MultiMergeJoinDialog.InputNeedSort.DialogTitle" ),
null,
BaseMessages.getString( PKG, "MultiMergeJoinDialog.InputNeedSort.DialogMessage", Const.CR ) + Const.CR,
MessageDialog.WARNING,
new String[] { BaseMessages.getString( PKG, "MultiMergeJoinDialog.InputNeedSort.Option1" ) },
0,
BaseMessages.getString( PKG, "MultiMergeJoinDialog.InputNeedSort.Option2" ),
"N".equalsIgnoreCase( props.getCustomParameter( STRING_SORT_WARNING_PARAMETER, "Y" ) ) );
MessageDialogWithToggle.setDefaultImage( GUIResource.getInstance().getImageSpoon() );
md.open();
props.setCustomParameter( STRING_SORT_WARNING_PARAMETER, md.getToggleState() ? "N" : "Y" );
props.saveProps();
}
stepname = wStepname.getText(); // return value
dispose();
}
示例11: showMessageDialogWithToggle
import org.eclipse.jface.dialogs.MessageDialogWithToggle; //導入方法依賴的package包/類
public static Pair<Integer, Boolean> showMessageDialogWithToggle(Shell shell, String title, String message,
String toggleMessage, boolean toggleState, int style, String... buttons) {
MessageDialogWithToggle dialog = new MessageDialogWithToggle(shell, title, null, message, style, buttons, 0, toggleMessage, toggleState);
int answer = dialog.open();
return Pair.of(answer, dialog.getToggleState());
}
示例12: shouldCancelBecauseOfRunningLaunches
import org.eclipse.jface.dialogs.MessageDialogWithToggle; //導入方法依賴的package包/類
private boolean shouldCancelBecauseOfRunningLaunches() {
if (mode == MODE_CHECKOUT)
return false;
IPreferenceStore store = Activator.getDefault().getPreferenceStore();
if (!store
.getBoolean(UIPreferences.SHOW_RUNNING_LAUNCH_ON_CHECKOUT_WARNING))
return false;
ILaunchConfiguration launchConfiguration = getRunningLaunchConfiguration();
if (launchConfiguration != null) {
String[] buttons = new String[] {
UIText.BranchOperationUI_Continue,
IDialogConstants.CANCEL_LABEL };
String message = NLS.bind(UIText.BranchOperationUI_RunningLaunchMessage,
launchConfiguration.getName());
MessageDialogWithToggle continueDialog = new MessageDialogWithToggle(
getShell(), UIText.BranchOperationUI_RunningLaunchTitle,
null, message, MessageDialog.NONE, buttons, 0,
UIText.BranchOperationUI_RunningLaunchDontShowAgain, false);
int result = continueDialog.open();
// cancel
if (result == IDialogConstants.CANCEL_ID || result == SWT.DEFAULT)
return true;
boolean dontWarnAgain = continueDialog.getToggleState();
if (dontWarnAgain)
store.setValue(
UIPreferences.SHOW_RUNNING_LAUNCH_ON_CHECKOUT_WARNING,
false);
}
return false;
}
示例13: handleFileError
import org.eclipse.jface.dialogs.MessageDialogWithToggle; //導入方法依賴的package包/類
private Boolean handleFileError(IFile file) {
String launchAlways = DbgActivator.getDefault().getPreferenceStore().getString(PreferenceInitializer.CONTINUE_LAUNCH_WITH_FILE_ERRORS);
if (MessageDialogWithToggle.ALWAYS.equals(launchAlways)) {
return true;
}
String message = "Errors in File: " + file.getName() + "\n\nProceed with launch?";
MessageDialogWithToggle dialog = new MessageDialogWithToggle (
Display.getCurrent().getActiveShell(),
"Errors in File",
null,
message,
MessageDialog.QUESTION, new String[]{IDialogConstants.PROCEED_LABEL, IDialogConstants.CANCEL_LABEL},
0,
"Always launch with file errors",
false);
int result = dialog.open();
if (result == IDialogConstants.PROCEED_ID) {
if (dialog.getToggleState()) {
DbgActivator.getDefault().getPreferenceStore().setValue(PreferenceInitializer.CONTINUE_LAUNCH_WITH_FILE_ERRORS, MessageDialogWithToggle.ALWAYS);
}
return true;
}
else {
return false;
}
}
示例14: ok
import org.eclipse.jface.dialogs.MessageDialogWithToggle; //導入方法依賴的package包/類
private void ok()
{
if (Const.isEmpty(wStepname.getText())) return;
getMeta(input);
// Show a warning (optional)
//
if ( "Y".equalsIgnoreCase( props.getCustomParameter(STRING_SORT_WARNING_PARAMETER, "Y") )) //$NON-NLS-1$ //$NON-NLS-2$
{
MessageDialogWithToggle md = new MessageDialogWithToggle(shell,
Messages.getString("MergeJoinDialog.InputNeedSort.DialogTitle"), //$NON-NLS-1$
null,
Messages.getString("MergeJoinDialog.InputNeedSort.DialogMessage", Const.CR )+Const.CR, //$NON-NLS-1$ //$NON-NLS-2$
MessageDialog.WARNING,
new String[] { Messages.getString("MergeJoinDialog.InputNeedSort.Option1") }, //$NON-NLS-1$
0,
Messages.getString("MergeJoinDialog.InputNeedSort.Option2"), //$NON-NLS-1$
"N".equalsIgnoreCase( props.getCustomParameter(STRING_SORT_WARNING_PARAMETER, "Y") ) //$NON-NLS-1$ //$NON-NLS-2$
);
MessageDialogWithToggle.setDefaultImage(GUIResource.getInstance().getImageSpoon());
md.open();
props.setCustomParameter(STRING_SORT_WARNING_PARAMETER, md.getToggleState()?"N":"Y"); //$NON-NLS-1$ //$NON-NLS-2$
props.saveProps();
}
stepname = wStepname.getText(); // return value
dispose();
}
示例15: ok
import org.eclipse.jface.dialogs.MessageDialogWithToggle; //導入方法依賴的package包/類
private void ok()
{
if (Const.isEmpty(wStepname.getText())) return;
int nrfields = wFields.nrNonEmpty();
input.allocate(nrfields);
for (int i=0;i<nrfields;i++)
{
TableItem item = wFields.getNonEmpty(i);
input.getCompareFields()[i] = item.getText(1);
input.getCaseInsensitive()[i] = "Y".equalsIgnoreCase(item.getText(2)); //$NON-NLS-1$
}
input.setCountField(wCountField.getText());
input.setCountRows( wCount.getSelection() );
stepname = wStepname.getText(); // return value
if ( "Y".equalsIgnoreCase( props.getCustomParameter(STRING_SORT_WARNING_PARAMETER, "Y") )) //$NON-NLS-1$ //$NON-NLS-2$
{
MessageDialogWithToggle md = new MessageDialogWithToggle(shell,
Messages.getString("UniqueRowsDialog.InputNeedSort.DialogTitle"), //$NON-NLS-1$
null,
Messages.getString("UniqueRowsDialog.InputNeedSort.DialogMessage", Const.CR )+Const.CR, //$NON-NLS-1$ //$NON-NLS-2$
MessageDialog.WARNING,
new String[] { Messages.getString("UniqueRowsDialog.InputNeedSort.Option1") }, //$NON-NLS-1$
0,
Messages.getString("UniqueRowsDialog.InputNeedSort.Option2"), //$NON-NLS-1$
"N".equalsIgnoreCase( props.getCustomParameter(STRING_SORT_WARNING_PARAMETER, "Y") ) //$NON-NLS-1$ //$NON-NLS-2$
);
MessageDialogWithToggle.setDefaultImage(GUIResource.getInstance().getImageSpoon());
md.open();
props.setCustomParameter(STRING_SORT_WARNING_PARAMETER, md.getToggleState()?"N":"Y"); //$NON-NLS-1$ //$NON-NLS-2$
props.saveProps();
}
dispose();
}