mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-08 08:45:44 +02:00
[216596] determine whether to show yes/no or just okay
This commit is contained in:
parent
5b654c8a89
commit
bb87b76359
2 changed files with 26 additions and 4 deletions
|
@ -6,6 +6,7 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Michael Berger (IBM) - Initial API and implementation
|
||||
* David McKnight (IBM) - [216596] determine whether to show yes/no or just okay
|
||||
********************************************************************************/
|
||||
package org.eclipse.rse.ui.actions;
|
||||
|
||||
|
@ -20,12 +21,22 @@ public class DisplayHidableSystemMessageAction extends
|
|||
{
|
||||
protected IPreferenceStore _store;
|
||||
protected String _prefID;
|
||||
protected boolean _showYesNo = true;
|
||||
|
||||
public DisplayHidableSystemMessageAction(SystemMessage message, IPreferenceStore prefStore, String prefID)
|
||||
{
|
||||
super(message);
|
||||
_store = prefStore;
|
||||
_prefID = prefID;
|
||||
}
|
||||
|
||||
public DisplayHidableSystemMessageAction(SystemMessage message, IPreferenceStore prefStore, String prefID, boolean showYesNo)
|
||||
{
|
||||
super(message);
|
||||
_store = prefStore;
|
||||
_prefID = prefID;
|
||||
_showYesNo = showYesNo;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see Runnable#run()
|
||||
|
@ -38,10 +49,10 @@ public class DisplayHidableSystemMessageAction extends
|
|||
if (shells[loop].isEnabled() && shells[loop].isVisible()) {
|
||||
SystemMessageDialog dialog = new SystemMessageDialog(shells[loop], message);
|
||||
dialog.setNoShowAgainOption(true, _store, _prefID, false);
|
||||
dialog.openQuestionNoException();
|
||||
dialog.openQuestionNoException(_showYesNo);
|
||||
rc = dialog.getButtonPressedId();
|
||||
finished = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
* Martin Oberhuber (Wind River) - [183824] Forward SystemMessageException from IRemoteFileSubsystem
|
||||
* Martin Oberhuber (Wind River) - [187115] force SystemMessageDialog always into Display thread
|
||||
* Martin Oberhuber (Wind River) - [189272] exception when canceling ssh connect
|
||||
* David McKnight (IBM) - [216596] determine whether to show yes/no or just okay
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.messages;
|
||||
|
@ -443,13 +444,23 @@ public class SystemMessageDialog extends ErrorDialog implements Listener {
|
|||
open();
|
||||
return (buttonIdPressed==IDialogConstants.YES_ID);
|
||||
}
|
||||
|
||||
/**
|
||||
* opens the dialog with Yes, No, Details button for an Inquiry/Question message.
|
||||
* opens the dialog with Yes/No, Details button for an Inquiry/Question message.
|
||||
* Eats up the IndicatorException, so only call this when you know what you are doing!
|
||||
*/
|
||||
public boolean openQuestionNoException()
|
||||
{
|
||||
yesNoButtons=true;
|
||||
return openQuestionNoException(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* opens the dialog with an optional Yes/No or OK, Details button for an Inquiry/Question message.
|
||||
* Eats up the IndicatorException, so only call this when you know what you are doing!
|
||||
*/
|
||||
public boolean openQuestionNoException(boolean showYesNo)
|
||||
{
|
||||
yesNoButtons=showYesNo;
|
||||
open();
|
||||
return (buttonIdPressed==IDialogConstants.YES_ID);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue