input
stringlengths
10
828
output
stringlengths
5
107
public void inc row int c lf only unix cr only mac crlf dos if old char r c n don t count twice on crlf return row col 0 old char c
increment row reset col
public void remove tail newline int length output length if length 0 return boolean done false do length char c output char at length switch c case case t break case n length fall through default done true while done output set length length 1
removes spaces up to and including the first newline encountered
public object put object key object value object old value value null super remove key super put key value if key instanceof string fire property change string key old value value return old value
set the value of code key code to code value code
public object get string id class type object value super get id if value null return value if parent null return parent get id type return null
get a value from the defaults table
public string get name return properties get property lookandfeel name
return a unique string that identifies this look and feel e
public void set attribute string name string value if attributes null attributes new simple attribute set string old val attributes put name value reload if change reload manager reload style old val value
set a attribute
public string get description return properties get property lookandfeel description
return a one line description of this look and feel implementation
public cgdefaults create defaults return new resource factory
create a fresh cgdefaults map
public void serious error string msg throws parse exception any error true throw new parse exception in get file stack trace msg
like report error but throws an exception
public object make cg string class name object result final resources get class name if result null result make cg class loader class name synchronized final resources if final resources contains key class name final resources put class name result else result final resources get class name end of if end of if return result
create a cg instance
public string get attribute string name return attributes null null attributes get name
return the value of an attribute
public sicon make icon string file name sicon result sicon final resources get file name if result null result make icon class loader file name synchronized final resources if final resources contains key file name final resources put file name result else result sicon final resources get file name end of if end of if return result
utility method that creates an icon from a resource
public void set selection rows int rows if rows null return tree path paths new tree path rows length for int i 0 i rows length i paths i get path for row i set selection paths paths
selects the nodes corresponding to each of the specified rows
public resource make resource string resource name resource result resource final resources get resource name if result null result make resource class loader resource name synchronized final resources if final resources contains key resource name final resources put resource name result else result resource final resources get resource name end of if end of if return result
utility method that creates a style sheet from a string
public object get string key return get defaults get key
get an object from the defaults table
public object get object string key class clazz return get defaults get key clazz
get an object from the defaults table
public component cg get cg scomponent target return component cg get defaults get target get cgclass id component cg class
get a component cg from the defaults table
public style sheet make style sheet string resource name return make style sheet class loader resource name
utility method that creates a stylesheet object from a resource
public component cg get cg string cg class id return component cg get defaults get cg class id component cg class
get a component cg from the defaults table
public layout cg get cg slayout manager target return layout cg get defaults get target get cgclass id layout cg class
get a layout manager cg from the defaults table
public border cg get cg sborder target return border cg get defaults get target get cgclass id border cg class
get a border cg from the defaults table
public style sheet get style sheet string key return style sheet get defaults get key style sheet class
get a style sheet from the defaults table
public style get style string key return style get defaults get key style class
get a style from the defaults table
public sicon get icon string key return sicon get defaults get key sicon class
get a icon from the defaults table
public object make object string value class clazz return make object class loader value clazz
utility method that creates an object of class code clazz code
public void set defaults cgdefaults defaults this defaults defaults
set the defaults table
public cgdefaults get defaults if defaults null logger warn defaults null return defaults
return the defaults table
public string remove attribute string name if attributes null attributes contains name string value attributes remove name reload reload manager reload style return value return null
remove an attribute
public look and feel get look and feel return look and feel
returns the current default look and feel
public void set attributes attribute set new attributes if new attributes null throw new illegal argument exception null not allowed reload if change reload manager reload style attributes new attributes attributes new attributes
set the attributes
public void add selection rows int rows if rows null int num rows rows length tree path paths new tree path num rows for int counter 0 counter num rows counter paths counter get path for row rows counter add selection paths paths
adds the paths at each of the specified rows to the current selection
public void set background color color set attribute style background color cssstyle sheet get attribute color
set the background color
public object get last selected path component object obj null tree path sel path get selection model get selection path if sel path null obj sel path get last path component return obj
returns the last path component in the first node of the current
public color get background return attributes null null cssstyle sheet get background attributes
return the background color
public void set foreground color color set attribute style color cssstyle sheet get attribute color
set the foreground color
public color get foreground return attributes null null cssstyle sheet get foreground attributes
return the foreground color
public void set font font f if f null set font sfont null return sfont font new sfont f get name f get style f get size set font font
set the font
public void set font sfont font if attributes null attributes new simple attribute set attributes remove style font attributes remove style font family attributes remove style font size attributes remove style font style attributes remove style font weight attributes put all cssstyle sheet get attributes font reload reload manager reload style
set the font
public int get lead selection row return get selection model get lead selection row
returns the row index of the last node added to the selection
public sfont get font return attributes null null cssstyle sheet get font attributes
return the font
public void set visible boolean visible final boolean old scomponent this visible if fire property change events if this visible visible this visible visible fire property change visible property boolean value of visible boolean value of visible else this visible visible if fire component change events visible old fire component change event new scomponent event this visible scomponent event component shown scomponent event component hidden
set the visibility
public void remove selection path tree path path get selection model remove selection path path
removes the node identified by the specified path from the current
public void set enabled boolean enabled if fire property change events if this enabled enabled this enabled enabled fire property change enabled property boolean value of enabled boolean value of enabled else this enabled enabled
set wether this component should be enabled
public void remove selection paths tree path paths get selection model remove selection paths paths
removes the nodes identified by the specified paths from the
private string capitalize string s s s trim return s substring 0 1 to upper case s substring 1
captialize a string
public void set name string name if fire property change events if is different this name name this name name fire property change name property this name name else this name name
set the name of this component
public void expand row tree path p tree state set expanded state p true if viewport null int ccount model get child count p get last path component if ccount 1 viewport height viewport y ccount else viewport y tree state get row for path p fire tree expanded p reload reload manager reload code
expand this tree row
public void write device s throws ioexception try if visible cg write s this catch ioexception io exception typical double clicks not severe logger info exception during code generation for get class get name io exception normally we should rethrow this exception shouldn t we throw io exception catch throwable t logger warn exception during code generation for get class get name t
let the code generator deletate write the components code
public string to string return param string
a string representation of this component
public boolean is cell editable int row int col if col get column count row 1 return false else return get model is cell editable row col
returns true if the cell at i row i and i column i
public void add dynamic resource dynamic resource d if dynamic resources null dynamic resources new hash map dynamic resources put d get class d
adds a dynamic ressoure
public void remove dynamic resource class dynamic resource class if dynamic resources null dynamic resources remove dynamic resource class
adds a dynamic ressoure of given class
public void mark dirty scomponent component int aspect if component instanceof sframe set sframe set frame set sframe set component while frame set get parent null frame set sframe set frame set get parent dirty frames add frame set else if component get parent frame null dirty frames add component get parent frame
marking a component dirty effectively marks the components
public scomponent get manager component if reload manager frame null reload manager frame new reload manager frame return reload manager frame
the manager component is the invisible target frame
public dynamic resource get dynamic resource class c if dynamic resources null dynamic resources new hash map return dynamic resource dynamic resources get c
severeral dynamic code ressources are attached to a code sframe code
public sframe get parent frame return this
return code this code
public void dispose if visible hide remove all
removes all code scomponents code from the pane
public void hide logger debug hide dialog if owner null owner remove dialog this
remove this dialog from its frame
protected void set frame sroot container f owner f
sets the root container in which this dialog is to be displayed
public string get event epoch return get dynamic resource dynamic code resource class get epoch
a string with the current epoch of this sframe
public long last modified check modified return last modified
returns the time this file has been
public void show scomponent c logger debug show dialog if c null c session manager get session get root frame scontainer frame null if c instanceof scontainer frame scontainer c else frame c get parent find root container while frame null frame instanceof sroot container frame frame get parent if frame null frame session manager get session get root frame if frame null throw new illegal argument exception component has no root container owner sroot container frame owner push dialog this
shows this dialog in the given sroot container
public scomponent get editor component return editor comp
if the receiver is currently editing this will return the component
public void set target resource string target resource this target resource target resource
set the target resource
private string encode low level event id string low level event id if get parent frame null if this instanceof low level event listener low level event listener this is epoch checking return get parent frame get event epoch sconstants uid divider low level event id return low level event id
encodes a low level event id for using it in a request parameter
public string get target resource if target resource null target resource get dynamic resource dynamic code resource class get id return target resource
every externalized ressource has an id
public void set base target string base target this base target base target
set the base target
public void set base target sframe other frame this knows that the frames are usually named frame id set base target frame other frame get component id
set the base target frame
public stream template source input stream i stream set input stream i stream
p generates a new stream data source with the given stream p
public void set input stream input stream i stream if i stream null throw new illegal argument exception stream is null this is invalid this i stream i stream set modification time
p sets the input stream and the modification time p
public input stream get input stream throws ioexception i stream reset return i stream
gets an input stream of the file
public page parser
constructs a new page parser
public stable cell editor get cell editor return cell editor
return the cell editor
public string get low level event id return get component id
default implementation of the method in
public void clear headers get headers clear
removes all headers
public string get expansion parameter int row boolean absolute return absolute j h row
this is for plafs only
public void add tag handler string tagname class handler class handler classes put tagname to upper case handler class
register a handler for a specific tag class
public string get selection parameter int row boolean absolute return absolute a b row
this is for plafs only
protected void set cell editor stable cell editor an editor stable cell editor old editor cell editor cell editor an editor
set the cell editor variable
public boolean finished return offset 1 name null
checked whether this tag indicates were at the end of the list
public boolean is named string name return this name null this name equals name to upper case
check name of tag
public void set editing column int a column int old editing column editing column editing column a column if editing column old editing column reload reload manager reload code
set the editing column variable
public boolean is well formed if name null return false if attr ready values null return false return well formed
check for well formedness of this tag
public sframe get parent frame return parent frame
return the parent frame
public void set editing row int a row int old editing row editing row editing row a row if editing row old editing row reload reload manager reload code
set the editing row variable
public void set columns int c int old columns columns columns c if columns old columns reload reload manager reload code
set the visible amount of columns in the textfield
public iterator attributes boolean upper case check to make sure attributes have been read if is well formed return null or return uppercase names if upper case return values key set iterator else return attrs iterator
get list of attribute names
public stable cell editor get cell editor int row int column table column table column get column model get column column stable cell editor editor table column get cell editor if editor null stable cell editor editor get default editor get column class column return editor
return an appropriate editor for the cell specified by this row and
public void set tool tip text string t tooltip t
set the tooltip text
public void set file name filter string mime filter file name filter mime filter
unlike the swing filechooser that allows to match certain file suffices
public void set style sheet style sheet s style sheet s
sets the style sheet used in certain look and feels
protected scomponent prepare editor stable cell editor editor int row int col return editor get table cell editor component this model get value at row col is row selected row true row col
prepares the specified editor using the value at the specified cell
public string get file name throws ioexception if exception null throw exception return file name
returns the filename that has been given by the user in the
public void set no caching boolean no caching this no caching no caching
typically you dont want any wings application to operate on old views meaning
public hash map get attributes return is well formed values null
return tag attributes and values
public string get file dir throws ioexception if exception null throw exception return file dir
returns the name of the system directory the file has been stored
public void remove editor stable cell editor editor get cell editor if editor null editor remove cell editor listener this remove editor comp set cell editor null set editing column 1 set editing row 1 if editor comp null editor comp set parent null end of if editor comp null
discard the editor object and return the real estate it used to
public void set focus traversal index int index focus traversal index index
the index in which the focus is traversed using tab
public string get file id throws ioexception if exception null throw exception return file id
returns the internal id of this file that has been assigned at upload
public void editing stopped change event e take in the new value stable cell editor editor get cell editor if editor null object value editor get cell editor value set value at value editing row editing column remove editor reload reload manager reload code
invoked when editing is finished