input
stringlengths
10
828
output
stringlengths
5
107
private file extract resource string resource name file dest dir file file new file dest dir resource name input stream in get class get resource as stream resource name file output stream out file utils open output stream file ioutils copy in out return file
extracts the classpath resource with the specified name to the specified
private string create version info return proto j version get version
nice to factor this into a method of its own
public string get version return 1 9 0
the project version number
public void create no dep archive archive feature feature get delegate get archive feature classes archive classes feature get classes archive classes create archive get no dep jar tag
creates the no dependencies archive in the archive directory
public string get version number return 1 7 8
used in version information and names of jar files for example
public string get no dep download url return get download ur get no dep jar name
the url for downloading the no dependencies jar from googlecode
public string get version number return 1 6 1
used in version information and names of jar files for example
public void init executable jar string jar name init executable jar jar name project get current main class
convenience method that delegates to
public void configure string name project layout layout project get layout file profile instance dir new file layout get profile dir name if profile instance dir exists string reason can t find profile directory profile instance dir get absolute path project terminate application reason new clean task get working dir execute get working dir mkdir if interpolated reduce properties profile instance dir filtered copy profile instance dir else merge properties profile instance dir copy dir profile instance dir get working dir null properties copy dir get working dir layout get root dir null null
configures the project config directory by overlaying the content of the
public void release string user name string password standard project delegate project get project show summary delegate delegate get assemble feature assemble delegate get junit feature junit delegate get tar feature tar false true delegate get verify tar feature verify tar verify proto resources string summary new executable jar and configuration profile features string labels type archive op sys all featured string google name project get project name src tar gz delegate get upload google code feature upload tar user name password google name labels summary
convenient short hand for invoking the assemble javadocs test tar
private void start project main vm string args core get instruction chain create args and remove start vm main class args main memory get start vm config
starts a forked vm to the project main
public configure command get configure command return service get configure command
the command line handler for delegating to the configuration
public void ivy retrieve if ivy config null ant target target new ant target ivy feature target get project set base dir parent get layout get root dir target init logging parent get layout get log file project msg info ivy retrieve new ivy retrieve target add task ivy retrieve ivy retrieve set task name ivy retrieve ivy retrieve set file get ivy file if config null config run this target execute
downloads the dependencies described in the project ivy
public void maven retrieve if maven config null ant target target new ant target maven feature target init logging parent get layout get log file project msg info dependencies create dependencies target string classes dependency classes fileset dependencies set fileset id classes dependency copy classes add dependency target classes dependency string javadocs dependency javadocs fileset dependencies set javadoc fileset id javadocs dependency copy javadocs add dependency target javadocs dependency string sources dependency sources fileset dependencies set sources fileset id sources dependency copy sources add dependency target sources dependency if config null config run this target execute
downloads the dependencies described in the project pom
public void create alien project file parent dir file jar file create project parent dir alien jar file bin alien sh bin alien bat conf alien test properties conf profile conf alien properties conf profile conf alien test properties conf profile docs topsecret txt conf alien properties src java alien core alien core java src java alien test alien test java src java alien alien project java src resources alien ivy xml readme txt notice txt
creates the alien project with the specified root dir
public void undo project layout layout project get layout file project root dir layout get root dir get all the resource under the profile root directory final list file profile resources new array list file list files layout get profile dir profile resources delete the matching resource under the project directory for file profile resource profile resources string relative path get relative path layout get profile dir profile resource file project resource new file project root dir relative path project resource delete for interpolated mode delete the special all properties file if interpolated layout get properties file delete
removes all files in the project directory that match the paths in the
public void makepom string settings ref ant target target new ant target ivy feature target init logging parent get layout get log file project msg info ivy make pom makepom new ivy make pom target add task makepom makepom set task name makepom makepom set ivy file ivy file makepom set pom file pom file mapping mapping makepom create mapping mapping set conf compile mapping set scope compile target execute
decorates the ivy makepom ant task
public retrieve command get retrieve command return retrieve command
use this command to access the functionality for downloading
public compile command get compile command return compile command
use this command to perform in code compilation
public javac command get javac command return javac command
use this command to invoke javac usually from a script to compile just
public property info get main memory property return main memory property
overrides the amount of memory used by the main vm
public property info get command memory property string name string key protoj memory name return parent get property store get lazy info key specify the amount of memory for the command vm eg 4m
overrides the amount of memory used by the specified command vm
public property info get command debug property string name string key protoj debug name string builder builder new string builder builder append set to true in order to debug a vm for the specified command vm builder append n for example d key return parent get property store get lazy info key builder to string boolean false to string boolean true to string
specifies whether or not to debug for a given command
public property info get command debug suspend property string name string key protoj debug suspend name string builder builder new string builder builder append set to true in order to suspend a vm when starting a debug session for builder append the specified command n for example d key return parent get property store get lazy info key builder to string boolean false to string boolean true to string
specifies whether or not to suspend a vm for the given command name
public property info get command debug port property string name string key protoj debug port name string builder builder new string builder builder append set to the port number to use when starting a debug session for builder append the specified command n for example d key 11111 return parent get property store get lazy info key builder to string 11111 11111
specifies the remote debugging port to use when debugging for the given
public property info get junit memory property return junit memory property
overrides the amount of memory used by the junit vm
public string get version number return 1 7 6
used in version information and names of jar files for example
public string get version return 1 8 5
the project version number
public string get browsable url return http code google com p protoj source browse svn get version
the browsable subversion url for the project
private void copy resource file dest string relative path layout get relative path dest string source demo relative path input stream resource get class get resource as stream source if dest exists dest get parent file mkdirs dest create new file copy resource new input stream reader resource dest
copies the file under the demo resource path to the specified dest
public standard project create demo project delegate create no dep archive ant target target new ant target demo project layout layout delegate get layout target init logging layout get log file project msg info java java new java target add task java java set task name demo java java set jar get no dep file java set fork true java set failonerror true java set dir layout get target dir target execute file root dir new file layout get target dir demo return new standard project root dir demo sh null
ensures the no dependencies jar file is present and executes it so that
public void set content string text label set text text
set the content to show
public void value changed tree selection event event
for tree selection listener
public void action performed action event e do nothing just repaint repaint
advances animation to next frame
protected void initialize final runnable do finished new runnable public void run finished using a thread to do the real work runnable do construct new runnable public void run try set value construct finally thread var clear do the finish work on the event dispatching thread swing utilities invoke later do finished thread t new thread do construct save the work thread thread var new thread var t
start a thread that will call the code construct code method
public void add tree model listener tree model listener listener if listener null listeners contains listener listeners add element listener
add a tree model listener object
public void remove tree model listener tree model listener listener if listener null listeners remove element listener
remove a tree model listener object
public void interrupt thread t thread var get the thread if t null t interrupt thread var clear
a new method that interrupts the worker thread
protected void build0 object obj super build0 obj set the icon abstract button obj set enable abstract button obj set action command abstract button obj set selected abstract button obj
the facility class to build the specified component object
public void action performed action event e if msgs is empty there is no message do nothing just retrun return retrieve the first message string msg string msgs remove 0 set text msg
implements the action performed method
public object get waiting for the work done while true thread t thread var get the thread if t null the work in the worker thread is done and then return the result return get value try waiting for the worker thread to die t join catch interrupted exception e the worker thread is interrupted return null as result thread current thread interrupt propagate why return null
return the value created by the code construct code method
protected void set the icon abstract button button element icon ele element element builder constant xml icon if icon ele null log debug there is no icon definition for this button return string ref icon ele attribute value builder constant xml key ref log debug set the icon ref button set icon icon get components get ref
set icons for the given abstract button
public object build status label label status label get instance build0 label get the initial message string text get localized text status label add message text status label add message initializing label start return label
do the build operation
public object build string direction element attribute value builder constant xml direction log debug builds a direction glue component if direction equals builder constant xml horizontal return box create horizontal glue else if direction equals builder constant xml vertical return box create vertical glue else log debug no such kind of glue component return null
creates a glue component
public object build jradio button button new jradio button get localized text build0 button return button
creates and builds a jradio button object based on the specified jdom
protected void set enable abstract button button string enable element attribute value builder constant xml enable true button set enabled new boolean enable boolean value
enable or disable the specified button
public void start thread t thread var get the thread if t null t start
start the worker thread
public object build jcombo box combobox new jcombo box build0 combobox ibmodel getter getter ibmodel getter get the model combo box model model combo box model get the model if model null combobox set model model return combobox
creates and builds a jlabel component based on the given jdom element
protected void set action command abstract button button string command element attribute value builder constant xml action command if command null command equals log debug there is no action command for this button button set action command command
set the action commond for this abstract button
public object build digital clock label clock digital clock label get instance build0 clock return clock
creates and builds the radar monitor
public object build log debug build the table get key jtable table new jtable build0 table the table model object model get the model if model null table set model table model model return table
creates and builds a jtable component
public void set selected abstract button button boolean selected get attr boolean value element builder constant xml selected false log debug set the selected state selected button set selected selected
set the selected state of this button
public object build return null
this method is no use in this kind of builder
protected void set title window window element title ele element element builder constant xml title it has to have the text element string default value title ele element builder constant xml text get text string title title ele attribute value builder constant xml key title get localized text title default value log debug set window window to string s title to title if window instanceof frame frame window set title title else if window instanceof dialog dialog window set title title
set the title of the specified window component
protected void build0 object obj invoke the super class s same method first super build0 obj set editable jtext component obj
this facility methos to build the specified text component
public object build object applet set the root root applet initializing the resources init resources init units init mix components init panels add the menu bar if it exist add menu bar container applet container content pane null if root instanceof japplet content pane japplet root get content pane else if root instanceof jframe content pane jframe root get content pane set layout manager content pane add components content pane return root
builds the specified applet component
public object build jpanel panel new jpanel set layout manager panel build0 panel add components panel return panel
creates and builds the panel
protected void set editable jtext component text comp log trace entering the method set editable boolean b get attr boolean value element builder constant xml editable false text comp set editable b log trace exiting the method set editable
sets the editable attribute for the specified jtext component object
public object build int width integer parse int element attribute value builder constant xml width int height integer parse int element attribute value builder constant xml height log debug building the rigid area width width height height return box create rigid area new dimension width height
creats a rigid area based on the information from the element
public object build object frame root frame set title window frame init resources init units init toolbars init popup menus init panels init panes init mix components set icon image frame frame add menu bar container frame jmenu bar menu bar build the menu bar if menu bar null jframe frame set jmenu bar menu bar container content pane jframe frame get content pane set layout manager content pane add components content pane return frame
builds the specified frame object
public object build component view get the view jscroll pane pane new jscroll pane view set policy pane set the border pane set the size pane return pane
creates and builds a jscroll pane object
public object build jtree tree new jtree build0 tree set shows root handles tree the tree model object model get the model if model null tree set model tree model model the tree cell renderer object cell renderer get the cell renderer if cell renderer null tree set cell renderer tree cell renderer cell renderer customs the tree selection model custom selection model tree return tree
creates and builds a tree component
protected component get the view element view element element builder constant xml view if view null log debug there is no view in this scroll pane return null string ref view attribute value builder constant xml key ref return component get components get ref
gets the view component
private void set icon image frame frame element ele element element builder constant xml icon image if ele null log debug do not specified the icon image using the default image return string ref ele attribute value builder constant xml key ref image image image icon get components get ref get image frame set icon image image
sets the image to display in the minimized icon for this specified frame
protected void set shows root handles jtree tree element handles element element builder constant xml shows root handles if handles null do nothing just return using the default setting not show the root handle return else tree set shows root handles true
to decide whether display the handles for the topmost level of the tree
protected void build0 object obj set the background jcomponent obj set the foreground jcomponent obj set the font jcomponent obj set the border jcomponent obj set the size jcomponent obj set the alignment jcomponent obj put client properties jcomponent obj add listeners obj
the facility class to build the specified component object
public object build jbutton button new jbutton get localized text build0 button return button
creates and builds a jbutton object based on the specified jdom
public object build jtext field text field new jtext field build0 text field return text field
creates and builds a jtext field object based on the specified jdom
public object build string file name element attribute value builder constant xml image log debug image s file name is file name return new image icon image icon builder xml class get resource file name key
creates a image icon sets it and then return it
public object build jmenu item menu item new jmenu item get localized text build0 menu item return menu item
creates and builds a jmenu item based on the jdom element
public object build jpassword field pass field new jpassword field return pass field
creates and builds a jtext field object based on the specified jdom
protected void set enable jmenu item menu item string enable element attribute value builder constant xml enable true menu item set enabled new boolean enable boolean value
enable or disable the specified menu item
public object build jtabbed pane pane new jtabbed pane set the tabs pane return pane
build the jtabbed pane object
private icon get the icon element icon element element element builder constant xml icon if icon element null log debug there is no icon definition for this component return null string key icon element attribute value builder constant xml key ref return icon get components get key
get the icon object according to the element
public object build return create border element
creates a border component
private string get class name element class ele element element builder constant xml class if class ele null log debug user did not specify the class element return null string name class ele attribute value builder constant xml name return name
gets this actions class name
public object build radar monitor monitor radar monitor get instance build0 monitor return monitor
creates and builds the radar monitor
public object build log debug build the menu bar get key jmenu bar menu bar new jmenu bar build0 menu bar get all menu elements list menus element elements builder constant xml menu for iterator i menus iterator i has next for each menu element element menu element i next menu builder xml builder new menu builder xml menu string key builder get key jmenu comp jmenu builder build need parent this log debug binding the component comp to string to key key get components put key comp menu bar add comp return menu bar
creates and builds a menu bar
public object build jbutton button new jbutton get localized text string help id element attribute value builder constant xml help id build0 button get the help broker help broker hb online help helper get main help broker hb enable help component button help id null button add action listener new csh display help from source hb return button
creates and builds a jbutton object based on the specified jdom
public object build jtext area area new jtext area return area
creates and builds a jtext area component from the jdom element
protected void set the background jcomponent jcomp element bg ele element element builder constant xml background if bg ele null log debug user did not specify the background of this component return string color bg ele attribute value builder constant xml color jcomp set background color builder get color color
set the background color for the jcomponent according to the background
protected border create line border element element get the color for this line border default is gray string color element attribute value builder constant xml color gray return new line border color builder get color color
creates a line border object based on the information in the jdom element
public object build object pane new jeditor pane build0 pane return pane
creates and builds a jeditor pane component from the jdom element
protected border create empty border element element get the geometric parameters int top integer parse int element attribute value builder constant xml top 1 int left integer parse int element attribute value builder constant xml left 1 int bottom integer parse int element attribute value builder constant xml bottom 1 int right integer parse int element attribute value builder constant xml right 1 return new empty border top left bottom right
creates an empty border from the given jdom element
public object build object obj return null
this method will no use in this class
private void set help id component comp string help id element attribute value builder constant xml help id if help id equals log debug there is no contextual help content for this component return csh set help idstring comp help id
set the help id for the specified component
protected border create compound border element element get the inside and outside border of this compound border element outside element element builder constant xml outside element inside element element builder constant xml inside border out border create border outside border in border create border inside return new compound border out border in border
creates a compound border from the given jdom element
public hashtable get components return null
this methos is no use either
public object get root return null
no use method
protected border create titled border element element element title ele element element builder constant xml title string title title ele attribute value builder constant xml key string default value title ele element builder constant xml text get text title get localized text title default value log debug get this titled border s title title border border get the border element in the title border element border ele element element builder constant xml border if border ele null border new titled border title else border in border create border border ele border new titled border in border title return border
creates a titled border from the given jdom element
public object build jlist list new jlist build0 list object model get the model if model null list set model list model model return list
creates and builds a jlist componet
public object build string type element attribute value builder constant xml type int value integer parse int element attribute value builder constant xml value log debug building a type strut with value value component com null if type equals builder constant xml horizontal com box create horizontal strut value else com box create vertical strut value return com
creats a rigid area based on the information from the element
public object build jtool bar toolbar new jtool bar set floatable toolbar set the border toolbar add components toolbar return toolbar
creates and builds a jtool bar object
public object build need parent component builder xml parent parent parent log debug set the parent parent to string return build
creates and builds a container component by using other components in the
public object build int orientation get the orientation component comps get two components jsplit pane pane new jsplit pane orientation false comps 0 comps 1 todo setting other properties set divider pane set resize weight pane set the border pane set one touch expandable pane return pane
creates and builds a jsplit pane object
protected void set floatable jtool bar toolbar string f able element attribute value builder constant xml floatable true toolbar set floatable new boolean f able boolean value
set the given toolbars floatable properties
protected int get the orientation string orient element attribute value builder constant xml orientation the defaut is horizontal split int ret jsplit pane horizontal split if orient equals builder constant xml horizontal ret jsplit pane horizontal split else if orient equals builder constant xml vertical ret jsplit pane vertical split return ret
gets the orientation of this splitpane from the associated jdom
protected void set one touch expandable jsplit pane pane the default is false boolean b get attr boolean value element builder constant xml one touch expandable false pane set one touch expandable b
set the one touch expendable attribute according to the
public component builder xml get parent return parent
get the parent builder
protected void set resize weight jsplit pane pane element ele element element builder constant xml resize weight if ele null using the default property a value of 0 indicates the right bottom component gets all the space log debug use did not specify the resize weight property for this jsplit pane object return string value ele attribute value builder constant xml value pane set resize weight double parse double value
sets the resize weight for the specified jsplit pane object