Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [platform-team-dev] Set Message.


Sure. You can catch the OperationCancelledException and then display whatever message you like.



"Kadadi, Usha D" <Usha.Kadadi@xxxxxx>
Sent by: platform-team-dev-admin@xxxxxxxxxxx

11/08/2004 12:49 PM

Please respond to
platform-team-dev

To
<platform-team-dev@xxxxxxxxxxx>
cc
Subject
RE: [platform-team-dev] Set Message.





Is there a way.I can display a message when the operation is cancelled.
 
-----Original Message-----
From:
platform-team-dev-admin@xxxxxxxxxxx [mailto:platform-team-dev-admin@xxxxxxxxxxx]On Behalf Of Michael Valenta
Sent:
Wednesday, August 11, 2004 9:44 AM
To:
platform-team-dev@xxxxxxxxxxx
Subject:
RE: [platform-team-dev] Set Message.


I see. I would suggest that, in the case of a cancel, the error dialog should not be shown since the user knows he/she cancelled the operation.


Michael



"Kadadi, Usha D" <Usha.Kadadi@xxxxxx>
Sent by: platform-team-dev-admin@xxxxxxxxxxx

11/08/2004 12:16 PM

Please respond to
platform-team-dev


To
<platform-team-dev@xxxxxxxxxxx>
cc
Subject
RE: [platform-team-dev] Set Message.







I am performing a checkout and the operation is cancelled. I think eclipse is throwing the OperationCancelledException. The user knows that he has performed the cancel but he sees that the Reason: is blank . We are using and error dialog to display the error message.

 

-----Original Message-----
From:
platform-team-dev-admin@xxxxxxxxxxx [mailto:platform-team-dev-admin@xxxxxxxxxxx]On Behalf Of Michael Valenta
Sent:
Wednesday, August 11, 2004 9:02 AM
To:
platform-team-dev@xxxxxxxxxxx
Subject:
RE: [platform-team-dev] Set Message.



It would help if I knew the context you are working in? What operation are you running? Who is throwing the OperationCancelledException? Who is wrapping it in an IStatus (i.e. is it the status returned from a job)?


Usually, an OperationCancelException is the result of the user clicking Cancel so there is no need to display a message (i.e. the user knows they cancelled the operation). That is probably why the message of the status in question is blank.


Michael


"Kadadi, Usha D" <Usha.Kadadi@xxxxxx>
Sent by: platform-team-dev-admin@xxxxxxxxxxx

11/08/2004 11:31 AM

Please respond to
platform-team-dev


To
<platform-team-dev@xxxxxxxxxxx>
cc
Subject
RE: [platform-team-dev] Set Message.









Michael,

The reason I want to change the message is because at runtime .When the  Opeartion has been cancelled.Status.getexception returns OperationCancelledException and the message is empty . So in this case i would like to set the message to say "Opeartion Cancelled. Do i need a try catch block and catch the OperationCancelledException or is there in any other ways i can accomplish this.


Thanks

-----Original Message-----
From:
platform-team-dev-admin@xxxxxxxxxxx [mailto:platform-team-dev-admin@xxxxxxxxxxx]On Behalf Of Michael Valenta
Sent:
Tuesday, August 10, 2004 7:31 AM
To:
platform-team-dev@xxxxxxxxxxx
Subject:
RE: [platform-team-dev] Set Message.



Of course you can set the message of a Status at runtime. However, it can only be set when the status object is created. Once a ststus has been created the message cannot be changed. If you think about it, this makes sense. Why do you want to set the message of an IStatus? Typically what is done when catching errors and propogating them to a client is that the status is added as a child of a  MultiStatus. You could do somthing like this.


IStatus status = peformAction();

if (!status.isOk()) {

 MultiStatus result = new MultiStatus(MyPlugin.ID, MyConstants.ERROR_CODE, "My error message", null);

 result.add(status);

 return result;

}


Michael

"Kadadi, Usha D" <Usha.Kadadi@xxxxxx>
Sent by: platform-team-dev-admin@xxxxxxxxxxx

10/08/2004 10:11 AM

Please respond to
platform-team-dev


To
<platform-team-dev@xxxxxxxxxxx>
cc
Subject
RE: [platform-team-dev] Set Message.











Can we not set it at runtime.

-----Original Message-----
From:
platform-team-dev-admin@xxxxxxxxxxx [mailto:platform-team-dev-admin@xxxxxxxxxxx]On Behalf Of Michael Valenta
Sent:
Tuesday, August 10, 2004 7:00 AM
To:
platform-team-dev@xxxxxxxxxxx
Subject:
Re: [platform-team-dev] Set Message.



You can only set the message when creating an instance of IStatus (see org.eclipse.runtime.Status and org.eclipse.runtime.MultiStatus).


Michael
"Kadadi, Usha D" <Usha.Kadadi@xxxxxx>
Sent by: platform-team-dev-admin@xxxxxxxxxxx

10/08/2004 09:20 AM

Please respond to
platform-team-dev


To
<platform-team-dev@xxxxxxxxxxx>
cc
Subject
[platform-team-dev] Set Message.













In Eclipse 2.0.2 and 2.1.2 how can i set the message of IStatus object.


Back to the top