public final class ConsoleProperties extends Object
Adds fixed interface and listener mechanism, but delegates to
GrinderProperties
for storage.
Implements the read-only part of Map<String, Object>
.
Constructor and Description |
---|
ConsoleProperties(ConsoleProperties properties)
Copy constructor.
|
ConsoleProperties(Resources resources,
File file)
Construct a ConsoleProperties backed by the given file.
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Add a
PropertyChangeListener . |
void |
addPropertyChangeListener(String property,
PropertyChangeListener listener)
Add a
PropertyChangeListener which listens to a particular
property. |
int |
getCollectSampleCount()
Get the number of samples to collect.
|
String |
getConsoleHost()
Get the console host as a string.
|
int |
getConsolePort()
Get the console port.
|
boolean |
getDistributeOnStartAsk()
Get whether the user wants to distribute files automatically when starting
processes.
|
Directory |
getDistributionDirectory()
Get the script distribution directory.
|
String |
getDistributionFileFilterExpression()
Get the distribution file filter pattern.
|
Pattern |
getDistributionFileFilterPattern()
Get the distribution file filter pattern.
|
String |
getExternalEditorArguments()
Get the external editor arguments.
|
File |
getExternalEditorCommand()
Get the external editor command.
|
Rectangle |
getFrameBounds()
Get the location and size of the console frame.
|
String |
getHttpHost()
Get the HTTP host as a string.
|
int |
getHttpPort()
Get the HTTP port.
|
int |
getIgnoreSampleCount()
Get the number of samples to ignore.
|
String |
getLookAndFeel()
Get the name of the Look and Feel.
|
File |
getPropertiesFile()
Get the selected properties file.
|
boolean |
getPropertiesNotSetAsk()
Get whether the user wants to be asked if console should be reset
with the worker processes.
|
boolean |
getResetConsoleWithProcesses()
Get whether the console should be reset with the worker
processes.
|
boolean |
getResetConsoleWithProcessesAsk()
Get whether the user wants to be asked if console should be reset
with the worker processes.
|
int |
getSampleInterval()
Get the sample interval.
|
boolean |
getSaveTotalsWithResults()
Get whether saved results files should include the Totals line.
|
int |
getScanDistributionFilesPeriod()
Get the period at which the distribution files should be scanned.
|
int |
getSignificantFigures()
Get the number of significant figures.
|
boolean |
getStartWithUnsavedBuffersAsk()
Get whether the user wants to be warned when starting processes with
unsaved buffers.
|
boolean |
getStopProcessesAsk()
Get whether the user wants to be asked to confirm that processes
should be stopped.
|
void |
save()
Save to the associated file.
|
void |
set(ConsoleProperties properties)
Assignment.
|
void |
setAndSaveDistributionDirectory(Directory distributionDirectory)
Set and save the script distribution directory.
|
void |
setAndSaveFrameBounds(Rectangle bounds)
Set and save the location and size of the console frame.
|
void |
setAndSavePropertiesFile(File propertiesFile)
Set and save the properties file.
|
void |
setCollectSampleCount(int n)
Set the number of samples to collect.
|
void |
setConsoleHost(String s)
Set the console host.
|
void |
setConsolePort(int i)
Set the console port.
|
void |
setDistributeOnStartAsk(boolean value)
Set and save whether the user wants to distribute files automatically when
starting processes.
|
void |
setDistributionDirectory(Directory distributionDirectory)
Set and save the script distribution directory.
|
void |
setDistributionFileFilterExpression(String expression)
Set the distribution file filter regular expression.
|
void |
setExternalEditorArguments(String arguments)
Set the external editor arguments.
|
void |
setExternalEditorCommand(File command)
Set the external editor command.
|
void |
setFrameBounds(Rectangle bounds)
Set and save the location and size of the console frame.
|
void |
setHttpHost(String s)
Set the HTTP host.
|
void |
setHttpPort(int i)
Set the HTTP port.
|
void |
setIgnoreSampleCount(int n)
Set the number of samples to collect.
|
void |
setLookAndFeel(String lookAndFeel)
Set the name of the Look and Feel.
|
void |
setPropertiesFile(File propertiesFile)
Set and save the selected properties file.
|
void |
setPropertiesNotSetAsk(boolean value)
Set and save whether the user wants to be asked if console should be reset
with the worker processes.
|
void |
setResetConsoleWithProcesses(boolean b)
Set whether the console should be reset with the worker
processes.
|
void |
setResetConsoleWithProcessesAsk(boolean value)
Set and save whether the user wants to be asked if console should be reset
with the worker processes.
|
void |
setSampleInterval(int interval)
Set the sample interval.
|
void |
setSaveTotalsWithResults(boolean b)
Set whether saved results files should include the Totals line.
|
void |
setScanDistributionFilesPeriod(int i)
Set the period at which the distribution files should be scanned.
|
void |
setSignificantFigures(int n)
Set the number of significant figures.
|
void |
setStartWithUnsavedBuffersAsk(boolean value)
Set and save whether the user wants to be warned when starting processes
with unsaved buffers.
|
void |
setStopProcessesAsk(boolean value)
Set and save whether the user wants to be asked to confirm that processes
should be stopped.
|
public static final String COLLECT_SAMPLES_PROPERTY
public static final String IGNORE_SAMPLES_PROPERTY
public static final String SAMPLE_INTERVAL_PROPERTY
public static final String SIG_FIG_PROPERTY
public static final String CONSOLE_HOST_PROPERTY
public static final String CONSOLE_PORT_PROPERTY
public static final String HTTP_HOST_PROPERTY
public static final String HTTP_PORT_PROPERTY
public static final String RESET_CONSOLE_WITH_PROCESSES_PROPERTY
public static final String RESET_CONSOLE_WITH_PROCESSES_ASK_PROPERTY
public static final String PROPERTIES_NOT_SET_ASK_PROPERTY
public static final String START_WITH_UNSAVED_BUFFERS_ASK_PROPERTY
public static final String STOP_PROCESSES_ASK_PROPERTY
public static final String DISTRIBUTE_ON_START_ASK_PROPERTY
public static final String PROPERTIES_FILE_PROPERTY
public static final String DISTRIBUTION_DIRECTORY_PROPERTY
public static final String DISTRIBUTION_FILE_FILTER_EXPRESSION_PROPERTY
public static final String DEFAULT_DISTRIBUTION_FILE_FILTER_EXPRESSION
public static final String SCAN_DISTRIBUTION_FILES_PERIOD_PROPERTY
public static final String LOOK_AND_FEEL_PROPERTY
public static final String EXTERNAL_EDITOR_COMMAND_PROPERTY
public static final String EXTERNAL_EDITOR_ARGUMENTS_PROPERTY
public static final String FRAME_BOUNDS_PROPERTY
public static final String SAVE_TOTALS_WITH_RESULTS_PROPERTY
public ConsoleProperties(Resources resources, File file) throws ConsoleException
resources
- Console resources.file
- The properties file.ConsoleException
- If the properties file
cannot be read or the properties file contains invalid data.public ConsoleProperties(ConsoleProperties properties)
properties
- The properties to copy.public void set(ConsoleProperties properties)
properties
- The properties to copy.public void addPropertyChangeListener(PropertyChangeListener listener)
PropertyChangeListener
.listener
- The listener.public void addPropertyChangeListener(String property, PropertyChangeListener listener)
PropertyChangeListener
which listens to a particular
property.property
- The property.listener
- The listener.public void save() throws ConsoleException
ConsoleException
- If an error occurs.public int getCollectSampleCount()
public void setCollectSampleCount(int n) throws ConsoleException
n
- The number. 0 => forever.ConsoleException
- If the number is negative.public int getIgnoreSampleCount()
public void setIgnoreSampleCount(int n) throws ConsoleException
n
- The number. Must be positive.ConsoleException
- If the number is negative or zero.public int getSampleInterval()
public void setSampleInterval(int interval) throws ConsoleException
interval
- The interval in milliseconds.ConsoleException
- If the number is negative or zero.public int getSignificantFigures()
public void setSignificantFigures(int n) throws ConsoleException
n
- The number of significant figures.ConsoleException
- If the number is negative.public String getConsoleHost()
public void setConsoleHost(String s) throws ConsoleException
s
- Either a machine name or the IP address.ConsoleException
- If the address is not
valid.public int getConsolePort()
public void setConsolePort(int i) throws ConsoleException
i
- The port number.ConsoleException
- If the port number is not sensible.public String getHttpHost()
public void setHttpHost(String s) throws ConsoleException
s
- Either a machine name or the IP address.ConsoleException
- If the address is not
valid.public int getHttpPort()
public void setHttpPort(int i) throws ConsoleException
i
- The port number.ConsoleException
- If the port number is not sensible.public boolean getResetConsoleWithProcesses()
true
=> the console should be reset with the
worker processes.public void setResetConsoleWithProcesses(boolean b)
b
- true
=> the console should be reset with
the worker processes.public boolean getResetConsoleWithProcessesAsk()
true
=> the user wants to be asked.public void setResetConsoleWithProcessesAsk(boolean value) throws ConsoleException
value
- true
=> the user wants to be asked.ConsoleException
- If the property couldn't be persistedpublic boolean getPropertiesNotSetAsk()
true
=> the user wants to be asked.public void setPropertiesNotSetAsk(boolean value) throws ConsoleException
value
- true
=> the user wants to be asked.ConsoleException
- If the property couldn't be persisted.public boolean getStartWithUnsavedBuffersAsk()
true
=> the user wants to be warned.public void setStartWithUnsavedBuffersAsk(boolean value) throws ConsoleException
value
- true
=> the user wants to be warned.ConsoleException
- If the property couldn't be persisted.public boolean getStopProcessesAsk()
true
=> the user wants to be asked.public void setStopProcessesAsk(boolean value) throws ConsoleException
value
- true
=> the user wants to be asked.ConsoleException
- If the property couldn't be persisted.public boolean getDistributeOnStartAsk()
true
=> the user wants automatic distribution.public void setDistributeOnStartAsk(boolean value) throws ConsoleException
value
- true
=> the user wants automatic distribution.ConsoleException
- If the property couldn't be persisted.public File getPropertiesFile()
null
=> No file selected.public void setPropertiesFile(File propertiesFile)
propertiesFile
- The properties file. null
=> No file selected.public void setAndSavePropertiesFile(File propertiesFile) throws ConsoleException
propertiesFile
- The properties file. null
=> No file
set.ConsoleException
ConsoleException
- If the property could not be saved.public Directory getDistributionDirectory()
public void setDistributionDirectory(Directory distributionDirectory)
distributionDirectory
- The directory.public void setAndSaveDistributionDirectory(Directory distributionDirectory) throws ConsoleException
distributionDirectory
- The directory.ConsoleException
- If the property could not be saved.public Pattern getDistributionFileFilterPattern()
The original regular expression can be obtained with
getDistributionFileFilterPattern()
.
setDistributionFileFilterExpression(java.lang.String)
public String getDistributionFileFilterExpression()
The original regular expression can be obtained with
getDistributionFileFilterPattern().getPattern()
.
setDistributionFileFilterExpression(java.lang.String)
public void setDistributionFileFilterExpression(String expression) throws ConsoleException
Files and directory names (not full paths) that match the regular expression are not distributed. Directory names are distinguished by a trailing '/'. The expression is in Perl 5 format.
expression
- A Perl 5 format expression. null
=> use default pattern.ConsoleException
- If the pattern is invalid.public int getScanDistributionFilesPeriod()
public void setScanDistributionFilesPeriod(int i) throws ConsoleException
i
- The port number.ConsoleException
- If the period is negative.public String getLookAndFeel()
null
=> use default.public void setLookAndFeel(String lookAndFeel)
lookAndFeel
- The Look and Feel name. null
=>
use default.public File getExternalEditorCommand()
null
=> no external editor set.public void setExternalEditorCommand(File command)
command
- The path to the process to be used for external editing.
null
=> no external editor set.public String getExternalEditorArguments()
public void setExternalEditorArguments(String arguments)
arguments
- The arguments to be used with the external editor.public Rectangle getFrameBounds()
public void setFrameBounds(Rectangle bounds)
bounds
- The console frame bounds.public void setAndSaveFrameBounds(Rectangle bounds) throws ConsoleException
bounds
- The console frame bounds.ConsoleException
- If the property couldn't be persisted.public boolean getSaveTotalsWithResults()
true
=> results files should include totals.public void setSaveTotalsWithResults(boolean b) throws ConsoleException
b
- true
=> results files should include totals.ConsoleException
- If the property couldn't be persisted.Copyright © 2000-2014. All Rights Reserved.