Ignore:
Timestamp:
08/28/12 16:42:22 (12 years ago)
Author:
sherbold
Message:
  • modified startup-parameter trace of runner from binary into java.util.Logger.Level to define the tracing granularity; defaults to WARNING)
  • modified TextConsole? and SWTConsole to trace according to trace-parameter
Location:
trunk/quest-ui-swt/src/main/java/de/ugoe/cs/quest/ui/swt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/quest-ui-swt/src/main/java/de/ugoe/cs/quest/ui/swt/MainWindow.java

    r658 r674  
    22 
    33import java.util.List; 
     4import java.util.logging.Level; 
    45 
    56import org.eclipse.swt.widgets.Display; 
     
    2930 
    3031    private List<String> startupCommands; 
     32     
     33    private final Level traceLevel; 
    3134 
    3235    protected Shell shlEventbenchConsole; 
     
    4548    protected CommandHistoryDialog historyDialog; 
    4649 
    47     public MainWindow(List<String> startupCommands) { 
     50    public MainWindow(List<String> startupCommands, Level traceLevel) { 
    4851        this.startupCommands = startupCommands; 
     52        this.traceLevel = traceLevel; 
    4953    } 
    5054 
     
    5963        Display display = Display.getDefault(); 
    6064        createContents(); 
    61         new SWTConsole(consoleTabComposite.textConsoleOutput); 
     65        new SWTConsole(consoleTabComposite.textConsoleOutput, traceLevel); 
    6266        historyDialog = new CommandHistoryDialog(shlEventbenchConsole, SWT.NONE); 
    6367        shlEventbenchConsole.open(); 
  • trunk/quest-ui-swt/src/main/java/de/ugoe/cs/quest/ui/swt/SWTConsole.java

    r655 r674  
    1818{ 
    1919 
    20     StyledText output; 
     20    private StyledText output; 
     21     
     22    private Level traceLevel; 
    2123 
    22     public SWTConsole(StyledText styledText) { 
     24    public SWTConsole(StyledText styledText, Level traceLevel) { 
    2325        Console.getInstance().registerOutputListener(this); 
    2426        Console.getInstance().registerErrorListener(this); 
     
    2628        Console.getInstance().registerCommandListener(this); 
    2729        this.output = styledText; 
     30        this.traceLevel = traceLevel; 
    2831    } 
    2932 
     
    4043    @Override 
    4144    public void traceMsg(String traceMessage, Level level) { 
    42         appendColored("[" + level.toString() + "] " + traceMessage, SWT.COLOR_BLUE); 
     45        if( level.intValue()>=traceLevel.intValue()) { 
     46            appendColored("[" + level.toString() + "] " + traceMessage, SWT.COLOR_BLUE); 
     47        } 
    4348    } 
    4449 
Note: See TracChangeset for help on using the changeset viewer.