Prechádzať zdrojové kódy

Edit mouse over info text from textual notations (#1555)

* Added short message for info box

* changed constructor to avoid nullpointer

* Added short message for pro error

* Update .travis.yml
rherrmannr 8 rokov pred
rodič
commit
fb353fa631

+ 54 - 44
plugins/org.yakindu.sct.domain/src/org/yakindu/sct/domain/extension/DomainStatus.java

@@ -1,45 +1,55 @@
-/**
- * Copyright (c) 2016 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * 	committers of YAKINDU - initial API and implementation
- * 
- */
-package org.yakindu.sct.domain.extension;
-
-/**
- * @author andreas muelder - Initial contribution and API
- * 
- */
-public class DomainStatus {
-
-	public static final DomainStatus OK = new DomainStatus(Severity.OK);
-
-	public static enum Severity {
-		OK, ERROR, WARNING, INFO
-	}
-
-	private Severity status;
-	private String message;
-
-	public DomainStatus(Severity status, String message) {
-		this.status = status;
-		this.message = message;
-	}
-
-	public DomainStatus(Severity status) {
-		this.status = status;
-	}
-
-	public Severity getSeverity() {
-		return status;
-	}
-
-	public String getMessage() {
-		return message;
-	}
-
+/**
+ * Copyright (c) 2016 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * Contributors:
+ * 	committers of YAKINDU - initial API and implementation
+ * 
+ */
+package org.yakindu.sct.domain.extension;
+
+/**
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public class DomainStatus {
+
+	public static final DomainStatus OK = new DomainStatus(Severity.OK);
+
+	public static enum Severity {
+		OK, ERROR, WARNING, INFO
+	}
+
+	private Severity status;
+	private String message;
+	private String shortMessage;
+	
+	public DomainStatus(Severity status, String message) {
+		this(status, message, message);
+	}
+	
+	public DomainStatus(Severity status, String message, String shortMessage) {
+		this.status = status;
+		this.message = message;
+		this.shortMessage = shortMessage;
+	}
+
+	public DomainStatus(Severity status) {
+		this.status = status;
+	}
+
+	public Severity getSeverity() {
+		return status;
+	}
+
+	public String getMessage() {
+		return message;
+	}
+	
+	public String getShortMessage() {
+		return shortMessage;
+	}
+
 }

+ 2 - 2
plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/validation/DomainValidator.java

@@ -43,13 +43,13 @@ public class DomainValidator implements EValidator {
 		if (eObject instanceof DomainElement) {
 			DomainStatus status = DomainRegistry.getDomainStatus(((DomainElement) eObject).getDomainID());
 			if (status.getSeverity() == Severity.ERROR) {
-				diagnostics.add(new BasicDiagnostic(Diagnostic.ERROR, "DomainValidator", 0, status.getMessage(),
+				diagnostics.add(new BasicDiagnostic(Diagnostic.ERROR, "DomainValidator", 0, status.getShortMessage(),
 						new Object[] { eObject }));
 			} else if (status.getSeverity() == Severity.WARNING) {
 				diagnostics.add(new BasicDiagnostic(Diagnostic.WARNING, "DomainValidator", 0, status.getMessage(),
 						new Object[] { eObject }));
 			} else if (status.getSeverity() == Severity.INFO) {
-				diagnostics.add(new BasicDiagnostic(Diagnostic.INFO, "DomainValidator", 0, status.getMessage(),
+				diagnostics.add(new BasicDiagnostic(Diagnostic.INFO, "DomainValidator", 0, status.getShortMessage(),
 						new Object[] { eObject }));
 			}
 		}