org.codehaus.mojo.pomtools.console.screens
Class AbstractModelScreen
java.lang.Object
org.codehaus.mojo.pomtools.console.screens.AbstractModelScreen
- All Implemented Interfaces:
- ConsoleScreen
- Direct Known Subclasses:
- AbstractEditListItemScreen, ConfirmYesNoScreen, EditBooleanScreen, EditListScreen, EditLovScreen, EditStringListValueScreen, EditStringScreen, EditVersionScreen, ErrorMessageScreen, HelpScreen, ListDependenciesScreen, ListProjectsScreen, ListTransitiveDependenciesScreen, ModelValidationScreen
public abstract class AbstractModelScreen
- extends Object
- implements ConsoleScreen
- Version:
- $Id: AbstractModelScreen.java 2166 2006-07-18 21:32:16Z carlos $
- Author:
- David Hawkins
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NULL_VALUE
public static final String NULL_VALUE
- See Also:
- Constant Field Values
PRESS_ENTER_TO_CONTINUE
public static final String PRESS_ENTER_TO_CONTINUE
- See Also:
- Constant Field Values
NEWLINE
protected static final String NEWLINE
- See Also:
- Constant Field Values
KEY_NEW_ITEM
protected static final String KEY_NEW_ITEM
- See Also:
- Constant Field Values
KEY_DELETE_ITEM
protected static final String KEY_DELETE_ITEM
- See Also:
- Constant Field Values
MODIFIED_LABEL
protected static final String MODIFIED_LABEL
- See Also:
- Constant Field Values
AbstractModelScreen
public AbstractModelScreen(String name)
getName
public String getName()
- Specified by:
getName
in interface ConsoleScreen
getHeader
protected String getHeader()
getHeader
protected String getHeader(String s)
getFieldNameHeader
protected String getFieldNameHeader(String fieldName)
getHeader
protected String getHeader(String s,
boolean printProjectName)
createDisplay
protected ConsoleScreenDisplay createDisplay(String contents,
String prompt)
createDisplay
protected ConsoleScreenDisplay createDisplay(String contents,
String prompt,
boolean includeHelp)
numberPrompt
protected String numberPrompt(int n)
strPrompt
protected String strPrompt(String s)
isNumberInRange
protected boolean isNumberInRange(String input,
int min,
int max)
isModified
protected boolean isModified()
decorateModifiedLabel
protected static String decorateModifiedLabel(String label,
boolean modified)
- Returns the supplied label with a "**" appended if the
modified parameter is true.
getModifiedLabel
protected String getModifiedLabel(String label,
boolean modified)
- Returns a bold label if the terminal supports formatting and the item
is modified. It the terminal does not support formatting, the value
is simply decorated with a "**"
- Parameters:
label
- modified
-
- Returns:
getDefaultEventDispatcher
public ConsoleEventDispatcher getDefaultEventDispatcher()
throws ConsoleExecutionException
- Throws:
ConsoleExecutionException
getDefaultEventManager
public ConsoleEventDispatcher getDefaultEventManager(boolean includeDefaultListener)
doSave
protected void doSave(ConsoleEvent event)
throws ConsoleExecutionException
- Throws:
ConsoleExecutionException
doRevert
protected void doRevert(ConsoleEvent event)
throws ConsoleExecutionException
- Throws:
ConsoleExecutionException
getModelContext
protected PomToolsPluginContext getModelContext()
getTerminalWidth
public int getTerminalWidth()
setTerminalWidth
public void setTerminalWidth(int terminalWidth)
getHelpText
public String getHelpText()
- Specified by:
getHelpText
in interface ConsoleScreen
setHelpText
public void setHelpText(String helpText)
getTerminal
protected Terminal getTerminal()
Copyright © 2011 The Codehaus. All Rights Reserved.