ComponentWithBrowseButton - optional remove listener on hide
[fedora-idea.git] / platform / platform-impl / src / com / intellij / diagnostic / AbstractMessage.java
blobeb561e47b29dad5648d8ab585591664358934295
1 /*
2 * Copyright 2000-2009 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package com.intellij.diagnostic;
18 import com.intellij.openapi.diagnostic.SubmittedReportInfo;
20 import java.util.Calendar;
21 import java.util.Date;
23 public abstract class AbstractMessage {
25 private boolean myIsRead = false;
26 private SubmittedReportInfo mySubmissionInfo;
27 private String myScrID;
29 private final Date myDate;
31 public AbstractMessage() {
32 myDate = Calendar.getInstance().getTime();
35 public abstract String getThrowableText();
36 public abstract Throwable getThrowable();
37 public abstract String getMessage();
39 public boolean isRead() {
40 return myIsRead;
43 public void setRead(boolean aReadFlag) {
44 myIsRead = aReadFlag;
47 public void setSubmitted(SubmittedReportInfo info) {
48 mySubmissionInfo = info;
51 public SubmittedReportInfo getSubmissionInfo() {
52 return mySubmissionInfo;
55 public boolean isSubmitted() {
56 return mySubmissionInfo != null &&
57 (mySubmissionInfo.getStatus() == SubmittedReportInfo.SubmissionStatus.NEW_ISSUE ||
58 mySubmissionInfo.getStatus() == SubmittedReportInfo.SubmissionStatus.DUPLICATE);
61 public Date getDate() {
62 return myDate;