Add fields to model

This commit is contained in:
Oystein Kristoffer Tveit 2021-02-22 14:50:14 +01:00
parent d0bddf7d46
commit f94612cf87
2 changed files with 47 additions and 1 deletions

View File

@ -1,10 +1,28 @@
package app.model;
import app.languages.Java;
/**
* Data model of the application
*/
public class Model {
private static String activeFilePath;
private static String currentProjectPath;
private static ProgrammingLanguage currentProgrammingLanguage;
private String text;
public static String getActiveFilePath() {
return activeFilePath;
}
public static String getProjectPath() {
return currentProjectPath;
}
public static ProgrammingLanguage getLanguage() {
return currentProgrammingLanguage;
}
public static void setLanguage(ProgrammingLanguage language) {
Model.currentProgrammingLanguage = language;
}
}

View File

@ -0,0 +1,28 @@
package app.model;
import java.net.URL;
import java.util.Map;
import java.util.regex.Pattern;
public interface ProgrammingLanguage {
/**
* The name of the programming language
*/
public String getName();
/**
* The icon of the programming language
* @return The path of the icon
*/
public URL getIcon();
/**
* The map containing the regex and corresponding style-classes to be used for syntax highlighting
*/
public Map<Pattern,String> getPatternMap();
/**
* The pattern containing all regexes for syntax highlighting
*/
public Pattern getPattern();
}