mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-18 13:45:45 +02:00
[197937] [ui compliance] RSE Wizards needs to show erros within the standard wizard dialog message area
This commit is contained in:
parent
bb7750de47
commit
805de3df45
2 changed files with 68 additions and 82 deletions
|
@ -23,7 +23,6 @@ import org.eclipse.rse.ui.Mnemonics;
|
||||||
import org.eclipse.rse.ui.RSEUIPlugin;
|
import org.eclipse.rse.ui.RSEUIPlugin;
|
||||||
import org.eclipse.rse.ui.SystemWidgetHelpers;
|
import org.eclipse.rse.ui.SystemWidgetHelpers;
|
||||||
import org.eclipse.rse.ui.messages.ISystemMessageLine;
|
import org.eclipse.rse.ui.messages.ISystemMessageLine;
|
||||||
import org.eclipse.rse.ui.messages.SystemMessageLine;
|
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
import org.eclipse.swt.layout.GridData;
|
import org.eclipse.swt.layout.GridData;
|
||||||
import org.eclipse.swt.layout.GridLayout;
|
import org.eclipse.swt.layout.GridLayout;
|
||||||
|
@ -95,7 +94,7 @@ public abstract class AbstractSystemWizardPage
|
||||||
{
|
{
|
||||||
// state
|
// state
|
||||||
private Object input;
|
private Object input;
|
||||||
private SystemMessageLine msgLine;
|
private RSEDialogPageMessageLine msgLine;
|
||||||
private String helpId;
|
private String helpId;
|
||||||
private Composite parentComposite;
|
private Composite parentComposite;
|
||||||
private SystemMessage pendingMessage, pendingErrorMessage;
|
private SystemMessage pendingMessage, pendingErrorMessage;
|
||||||
|
@ -268,14 +267,11 @@ public abstract class AbstractSystemWizardPage
|
||||||
Mnemonics ms = new Mnemonics();
|
Mnemonics ms = new Mnemonics();
|
||||||
ms.setMnemonic((Button)c);
|
ms.setMnemonic((Button)c);
|
||||||
}
|
}
|
||||||
// dwd configureMessageLine();
|
|
||||||
msgLine = new SystemMessageLine(myComposite);
|
msgLine = new RSEDialogPageMessageLine(this);
|
||||||
msgLine.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
|
if (pendingMessage != null) setMessage(pendingMessage);
|
||||||
if (pendingMessage!=null)
|
if (pendingErrorMessage != null) setErrorMessage(pendingErrorMessage);
|
||||||
setMessage(pendingMessage);
|
|
||||||
if (pendingErrorMessage!=null)
|
|
||||||
setErrorMessage(pendingErrorMessage);
|
|
||||||
// dwd setControl(c);
|
|
||||||
setControl(myComposite);
|
setControl(myComposite);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -306,10 +302,8 @@ public abstract class AbstractSystemWizardPage
|
||||||
// ISystemMessageLine methods...
|
// ISystemMessageLine methods...
|
||||||
// -----------------------------
|
// -----------------------------
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* ISystemMessageLine method. <br>
|
* @see org.eclipse.rse.ui.messages.ISystemMessageLine#clearErrorMessage()
|
||||||
* Clears the currently displayed error message and redisplayes
|
|
||||||
* the message which was active before the error message was set.
|
|
||||||
*/
|
*/
|
||||||
public void clearErrorMessage()
|
public void clearErrorMessage()
|
||||||
{
|
{
|
||||||
|
@ -317,9 +311,8 @@ public abstract class AbstractSystemWizardPage
|
||||||
msgLine.clearErrorMessage();
|
msgLine.clearErrorMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* ISystemMessageLine method. <br>
|
* @see org.eclipse.rse.ui.messages.ISystemMessageLine#clearMessage()
|
||||||
* Clears the currently displayed message.
|
|
||||||
*/
|
*/
|
||||||
public void clearMessage()
|
public void clearMessage()
|
||||||
{
|
{
|
||||||
|
@ -327,10 +320,8 @@ public abstract class AbstractSystemWizardPage
|
||||||
msgLine.clearMessage();
|
msgLine.clearMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* ISystemMessageLine method. <br>
|
* @see org.eclipse.rse.ui.messages.ISystemMessageLine#getSystemErrorMessage()
|
||||||
* Get the currently displayed error text.
|
|
||||||
* @return The error message. If no error message is displayed <code>null</code> is returned.
|
|
||||||
*/
|
*/
|
||||||
public SystemMessage getSystemErrorMessage()
|
public SystemMessage getSystemErrorMessage()
|
||||||
{
|
{
|
||||||
|
@ -340,10 +331,8 @@ public abstract class AbstractSystemWizardPage
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* ISystemMessageLine method. <br>
|
* @see org.eclipse.rse.ui.messages.ISystemMessageLine#setErrorMessage(org.eclipse.rse.services.clientserver.messages.SystemMessage)
|
||||||
* Display the given error message. A currently displayed message
|
|
||||||
* is saved and will be redisplayed when the error message is cleared.
|
|
||||||
*/
|
*/
|
||||||
public void setErrorMessage(SystemMessage message)
|
public void setErrorMessage(SystemMessage message)
|
||||||
{
|
{
|
||||||
|
@ -357,9 +346,9 @@ public abstract class AbstractSystemWizardPage
|
||||||
else // not configured yet
|
else // not configured yet
|
||||||
pendingErrorMessage = message;
|
pendingErrorMessage = message;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* ISystemMessageLine method. <br>
|
/* (non-Javadoc)
|
||||||
* Convenience method to set an error message from an exception
|
* @see org.eclipse.rse.ui.messages.ISystemMessageLine#setErrorMessage(java.lang.Throwable)
|
||||||
*/
|
*/
|
||||||
public void setErrorMessage(Throwable exc)
|
public void setErrorMessage(Throwable exc)
|
||||||
{
|
{
|
||||||
|
@ -372,24 +361,9 @@ public abstract class AbstractSystemWizardPage
|
||||||
pendingErrorMessage = msg;
|
pendingErrorMessage = msg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* ISystemMessageLine method. <br>
|
|
||||||
* Display the given error message. A currently displayed message
|
|
||||||
* is saved and will be redisplayed when the error message is cleared.
|
|
||||||
*/
|
|
||||||
public void setErrorMessage(String message)
|
|
||||||
{
|
|
||||||
if (msgLine != null)
|
|
||||||
msgLine.setErrorMessage(message);
|
|
||||||
// super.setErrorMessage(message);
|
|
||||||
// if (msgLine != null)
|
|
||||||
// ((SystemDialogPageMessageLine)msgLine).internalSetErrorMessage(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* ISystemMessageLine method. <br>
|
* @see org.eclipse.rse.ui.messages.ISystemMessageLine#setMessage(org.eclipse.rse.services.clientserver.messages.SystemMessage)
|
||||||
* If the message line currently displays an error,
|
|
||||||
* the message is stored and will be shown after a call to clearErrorMessage
|
|
||||||
*/
|
*/
|
||||||
public void setMessage(SystemMessage message)
|
public void setMessage(SystemMessage message)
|
||||||
{
|
{
|
||||||
|
@ -398,18 +372,35 @@ public abstract class AbstractSystemWizardPage
|
||||||
else // not configured yet
|
else // not configured yet
|
||||||
pendingMessage = message;
|
pendingMessage = message;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* ISystemMessageLine method. <br>
|
/* (non-Javadoc)
|
||||||
* Set the non-error message text. If the message line currently displays an error,
|
* @see org.eclipse.jface.wizard.WizardPage#setErrorMessage(java.lang.String)
|
||||||
* the message is stored and will be shown after a call to clearErrorMessage
|
*
|
||||||
|
* Never override this method as long the ISystemMessageLine construct is not
|
||||||
|
* eliminated! Overriding may easely lead to StackOverflowErrors.
|
||||||
*/
|
*/
|
||||||
public void setMessage(String message)
|
public final void setErrorMessage(String message) {
|
||||||
{
|
super.setErrorMessage(message);
|
||||||
if (msgLine!=null)
|
}
|
||||||
msgLine.setMessage(message);
|
|
||||||
// super.setMessage(message);
|
/* (non-Javadoc)
|
||||||
// if (msgLine!=null)
|
* @see org.eclipse.jface.wizard.WizardPage#setMessage(java.lang.String, int)
|
||||||
// ((SystemDialogPageMessageLine)msgLine).internalSetMessage(message);
|
*
|
||||||
|
* Never override this method as long the ISystemMessageLine construct is not
|
||||||
|
* eliminated! Overriding may easely lead to StackOverflowErrors.
|
||||||
|
*/
|
||||||
|
public final void setMessage(String newMessage, int newType) {
|
||||||
|
super.setMessage(newMessage, newType);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.jface.dialogs.DialogPage#setMessage(java.lang.String)
|
||||||
|
*
|
||||||
|
* Never override this method as long the ISystemMessageLine construct is not
|
||||||
|
* eliminated! Overriding may easely lead to StackOverflowErrors.
|
||||||
|
*/
|
||||||
|
public final void setMessage(String message) {
|
||||||
|
super.setMessage(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------
|
// ---------------
|
||||||
|
@ -458,21 +449,6 @@ public abstract class AbstractSystemWizardPage
|
||||||
// ----------------
|
// ----------------
|
||||||
// INTERNAL METHODS
|
// INTERNAL METHODS
|
||||||
// ----------------
|
// ----------------
|
||||||
/**
|
|
||||||
* Internal method <br>
|
|
||||||
* Configure the message line
|
|
||||||
*/
|
|
||||||
// private void configureMessageLine()
|
|
||||||
// {
|
|
||||||
// msgLine = SystemDialogPageMessageLine.createWizardMsgLine(this);
|
|
||||||
// if (msgLine!=null)
|
|
||||||
// {
|
|
||||||
// if (pendingMessage!=null)
|
|
||||||
// setMessage(pendingMessage);
|
|
||||||
// if (pendingErrorMessage!=null)
|
|
||||||
// setErrorMessage(pendingErrorMessage);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal method <br>
|
* Internal method <br>
|
||||||
|
|
|
@ -33,6 +33,16 @@ public class RSEDialogPageMessageLine implements ISystemMessageLine {
|
||||||
page = dialogPage;
|
page = dialogPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns if or if not the dialog page message line has been disposed.
|
||||||
|
*
|
||||||
|
* @return <code>True</code> when the dialog page message line is disposed, <code>false</code> otherwise.
|
||||||
|
*/
|
||||||
|
public boolean isDisposed() {
|
||||||
|
assert page != null;
|
||||||
|
return page.getControl() != null && page.getControl().isDisposed();
|
||||||
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.rse.ui.messages.ISystemMessageLine#clearErrorMessage()
|
* @see org.eclipse.rse.ui.messages.ISystemMessageLine#clearErrorMessage()
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue