input stringlengths 10 828 | output stringlengths 5 107 |
|---|---|
protected imandatory argument parse mandatory argument ilex strategy lexer idocument document token token lexer next token brace open brace open new brace open token get offset token get length ienvironment env parse registry get instance get parser default parse strategy default parser lexer parse brace open document env disable separate handling return new default mandatory argument env | the parse strategy has encountered a character |
protected ioptional argument parse optional argument ilex strategy lexer idocument document token token lexer next token bracket open bracket open new bracket open token get offset token get length ienvironment env parse registry get instance get parser default parse strategy default parser lexer parse bracket open document env disable separate handling return new default optional argument env | the parse strategy has encountered a character |
private void do visit by extension icommand command throws invalid registry object exception if extension factories null initialize extensions string opcode command get opcode get opcode if extension factories contains key opcode extension factories get opcode get new outline extension page visit command | let an available extensions visit the element |
public icommand builder get command builder token opcode string key opcode get image check if there is a special environment builder or use the default builder otherwise icommand builder builder null if command builder contains key key builder command builder get key else builder get command builder key if builder null return builder get the default builder should always exist if command builder contains key default builder command builder get default else builder get command builder default if builder null return builder return null | get the command builder for the given token |
private void initialize extensions throws invalid registry object exception extension factories new hash map string ilet outline visitor extension factory iconfiguration element extensions platform get extension registry get configuration elements for net sf let latex outline for iconfiguration element confelement extensions try extension factories put confelement get attribute opcode ilet outline visitor extension factory confelement create executable extension outline visitor catch core exception e latex plugin log istatus error e | initialize the extensions |
public icommand builder get command builder string key iconfiguration element extensions platform get extension registry get configuration elements for net sf let latex command builder icommand builder builder null for iconfiguration element element extensions try if key equals element get attribute opcode icommand builder factory builder factory icommand builder factory element create executable extension class builder builder factory get new command builder break catch core exception e latex plugin log istatus error e always cache the command builder when null then it is marked as not available command builder put key builder mark no special environment builder available return builder | get the command builder for the given key |
private void do visit begin command command mandatory argument visitor mand visitor new mandatory argument visitor command accept mand visitor string type get begin command type mand visitor get text if type equals no type found return do visit command type to string 6 | visit a begin command |
public ientity remove reference string key return references remove key | removes a reference from the list |
public ienvironment builder get environment builder string key check if there is a special environment builder or use the default builder otherwise ienvironment builder builder null if key null if environment builder contains key key builder environment builder get key else builder get environment builder internal key if builder null return builder get the default builder should always exist if environment builder contains key default builder environment builder get default else builder get environment builder internal default if builder null return builder return null | get the environment builder for the given key |
private ienvironment builder get environment builder internal string key iconfiguration element extensions platform get extension registry get configuration elements for net sf let latex environment builder ienvironment builder builder null for iconfiguration element element extensions try if key equals element get attribute name ienvironment builder factory builder factory ienvironment builder factory element create executable extension class builder builder factory get new environment builder break catch core exception e latex plugin log istatus error e always cache the environment builder when null then it is marked as not available environment builder put key builder return builder | get the environment builder for the given key |
protected boolean is opcode modifier string symbol return false | check if the following token is a legal modifier for this opcode |
public icommand builder get math command builder token opcode string key opcode get image check if there is a special environment builder or use the default builder otherwise icommand builder builder null if command builder contains key key builder command builder get key else builder get command builder key if builder null return builder get the default builder should always exist if command builder contains key default builder command builder get default else builder get command builder default if builder null return builder return null | get the command builder for the given token |
public void open file throws ioexception file dialog dlg new file dialog shell string temp dlg open if temp null try get the file s contents string text latex io manager get file temp file loaded so save the file name filename temp update the syntax properties to use update syntax data put the new file s data in the styled text st set text text update the title bar update title remove the content of the table table remove all delete any undo information changes clear catch ioexception e show error e get message | opens a file |
public void save file throws ioexception if filename null save file as else try save the file and update the title bar based on the new file name latex io manager save file filename st get text get bytes update title catch ioexception e show error e get message | saves a file |
public void save file as throws ioexception file dialog dlg new file dialog shell swt save if filename null dlg set file name filename string temp dlg open if temp null filename temp the extension may have changed update the syntax data accordingly try update syntax data save file catch ioexception io | saves a file under a different name |
public void print throws ioexception if printer null printer new printer options header styled text print options separator filename styled text print options separator st print printer options run | prints the document to the default printer |
public void cut throws ioexception st cut | cuts the current selection to the clipboard in the text editor |
public void copy throws ioexception st copy | copies the current selection to the clipboard in the text editor |
public void paste throws ioexception st paste | pastes the clipboards contents for text editor |
public void select all throws ioexception st select all | selects all the text in the text editor |
public void text bold throws ioexception int ranges new int 2 ranges st get selection ranges int start length start ranges 0 length ranges 1 color foreground background int fontstyle swt bold style range style new style range start length null null fontstyle st set style range style | sets the selected text bold in the text editor |
public void text underlined throws ioexception int ranges new int 2 ranges st get selection ranges int start length start ranges 0 length ranges 1 color foreground background int fontstyle swt none style range style new style range start length null null fontstyle style underline true st set style range style | underlines the selected text for texteditor |
public void undo throws ioexception make sure undo stack isn t empty if changes empty get the last change text change change text change changes pop set the flag otherwise the replace text range call will get placed on the undo stack ignore undo true replace the changed text st replace text range change get start change get length change get replaced text move the caret st set caret offset change get start scroll the screen st set top index st get line at offset change get start ignore undo false | undoes the last change in the text editor |
public void toggle word wrap throws ioexception st set word wrap st get word wrap | toggles word wrap |
public boolean get word wrap throws ioexception return st get word wrap | gets the current word wrap settings in the text editor |
public void about throws ioexception message box mb new message box shell swt icon information swt ok mb set message latex table editor help doesn t exist at the moment mb open | shows an about box for help |
private void update title throws ioexception string fn filename null untitled filename shell set text fn latex editor | updates the title bar |
public void text bold throws ioexception int ranges new int 2 ranges st get selection ranges system out println ranges 0 start ranges 0 ranges 1 length ranges 1 int start length start ranges 0 length ranges 1 color foreground background int fontstyle swt bold style range style new style range start length null null fontstyle st set style range style | sets the selected text bold |
private void update status throws ioexception show the offset into the file the total number of characters in the file the current line number 1 based and the total number of lines string buffer buf new string buffer buf append offset buf append st get caret offset buf append t chars buf append st get char count buf append t line buf append st get line at offset st get caret offset 1 buf append of buf append st get line count status set text buf to string | updates the status bar for the text editor |
private void update syntax data throws ioexception determine the extension of the current file string extension if filename null int pos filename last index of if pos 1 pos filename length 2 extension filename substring pos 1 get the syntax data for the extension sd syntax manager get syntax data extension reset the line style listener if line style listener null st remove line style listener line style listener line style listener new latex line style listener sd st add line style listener line style listener redraw the contents to reflect the new syntax data st redraw | updates the syntax data based on the filenames extension |
private void show error string error throws ioexception message box mb new message box shell swt icon error swt ok mb set message error mb open | shows an error message |
public void text underlined throws ioexception int ranges new int 2 ranges st get selection ranges system out println ranges 0 start ranges 0 ranges 1 length ranges 1 int start length start ranges 0 length ranges 1 color foreground background int fontstyle swt none style range style new style range start length null null fontstyle style underline true st set style range style | underlines the selected text |
private void update syntax data throws ioexception determine the extension of the current file string extension if filename null int pos filename last index of if pos 1 pos filename length 2 extension filename substring pos 1 get the syntax data for the extension sd syntax manager get syntax data extension reset the line style listener if line style listener null st remove line style listener line style listener line style listener new pmpe line style listener sd st add line style listener line style listener redraw the contents to reflect the new syntax data st redraw | updates the syntax data based on the filenames extension |
public string get multi line comment end return multi line comment end | gets the multiline comment end |
public void set multi line comment end string multi line comment end this multi line comment end multi line comment end | sets the multiline comment end |
public string get multi line comment start return multi line comment start | gets the multiline comment start |
public void set multi line comment start string multi line comment start this multi line comment start multi line comment start | sets the multiline comment start |
public string get punctuation return punctuation | gets the punctuation |
public void set punctuation string punctuation this punctuation punctuation | sets the punctuation |
public void show monitor if rcgs monitor frame null try rcgs monitor frame new monitor rcgs monitor frame add window listener new window adapter public void window closing window event e rcgs monitor frame dispose rcgs monitor frame null catch missing resource exception mre system err println unable to open monitor frame mre | show the agwpe monitor frame |
public void next panel if this is tabbed pane visible int next tab tabbed pane get selected index 1 if next tab tabbed pane get tab count next tab 0 tabbed pane set selected index next tab else if this is card panel visible card layout next card panel | programaticaly skip to the next component in the |
public void previous panel if this is tabbed pane visible tabbed pane set selected index tabbed pane get selected index 1 else if this is card panel visible card layout previous card panel | programaticaly go back to the previous component in the |
private int get selected component if this is card panel visible return card panel fields index of this card panel get component 0 for int i 0 i card panel get component count i if card panel get component i is visible return i else if this is tabbed pane visible return tabbed pane get selected index return 0 | this method is used when changing between jtabbed pane |
public jtabbed pane show jtabbed view int selected index this get selected component tabbed pane new jtabbed pane tabbed pane set border null tabbed pane set tab placement jtabbed pane bottom tabbed pane add tab instruments this instruments panel tabbed pane add tab hud hud tabbed pane add tab tracker this tracker panel tabbed pane add tab map this map panel tabbed pane add tab table this telemetry panel tabbed pane set selected index selected index this is card panel visible false this is tabbed pane visible true return tabbed pane | lays out the panels as a jtabbed pane which is suitable for |
public saxdriver | constructs a sax parser |
public void set markers final list markers create a new list so that we dont keep references to the param passed in this markers new array list markers | accepts the list of markers that need to be exported |
public boolean finish write the output file final boolean success write output if success if the export was successful save the state before exiting file field editor store return success | the finish button was pressed |
private boolean ensure target is valid final file file if file exists if query yes no question output exists prompt return false file delete else if file is directory final file parent file get parent file if parent null parent mkdirs return true | if the target for export does not exist then attempt to create it |
public string get channel return rec get channel | get channel information used for receiving data from turbine |
private int get cid return 100 | returns the std command for the current protocol |
private command get command cmldescription cml throws configuration exception command factory c new command factory cml this if protocol type equals protocol video c add argument value int width value name 640 c add argument value int height value name 480 c set interval get interval return c get command | this method creates a |
private int get interval int interval default interval if protocol type equals protocol osdata interval integer parse int config get configuration type os else if protocol type equals protocol snmp interval integer parse int config get configuration type snmp else if protocol type equals protocol 1 wire interval integer parse int config get configuration type 1 wire else if protocol type equals protocol video interval integer parse int config get configuration type video return interval | reads out the given configuration to determine the adapted polling |
public string get protocol name return protocol type | getter for the associated protcol name |
public void start for turbine receiver thread thread receivers logger log creating receiver thread for channel thread get channel thread start logger log start receiver thread | starts the receiver threads for each channel |
public void stop logger log stop receiver threads for turbine receiver thread thread receivers logger log deactivationg receiver thread for channel thread get channel thread set active false for turbine receiver thread thread receivers try logger log waiting for receiver thread for channel thread get channel thread join catch interrupted exception e e print stack trace | stops the receiver threads |
private void stop threads for sensor thread thread threads logger log shutdown thread for thread get protocol name thread stop | stops the polling of the sensor values |
private boolean update sensor list boolean success false try sensor list new smldescriptions agent list active sensors get descriptions success true catch saldocument exception e sensor list null e print stack trace return success | updates the attribute sensor list using the descriptions provided by the |
private void channelview channel map cmap get saltchannels system out println open channels int i 0 for string str cmap get channel list system out println i str | print all open channels of the configured source to stdout |
public transmittable read transmitable throws ioexception object received read object if received null received instanceof transmittable return transmittable received throw new ioexception can not read transmittable | tries to extract a instance of the class |
public response read response throws ioexception object received read object if received null received instanceof response return response received throw new ioexception can not read response | tries to extract a instance of the class |
private void srb fetch configuration configuration config configuration get instance logger get instance set output system out enable logging salt srbclient srb new salt srbclient config get configuration dataturbine ip config get configuration sink get saltchannels srb start menu srb stop | this method is directly called by a specific command line argument to |
private object read object throws ioexception object received null buffered input stream bufin new buffered input stream in if encoded gzipinput stream gzipin new gzipinput stream bufin xmldecoder xmldec new xmldecoder gzipin received xmldec read object xmldec close else object input stream in new object input stream bufin try received in read object catch class not found exception e e print stack trace in close return received | reads an object from the input stream |
public void write transmittable t throws ioexception if xmlenc null xmlenc write object t else oout write object t | adds a new transmitable object to the stream |
public void write response r throws ioexception if xmlenc null xmlenc write object r else oout write object r | adds a new response object to the stream |
private void menu input stream reader in new input stream reader system in buffered reader reader new buffered reader in try reader read line catch ioexception e e print stack trace | provides a menu which enables the user to interact with the system during |
public boolean send transmittable t if state get boolean ret false configuration config configuration get instance byte array output stream bos new byte array output stream transmission output stream out new transmission output stream bos config is set configuration encoded try out write t out flush out close dtcon write bos to byte array ret true catch ioexception e todo throw new exception here system err println failed to encode write the data e print stack trace finally state put return ret else return false | store a given |
public string get string key try return props get key to string catch null pointer exception e return null | provides access to the value for a given configuration key |
public boolean send string data transmittable t new transmittable send test sal t 0 cmlconstants ret type string data get bytes system current time millis return send t | packs the given |
public void send string data configuration config configuration get instance sender sender new sender config get configuration dataturbine ip config get configuration source config get configuration defaultchannel sender connect sender send data sender disconnect | send data to data turbine which was set in the constructor of this |
public boolean equals object other if get class other get class return false final password credential other credential password credential other return user name equals other credential user name java util arrays equals password other credential password | tests object for equality |
public void set linked exception exception linked exception this linked exception linked exception | set a linked exception |
public int hash code return new string password hash code 5 user name hash code | generates a hash code for this object hopefully this will be good |
public string get message string buffer s new string buffer s append super get message if cause exception null s append caused by exception is n t s append cause exception get message return s to string | obtain the detailed message for this exception and the embedded |
public void print stack trace super print stack trace if cause exception null cause exception print stack trace | print composite stack trace to system |
public void print stack trace java io print stream ps super print stack trace ps if cause exception null cause exception print stack trace ps | print composite stack trace to print stream ps |
public void print stack trace java io print writer pw super print stack trace pw if cause exception null cause exception print stack trace pw | print composite stack trace to print writer pw |
public int get format id the id we return here should be different from all other transaction implementations known ids are 1 sometimes used to denote a null transaction id 0 osi tp javadoc states osi ccr but that is a bit misleading as osi ccr doesn t even have acid properties but osi ccr and osi tp do have the same id format 1 was used by early betas 0x0101 the elba format id we use here 0x bb14 used by jonas 0x bb20 used by jonas return elba format id | return the format identifier of this transaction |
public boolean equals object obj if obj this return true if obj instanceof xid impl xid impl other xid impl obj if global id length other global id length branch id length other branch id length return false for int i 0 i global id length i if global id i other global id i return false for int i 0 i branch id length i if branch id i other branch id i return false return true return false | compare for equality |
public boolean equals object obj if obj instanceof global id global id other global id obj if hash other hash return false if global id other global id return true if global id length other global id length return false int len global id length for int i 0 i len i if global id i other global id i return false return true return false | compare for equality |
public string get base global id return base global id | mbean get set pair for field base global id |
public void set base global id final string base global id this base global id base global id base global id bytes base global id get bytes | set the value of base global id |
public boolean is pad return pad | mbean get set pair for field pad |
public void set pad boolean pad this pad pad if pad no branch qualifier new byte xid maxbqualsize end of if else no branch qualifier new byte 0 end of else | set the value of pad |
public string get message return nested throwable util get message super get message t | returns the composite throwable message |
public xid factory mbean get instance return this | mbean get set pair for field instance |
public string get message return nested throwable util get message super get message detail | returns the composite throwable message |
public void print stack trace final print stream stream if t null nested throwable parent trace enabled super print stack trace stream nested throwable util print t stream | prints the composite message and the embedded stack trace to the |
public xid new xid long count get next id string id long to string get next id int len pad xid maxgtridsize id length base global id bytes length byte global id new byte len system arraycopy base global id bytes 0 global id 0 base global id bytes length this method is deprecated but does exactly what we need in a very fast way the default conversion from string get bytes is way too expensive id get bytes 0 id length global id base global id bytes length return new xid impl global id no branch qualifier int count | describe code new xid code method here |
public void print stack trace final print stream stream if detail null nested throwable parent trace enabled super print stack trace stream nested throwable util print detail stream | prints the composite message and the embedded stack trace to the |
public void print stack trace final print writer writer if t null nested throwable parent trace enabled super print stack trace writer nested throwable util print t writer | prints the composite message and the embedded stack trace to the |
public void print stack trace final print writer writer if detail null nested throwable parent trace enabled super print stack trace writer nested throwable util print detail writer | prints the composite message and the embedded stack trace to the |
public string to string xid xid if xid instanceof xid impl return xid impl to string xid impl xid end of if else return xid to string end of else | describe code to string code method here |
public int get status throws system exception thread info ti get thread info transaction impl current ti tx if current null if current is done disassociate thread ti else return current get status return status status no transaction | return the status of the transaction associated with the currently |
public int get transaction timeout if tm null get timeout value from tm in case it was changed timeout tm get default transaction timeout return timeout | describe code get transaction timeout code method here |
public void set transaction timeout int timeout this timeout timeout if tm null update tm default timeout tm set default transaction timeout timeout | describe code set transaction timeout code method here |
public transaction get transaction throws system exception thread info ti get thread info transaction impl current ti tx if current null current is done current null disassociate thread ti return current | return the transaction currently associated with the invoking thread |
public object name get xid factory return xid factory | mbean get set pair for field xid factory |
public string get message return nested throwable util get message super get message get caused by exception | returns the composite throwable message |
public void set xid factory object name xid factory this xid factory xid factory | set the value of xid factory |
public void print stack trace final print stream stream if get caused by exception null nested throwable parent trace enabled super print stack trace stream nested throwable util print get caused by exception stream | prints the composite message and the embedded stack trace to the |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.