рефакторинг получения шрифта статуса в таблицах
This commit is contained in:
@@ -21,14 +21,14 @@ public enum ComparisonState implements StatusEnum {
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public Font getFont() {
|
||||
public VisualiserFonts getFont() {
|
||||
switch (this) {
|
||||
case Unknown:
|
||||
return Current.getTheme().Fonts.get(VisualiserFonts.UnknownState);
|
||||
return VisualiserFonts.UnknownState;
|
||||
case Match:
|
||||
return Current.getTheme().Fonts.get(VisualiserFonts.GoodState);
|
||||
return VisualiserFonts.GoodState;
|
||||
case NotMatch:
|
||||
return Current.getTheme().Fonts.get(VisualiserFonts.BadState);
|
||||
return VisualiserFonts.BadState;
|
||||
default:
|
||||
return StatusEnum.super.getFont();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package TestingSystem.SAPFOR.ServerSapfor;
|
||||
import Common.Current;
|
||||
import Common.UI.StatusEnum;
|
||||
import Common.UI.Themes.VisualiserFonts;
|
||||
|
||||
import java.awt.*;
|
||||
public enum ServerSapforState implements StatusEnum {
|
||||
Queued,
|
||||
RepositorySynchronization,
|
||||
@@ -7,20 +11,37 @@ public enum ServerSapforState implements StatusEnum {
|
||||
Done,
|
||||
DoneWithErrors;
|
||||
@Override
|
||||
public VisualiserFonts getFont() {
|
||||
switch (this){
|
||||
case Queued:
|
||||
return VisualiserFonts.UnknownState;
|
||||
case Done:
|
||||
return VisualiserFonts.GoodState;
|
||||
case DoneWithErrors:
|
||||
return VisualiserFonts.BadState;
|
||||
case Compilation:
|
||||
case RepositorySynchronization:
|
||||
return VisualiserFonts.ProgressState;
|
||||
default:
|
||||
return VisualiserFonts.UnknownState;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public String getDescription() {
|
||||
switch (this) {
|
||||
case Queued:
|
||||
return "в очереди";
|
||||
case RepositorySynchronization:
|
||||
return "синхронизация репозитория";
|
||||
return "синхронизация";
|
||||
case Compilation:
|
||||
return "сборка";
|
||||
case Done:
|
||||
return "сборка успешно";
|
||||
return "успешно";
|
||||
case DoneWithErrors:
|
||||
return "сборка с ошибками";
|
||||
return "с ошибками";
|
||||
default:
|
||||
return StatusEnum.super.getDescription();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ public class ServerSapforsDBTable extends iDBTable<ServerSapfor> {
|
||||
}
|
||||
@Override
|
||||
public String[] getUIColumnNames() {
|
||||
return new String[]{"версия", "дата сборки", "статус"};
|
||||
return new String[]{"версия", "дата сборки", "сборка"};
|
||||
}
|
||||
@Override
|
||||
public Object getFieldAt(ServerSapfor object, int columnIndex) {
|
||||
|
||||
Reference in New Issue
Block a user