mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 01:36:01 +02:00
Improve dialog label, related to bug 144085.
This commit is contained in:
parent
f5a9e32708
commit
b3c11fe78f
3 changed files with 13 additions and 5 deletions
|
@ -65,6 +65,7 @@ public final class CUIMessages extends NLS {
|
||||||
public static String TextEditorDropAdapter_unreadableFile;
|
public static String TextEditorDropAdapter_unreadableFile;
|
||||||
public static String TextEditorDropAdapter_noFile;
|
public static String TextEditorDropAdapter_noFile;
|
||||||
public static String OptionalMessageDialog_dontShowAgain;
|
public static String OptionalMessageDialog_dontShowAgain;
|
||||||
|
public static String OptionalMessageDialog_rememberDecision;
|
||||||
public static String CStructureCreatorVisitor_translationUnitName;
|
public static String CStructureCreatorVisitor_translationUnitName;
|
||||||
public static String FileTransferDragAdapter_refreshing;
|
public static String FileTransferDragAdapter_refreshing;
|
||||||
public static String FileTransferDragAdapter_problem;
|
public static String FileTransferDragAdapter_problem;
|
||||||
|
|
|
@ -66,6 +66,7 @@ TextEditorDropAdapter_unreadableFile=Unreadable file: ''{0}''
|
||||||
TextEditorDropAdapter_noFile=Not a file: ''{0}''
|
TextEditorDropAdapter_noFile=Not a file: ''{0}''
|
||||||
|
|
||||||
OptionalMessageDialog_dontShowAgain= Do not show this &message again
|
OptionalMessageDialog_dontShowAgain= Do not show this &message again
|
||||||
|
OptionalMessageDialog_rememberDecision=Re&member my decision
|
||||||
CStructureCreatorVisitor_translationUnitName=Translation Unit
|
CStructureCreatorVisitor_translationUnitName=Translation Unit
|
||||||
|
|
||||||
FileTransferDragAdapter_refreshing=Refreshing...
|
FileTransferDragAdapter_refreshing=Refreshing...
|
||||||
|
|
|
@ -34,9 +34,6 @@ import org.eclipse.cdt.internal.ui.CUIMessages;
|
||||||
* to choose that the dialog isn't shown again the next time.
|
* to choose that the dialog isn't shown again the next time.
|
||||||
*/
|
*/
|
||||||
public class OptionalMessageDialog extends MessageDialog {
|
public class OptionalMessageDialog extends MessageDialog {
|
||||||
// String constants for widgets
|
|
||||||
private static final String CHECKBOX_TEXT= CUIMessages.OptionalMessageDialog_dontShowAgain;
|
|
||||||
|
|
||||||
// Dialog store id constants
|
// Dialog store id constants
|
||||||
private static final String STORE_ID= "OptionalMessageDialog.hide."; //$NON-NLS-1$
|
private static final String STORE_ID= "OptionalMessageDialog.hide."; //$NON-NLS-1$
|
||||||
private static final String KEY_DETAIL = ".detail"; //$NON-NLS-1$
|
private static final String KEY_DETAIL = ".detail"; //$NON-NLS-1$
|
||||||
|
@ -46,9 +43,10 @@ public class OptionalMessageDialog extends MessageDialog {
|
||||||
|
|
||||||
private Button fHideDialogCheckBox;
|
private Button fHideDialogCheckBox;
|
||||||
private String fId;
|
private String fId;
|
||||||
|
private String fHideMessage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Opens the dialog but only if the user hasn't choosen to hide it.
|
* Opens the dialog but only if the user hasn't chosen to hide it.
|
||||||
* Returns <code>NOT_SHOWN</code> if the dialog was not shown.
|
* Returns <code>NOT_SHOWN</code> if the dialog was not shown.
|
||||||
*/
|
*/
|
||||||
public static int open(String id, Shell parent, String title, Image titleImage, String message, int dialogType, String[] buttonLabels, int defaultButtonIndex) {
|
public static int open(String id, Shell parent, String title, Image titleImage, String message, int dialogType, String[] buttonLabels, int defaultButtonIndex) {
|
||||||
|
@ -62,6 +60,14 @@ public class OptionalMessageDialog extends MessageDialog {
|
||||||
protected OptionalMessageDialog(String id, Shell parent, String title, Image titleImage, String message, int dialogType, String[] buttonLabels, int defaultButtonIndex) {
|
protected OptionalMessageDialog(String id, Shell parent, String title, Image titleImage, String message, int dialogType, String[] buttonLabels, int defaultButtonIndex) {
|
||||||
super(parent, title, titleImage, message, dialogType, buttonLabels, defaultButtonIndex);
|
super(parent, title, titleImage, message, dialogType, buttonLabels, defaultButtonIndex);
|
||||||
fId= id;
|
fId= id;
|
||||||
|
switch(dialogType) {
|
||||||
|
case QUESTION:
|
||||||
|
case QUESTION_WITH_CANCEL:
|
||||||
|
fHideMessage= CUIMessages.OptionalMessageDialog_rememberDecision;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
fHideMessage= CUIMessages.OptionalMessageDialog_dontShowAgain;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -75,7 +81,7 @@ public class OptionalMessageDialog extends MessageDialog {
|
||||||
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
|
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
|
||||||
|
|
||||||
fHideDialogCheckBox= new Button(composite, SWT.CHECK | SWT.LEFT);
|
fHideDialogCheckBox= new Button(composite, SWT.CHECK | SWT.LEFT);
|
||||||
fHideDialogCheckBox.setText(CHECKBOX_TEXT);
|
fHideDialogCheckBox.setText(fHideMessage);
|
||||||
fHideDialogCheckBox.addSelectionListener(new SelectionAdapter() {
|
fHideDialogCheckBox.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue