input
stringlengths
10
828
output
stringlengths
5
107
protected action make cut action return new cut action
creates a new action object for cutting
protected action get copy action if copy action null copy action make copy action return copy action
returns the action object for copy
protected action make copy action return new copy action
creates a new action object for copying
private string get property string prop string def string value def try as of version 1 0 1 02 of web start properties have to start with jnlp or javaws grrrrr try value system get property jnlp prop null catch throwable t2 value null if value null value system get property prop def catch throwable t value def return value
utility method for retrieving properties
protected action get paste action if paste action null paste action make paste action return paste action
returns the action object for paste
public class get content type return shared htmldocument class
returns the class of content type that this factory supports
public string get content type name return text
returns the name of the content type in a form suitable for
public section get section return new htmltext section
returns an instance of a section implementation suitable for this
public object id get new content object replicated object client client object id id null try htmltext shared value obj htmltext shared value client get new object htmltext shared value class null id client get object id obj catch exception e e print stack trace return id
returns the object id of a new shared instance of the content type
public void goto page url url if url null simple web browser get browser url to external form show
overriding goto page so that following a link will result in
protected action make paste action return new paste action
creates a new action object for pasting
protected action get select all action if select all action null select all action make select all action return select all action
returns the action object for select all
protected component create font name component jp kyasu awt choice name new jp kyasu awt choice name add item get tool label l variable name add item get tool label l fixed name set tool tip text get tool tip l font name name add item listener new serif font name item listener name set enabled false add sub comp name add caret disable comp name return name
overriding create font name component to give more font choices
protected action make select all action return new select all action
creates a new action object for selecting all
protected component get editor component return editor
returns a component to be embedded in the section above the lock
public void activate super activate editor reset mod button
called before the section is activated
protected void save content super save content editor reset mod button
saves content to the sections shared value
public void autosave if changed since last autosave editor is editable save content changed since last autosave false
tells the section to auto save without disturbing the user if
protected void update content shared value sv shared htmldocument shd shared htmldocument sv get value if shd null shd new shared htmldocument shd set document editor get htmltext an assertion failed gets explicitly dumped somewhere down in here try editor set htmlstyle new htmlstyle new font serif font plain 12 catch throwable e sv set value shd set name untitled else if shd get document null modifier set changing false editor set htmltext shd get document editor get rich text set text style constraint modifier modifier set changing true editor reset mod button
updates the content of the text pane based on the object wrapped by
protected jtext component get text component return null
returns the instance of jeditor pane that actually holds this
private boolean has teacher annotations text t if t null t length 0 return false for enumeration e t get attachments elements e has more elements text attachment ta text attachment e next element if ta null visualizable v ta get visualizable if v null v instanceof annotation vimage annotation vimage v is teacher return true return false
checks the given text for teacher annotations
protected action make cut action abstract action a new abstract action public void action performed action event evt editor cut clipboard a put value action name cut return a
creates a new action object for cutting
public htmltext get htmltext htmltext html text new user text style htmltext get rich text html style html text set url url html text set title title html text set background color background color html text set text color text color html text set link color link color return html text
returns the html text representation of the data written
protected action make copy action abstract action a new abstract action public void action performed action event evt editor copy clipboard a put value action name copy return a
creates a new action object for copying
protected void init htmlstyle html style if html style null throw new null pointer exception this html style html style document url null document title background color color white color light gray text color color black link color color blue this would blow away anything that isn t a mod text style set text style constraint new htmltext constraint
initializes this html document with the specified html style
protected int get list style range int result super get list style range system out println get list style range result 0 result 1 return result int start get selection start int end get selection end return new int start end
the superclasss version of get list style range tries to be too smart
protected action make paste action abstract action a new abstract action public void action performed action event evt editor paste clipboard a put value action name paste return a
returns the action object for paste
protected action make select all action abstract action a new abstract action public void action performed action event evt editor select all a put value action name select all return a
returns the action object for select all
public void clear list super clear list super decrease indent
overriding this to call both clear list and decrease indent
public object clone annotation vimage vimage annotation vimage super clone vimage timestamp timestamp share vimage text text share vimage user user share vimage is teacher is teacher share return vimage
returns a clone of this annotation
public object clone urlvimage uvi urlvimage super clone uvi url url uvi image image uvi orig width orig width uvi orig height orig height return uvi
this is problematic since we are cloned every time an image is
public void action performed action event e if section null section set has changed true super action performed e
intercepting action performed events to detect changes to formatting
public color get user color string user color c color user colors get user if c null c color list user colors size color list length user colors put user c items changed true return c
returns the color for the given user
public void set user color string user color color user colors put user color items changed true
sets the color for the given user
public color get organization color string org color c color org colors get org if c null c color list org colors size color list length org colors put org c items changed true return c
returns the color for the given organization
public void set organization color string org color color org colors put org color items changed true
sets the color for the given organization
public visualizable get visualizable return delegate get visualizable
returns the wrapped visual object
public boolean get highlight current user return highlight current user
returns true if the manager is set to show the current users text
public void set visualizable visualizable visualizable delegate set visualizable visualizable
sets the wrapped visual object to be the specified visual object
public boolean is resizable return delegate is resizable
checks if the visual object is resizable
public void set highlight current user boolean highlight current user this highlight current user highlight current user
sets whether the manager will show the current users text
public boolean is focused return delegate is focused
checks if this label is focused
public boolean get highlight by organziation return highlight by organization
returns true if the manager is set to highlight by organization
public void make font large if selection is caret return modify selection text style new user text style size modifier true modify selection text style new font size modifier true
makes the selected text large
public void set focused boolean b delegate set focused b
sets the focused state to be the specified boolean
public void set highlight by organization boolean highlight by organization this highlight by organization highlight by organization items changed true
sets whether the manager highlights by organization rather than by user
public boolean is enabled return delegate is enabled
checks if this label is enabled
public void set enabled boolean b delegate set enabled b
sets the enabled state to be the specified boolean
protected text scanner get scanner return echo char is set new echo text scanner rich text line wrap echo char locale new line break text scanner rich text line wrap locale
returns the scanner for this layout
public color get disabled foreground return delegate get disabled foreground
returns the foreground color when the label is disabled
public void set disabled foreground color c delegate set disabled foreground c
sets the foreground color when the label is disabled
public enumeration get users return user colors keys
returns an enumeration of users to which we have assigned colors
public color get disabled background return delegate get disabled background
returns the background color when the label is disabled
public enumeration get organizations return org colors keys
returns an enumeration of organizaitons to which we have assigned colors
public void set disabled background color c delegate set disabled background c
sets the background color when the label is disabled
public void make font small if selection is caret return modify selection text style new user text style size modifier false modify selection text style new font size modifier false
makes the selected text small
protected dimension get focused size dimension d get visualizable get size insets insets focused border get insets int width d width insets left insets right int height d height insets top insets bottom return new dimension width height
returns the size of the visual content with the focused dashed line
public void set size dimension d delegate set size d
resizes the label to the specified dimension
public text style derive style extended font ex font if ex font null throw new null pointer exception user text style text style user text style clone text style ex font ex font return text style
creates a new style by replicating this style with a new extended
public void set focused size dimension d delegate set focused size d
resizes the visual content with the focused dashed line border
public string to string return get class get name user user ex font to string
returns the string representation of this text style
public void paint graphics g point p paint g p null
paints the label at the specified location
protected text style based on text style base style one might think that cloning and resetting the font would be appropriate here but this is called after we ve already set our font based on another style that we re derived from so this causes problems instead just doing what our superclass does and returning this user text style ts user text style clone if base style get extended font null ts ex font base style get extended font return ts return this
creates a new style by modifying this style to be based on the
public void paint graphics g point p component comp paint g p comp true
paints the label at the specified location with the component
protected void paint graphics g point p component comp boolean raised dimension d visualizable get size insets insets focused border get insets if d width 0 d height 0 point ip new point p x insets left p y insets top if delegate is enabled if raised paint enabled g ip else paint enabled g new point ip x 1 ip y 1 else paint disabled g ip comp if focused int width d width insets left insets right int height d height insets top insets bottom if width 0 height 0 paint focused g p
paints the label at the specified location with the component
protected void paint enabled graphics g point p get visualizable paint g p
paints the label at the specified location when the label is enabled
protected void paint disabled graphics g point p paint disabled g p null
paints the label at the specified location when the label is disabled
protected void paint disabled graphics g point p component comp if disabled label1 null disabled label2 null make disabled label comp disabled label1 paint g new point p x 1 p y 1 disabled label2 paint g new point p x p y
paints the label at the specified location with the component
public boolean get state return delegate get state
returns the boolean state of the button
public void set state boolean b delegate set state b
sets the button to the specifed boolean state
public boolean can activate return delegate can activate
checks if the button has the active state and presentation
public boolean is active return delegate is active
checks if the button is active
public void set active boolean b delegate set active b
activates the button
public inline annotation edu vt cs collab cork models notebook annotation annotation this annotation annotation set icon use different icon image for teacher and student
construct from an existing annotation ie read from the storage handler
public inline annotation string content user registry reg user registry get instance string user name reg get primary user annotation new edu vt cs collab cork models notebook annotation content user name set icon
construct a new annotation ie
private void set icon image icon image icon new image icon this get class get resource get icon path set icon image icon if original size null image icon null original size new dimension image icon get icon width image icon get icon height
set the image icon of this inline annotation based on the role of
public string get tool tip text object content annotation get content if content null return null string content string content to string string tokenizer st new string tokenizer content string int count 0 string buffer sb new string buffer while st has more tokens count 3 sb append st next token count if st has more tokens sb append return sb to string
the tool tip text of an annotation is its first 3 words
private string format date date d simple date format formatter new simple date format m d yy if d get time system current time millis one day return on old format d else return at today format d today
try to use a simple format for date representation when displaying
public string get user return annotation get user
get the author of the annotation
protected jbutton create toolbar button string key return jbutton create toolbar button key false
create a button to go inside of the toolbar
public class get content type return shared styled document class
returns the class of content type that this factory supports
public string get content type name return
returns the name of the content type in a form suitable for
public section get section return new styled text section
returns an instance of a section implementation suitable for this
public object id get new content object replicated object client client object id id null try styled text shared value obj styled text shared value client get new object styled text shared value class null id client get object id obj catch exception e e print stack trace return id
returns the object id of a new shared instance of the content type
protected component get editor component return pane container
returns a component to be embedded in the section above the lock
protected jtext component get text component return pane
returns the instance of jeditor pane that actually holds this
protected action get cut action return ah get cut action
returns the action object for cut
protected action get copy action if copy action null copy action new abstract action public void action performed action event evt if pane is enabled pane is editable ah get copy action action performed evt else pane copy copy action put value action name copy copy action set enabled true return copy action
returns the action object for copy
protected action get select all action action a new abstract action public void action performed action event evt pane select all return a
returns the action object for select all
public class get content type return web content model class
returns the class of content type that this factory supports
public string get content type name return web page
returns the name of the content type in a form suitable for
public section get section return new browser section
returns an instance of a section implementation suitable for this
public string get default section name return web page
returns a default name for a newly created section
public void collapse browser html clear browser clear cache collapsed true
called when the section container needs to free resources
public string authenticate string user id string password this should be simplified pc auth can just return a string principal p pc authenticate user id password if p null return p get name return null
authenticates the given user with the given password returning
public void activate if collapsed reset content browser reload
called before the sections component as returned by get view is
public void add organization string org name if org name null organizations contains org name organizations add element org name
adds an organization name
public user get user string user id user u get user from cache user id if u null try u new profile user user id add user to cache user id u catch illegal argument exception e u null return u
returns a user object with profile data for the given user or
public void remove organization string org name if org name null organizations remove element org name
removes an organization name
public component get view return browser
returns a component that the section container can use to display the