proj_name
stringclasses
131 values
relative_path
stringlengths
30
228
class_name
stringlengths
1
68
func_name
stringlengths
1
48
masked_class
stringlengths
78
9.82k
func_body
stringlengths
46
9.61k
len_input
int64
29
2.01k
len_output
int64
14
1.94k
total
int64
55
2.05k
relevant_context
stringlengths
0
38.4k
LibrePDF_OpenPDF
OpenPDF/pdf-swing/src/main/java/com/lowagie/rups/model/XfaFile.java
XfaFile
writeTo
class XfaFile implements OutputStreamResource { /** * The X4J Document object (XML). */ protected Document xfaDocument; /** * Constructs an XFA file from an OutputStreamResource. This resource can be an XML file or a node in a RUPS * application. * * @param resource the XFA r...
if (xfaDocument == null) { return; } OutputFormat format = new OutputFormat(" ", true); XMLWriter writer = new XMLWriter(os, format); writer.write(xfaDocument);
381
59
440
<no_super_class>
LibrePDF_OpenPDF
OpenPDF/pdf-swing/src/main/java/com/lowagie/rups/view/Console.java
Console
update
class Console implements Observer { /** * Single Console instance. */ private static Console console = null; /** * Custom PrintStream. */ PrintStream printStream; /** * Custom OutputStream. */ PipedOutputStream poCustom; /** * Custom InputStream. */ ...
if (RupsMenuBar.CLOSE.equals(obj)) { textArea.setText(""); } if (RupsMenuBar.OPEN.equals(obj)) { textArea.setText(""); }
1,562
60
1,622
<no_super_class>
LibrePDF_OpenPDF
OpenPDF/pdf-swing/src/main/java/com/lowagie/rups/view/MessageAction.java
MessageAction
actionPerformed
class MessageAction implements ActionListener { public void actionPerformed(ActionEvent evt) {<FILL_FUNCTION_BODY>} }
String message = "Unspecified message"; if (RupsMenuBar.ABOUT.equals(evt.getActionCommand())) { message = "RUPS is a tool by 1T3XT BVBA.\nIt uses iText, a Free Java-PDF Library.\nVisit http://www.1t3xt.com/ for more info."; } else if (RupsMenuBar.VERSION.equals(evt.getActionCommand(...
38
144
182
<no_super_class>
LibrePDF_OpenPDF
OpenPDF/pdf-swing/src/main/java/com/lowagie/rups/view/RupsMenuBar.java
RupsMenuBar
update
class RupsMenuBar extends JMenuBar implements Observer { /** * Caption for the file menu. */ public static final String FILE_MENU = "File"; /** * Caption for "Open file". */ public static final String OPEN = "Open"; /** * Caption for "Close file". */ public static ...
if (OPEN.equals(obj)) { enableItems(true); return; } if (CLOSE.equals(obj)) { enableItems(false); return; } if (FILE_MENU.equals(obj)) { fileChooserAction.actionPerformed(null); }
939
88
1,027
<methods>public void <init>() ,public javax.swing.JMenu add(javax.swing.JMenu) ,public void addNotify() ,public javax.accessibility.AccessibleContext getAccessibleContext() ,public java.awt.Component getComponent() ,public java.awt.Component getComponentAtIndex(int) ,public int getComponentIndex(java.awt.Component) ,pu...
LibrePDF_OpenPDF
OpenPDF/pdf-swing/src/main/java/com/lowagie/rups/view/icons/IconFetcher.java
IconFetcher
getIcon
class IconFetcher { /** * Cache with icons. */ protected static HashMap<String, Icon> cache = new HashMap<>(); /** * Gets an Icon with a specific name. * * @param filename the filename of the Icon. * @return an Icon */ public static Icon getIcon(String filename) {<FI...
if (filename == null) { return null; } Icon icon = cache.get(filename); if (icon == null) { try { icon = new ImageIcon(IconFetcher.class.getResource(filename)); cache.put(filename, icon); } catch (Exception e) { ...
111
118
229
<no_super_class>
LibrePDF_OpenPDF
OpenPDF/pdf-swing/src/main/java/com/lowagie/rups/view/icons/IconTreeCellRenderer.java
IconTreeCellRenderer
getTreeCellRendererComponent
class IconTreeCellRenderer extends DefaultTreeCellRenderer { /** * a serial version UID. */ private static final long serialVersionUID = 6513462839504342074L; /** * @see javax.swing.tree.DefaultTreeCellRenderer#getTreeCellRendererComponent(javax.swing.JTree, java.lang.Object, * boolean...
super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus); if (value instanceof IconTreeNode) { IconTreeNode node = (IconTreeNode) value; setIcon(node.getIcon()); } return this;
168
73
241
<methods>public void <init>() ,public void firePropertyChange(java.lang.String, byte, byte) ,public void firePropertyChange(java.lang.String, char, char) ,public void firePropertyChange(java.lang.String, short, short) ,public void firePropertyChange(java.lang.String, int, int) ,public void firePropertyChange(java.lang....
LibrePDF_OpenPDF
OpenPDF/pdf-swing/src/main/java/com/lowagie/rups/view/itext/FormTree.java
FormTree
valueChanged
class FormTree extends JTree implements TreeSelectionListener, Observer { /** * A serial version UID. */ private static final long serialVersionUID = -3584003547303700407L; /** * Nodes in the FormTree correspond with nodes in the main PdfTree. */ protected PdfReaderController contro...
if (controller == null) { return; } FormTreeNode selectednode = (FormTreeNode) this.getLastSelectedPathComponent(); if (selectednode == null) { return; } PdfObjectTreeNode node = selectednode.getCorrespondingPdfObjectNode(); if (node != nu...
1,616
100
1,716
<methods>public void <init>() ,public void <init>(java.lang.Object[]) ,public void <init>(Vector<?>) ,public void <init>(Hashtable<?,?>) ,public void <init>(javax.swing.tree.TreeNode) ,public void <init>(javax.swing.tree.TreeModel) ,public void <init>(javax.swing.tree.TreeNode, boolean) ,public void addSelectionInterva...
LibrePDF_OpenPDF
OpenPDF/pdf-swing/src/main/java/com/lowagie/rups/view/itext/OutlineTree.java
OutlineTree
valueChanged
class OutlineTree extends JTree implements TreeSelectionListener, Observer { /** * A serial version uid. */ private static final long serialVersionUID = 5646572654823301007L; /** * Nodes in the FormTree correspond with nodes in the main PdfTree. */ protected PdfReaderController cont...
if (controller == null) { return; } OutlineTreeNode selectednode = (OutlineTreeNode) this.getLastSelectedPathComponent(); PdfObjectTreeNode node = selectednode.getCorrespondingPdfObjectNode(); if (node != null) { controller.selectNode(node); } ...
714
85
799
<methods>public void <init>() ,public void <init>(java.lang.Object[]) ,public void <init>(Vector<?>) ,public void <init>(Hashtable<?,?>) ,public void <init>(javax.swing.tree.TreeNode) ,public void <init>(javax.swing.tree.TreeModel) ,public void <init>(javax.swing.tree.TreeNode, boolean) ,public void addSelectionInterva...
LibrePDF_OpenPDF
OpenPDF/pdf-swing/src/main/java/com/lowagie/rups/view/itext/PagesTable.java
PagesTable
update
class PagesTable extends JTable implements JTableAutoModelInterface, Observer { /** * A serial version UID. */ private static final long serialVersionUID = -6523261089453886508L; /** * A list with page nodes. */ protected ArrayList<PdfPageTreeNode> list = new ArrayList<>(); /** ...
if (obj == null) { list = new ArrayList<>(); repaint(); return; } if (obj instanceof ObjectLoader) { ObjectLoader loader = (ObjectLoader) obj; String[] pagelabels = PdfPageLabels.getPageLabels(loader.getReader()); int i = 0...
735
377
1,112
<methods>public void <init>() ,public void <init>(javax.swing.table.TableModel) ,public void <init>(javax.swing.table.TableModel, javax.swing.table.TableColumnModel) ,public void <init>(int, int) ,public void <init>(Vector<? extends Vector#RAW>, Vector<?>) ,public void <init>(java.lang.Object[][], java.lang.Object[]) ,...
LibrePDF_OpenPDF
OpenPDF/pdf-swing/src/main/java/com/lowagie/rups/view/itext/PdfObjectPanel.java
PdfObjectPanel
render
class PdfObjectPanel extends JPanel implements Observer { /** * Name of a panel in the CardLayout. */ private static final String TEXT = "text"; /** * Name of a panel in the CardLayout. */ private static final String TABLE = "table"; /** * a serial version id. */ p...
if (object == null) { text.setText(null); layout.show(this, TEXT); this.repaint(); text.repaint(); return; } switch (object.type()) { case PdfObject.DICTIONARY: case PdfObject.STREAM: table.setMo...
525
205
730
<methods>public void <init>() ,public void <init>(java.awt.LayoutManager) ,public void <init>(boolean) ,public void <init>(java.awt.LayoutManager, boolean) ,public javax.accessibility.AccessibleContext getAccessibleContext() ,public javax.swing.plaf.PanelUI getUI() ,public java.lang.String getUIClassID() ,public void s...
LibrePDF_OpenPDF
OpenPDF/pdf-swing/src/main/java/com/lowagie/rups/view/itext/PdfTree.java
PdfTree
update
class PdfTree extends JTree implements Observer { /** * a serial version UID */ private static final long serialVersionUID = 7545804447512085734L; /** * The root of the PDF tree. */ protected PdfTrailerTreeNode root; /** * Constructs a PDF tree. */ public PdfTree(...
if (obj == null) { root = new PdfTrailerTreeNode(); } setModel(new DefaultTreeModel(root)); repaint();
426
44
470
<methods>public void <init>() ,public void <init>(java.lang.Object[]) ,public void <init>(Vector<?>) ,public void <init>(Hashtable<?,?>) ,public void <init>(javax.swing.tree.TreeNode) ,public void <init>(javax.swing.tree.TreeModel) ,public void <init>(javax.swing.tree.TreeNode, boolean) ,public void addSelectionInterva...
LibrePDF_OpenPDF
OpenPDF/pdf-swing/src/main/java/com/lowagie/rups/view/itext/StreamTextArea.java
StreamTextArea
render
class StreamTextArea extends JScrollPane implements Observer { /** * a serial version id. */ private static final long serialVersionUID = 1302283071087762494L; /** * The text area with the content stream. */ protected JTextArea text; /** * Constructs a StreamTextArea. ...
if (object instanceof PRStream) { PRStream stream = (PRStream) object; try { TextAreaOutputStream taos = new TextAreaOutputStream(text); taos.write(PdfReader.getStreamBytes(stream)); //text.addMouseListener(new StreamEditorAction(stream));...
267
140
407
<methods>public void <init>() ,public void <init>(java.awt.Component) ,public void <init>(int, int) ,public void <init>(java.awt.Component, int, int) ,public javax.swing.JScrollBar createHorizontalScrollBar() ,public javax.swing.JScrollBar createVerticalScrollBar() ,public javax.accessibility.AccessibleContext getAcces...
LibrePDF_OpenPDF
OpenPDF/pdf-swing/src/main/java/com/lowagie/rups/view/itext/XRefTable.java
XRefTable
update
class XRefTable extends JTable implements JTableAutoModelInterface, Observer { /** * A serial version UID. */ private static final long serialVersionUID = -382184619041375537L; /** * The factory that can produce all the indirect objects. */ protected IndirectObjectFactory objects; ...
if (obj == null) { objects = null; repaint(); return; } if (observable instanceof PdfReaderController && obj instanceof ObjectLoader) { ObjectLoader loader = (ObjectLoader) obj; objects = loader.getObjects(); ...
1,047
113
1,160
<methods>public void <init>() ,public void <init>(javax.swing.table.TableModel) ,public void <init>(javax.swing.table.TableModel, javax.swing.table.TableColumnModel) ,public void <init>(int, int) ,public void <init>(Vector<? extends Vector#RAW>, Vector<?>) ,public void <init>(java.lang.Object[][], java.lang.Object[]) ,...
LibrePDF_OpenPDF
OpenPDF/pdf-swing/src/main/java/com/lowagie/rups/view/itext/treenodes/XdpTreeNode.java
XdpTreeNode
toString
class XdpTreeNode extends IconTreeNode { /** * A serial version UID. */ private static final long serialVersionUID = -6431790925424045933L; /** * Constructs an XdpTreeNode * * @param node the XML node */ public XdpTreeNode(Node node) { super(null, node); i...
Node node = getNode(); if (node instanceof Element) { Element e = (Element) node; return e.getName(); } if (node instanceof Attribute) { Attribute a = (Attribute) node; StringBuilder buf = new StringBuilder(); buf.append(a.getN...
464
263
727
<methods>public void <init>(java.lang.String) ,public void <init>(java.lang.String, java.lang.Object) ,public javax.swing.Icon getIcon() <variables>protected javax.swing.Icon icon,private static final long serialVersionUID
LibrePDF_OpenPDF
OpenPDF/pdf-swing/src/main/java/com/lowagie/rups/view/itext/treenodes/XfaTreeNode.java
XfaTreeNode
writeTo
class XfaTreeNode extends FormTreeNode implements OutputStreamResource { /** * Start sequence of an artificial boundary between XFA fragments added by RUPS */ public static final byte[] BOUNDARY_START = "<!--\nRUPS XFA individual packet: end of [".getBytes(); /** * Middle sequence of an arti...
Enumeration children = this.children(); FormTreeNode node; PRStream stream; String key = null; String tmp = null; while (children.hasMoreElements()) { node = (FormTreeNode) children.nextElement(); if (key != null) { os.write(BOUNDA...
575
214
789
<methods>public void <init>() ,public void <init>(com.lowagie.rups.view.itext.treenodes.PdfObjectTreeNode) ,public com.lowagie.rups.view.itext.treenodes.PdfObjectTreeNode getCorrespondingPdfObjectNode() <variables>protected com.lowagie.rups.view.itext.treenodes.PdfObjectTreeNode object_node,private static final long se...
LibrePDF_OpenPDF
OpenPDF/pdf-swing/src/main/java/com/lowagie/rups/view/models/DictionaryTableModel.java
DictionaryTableModel
getValueAt
class DictionaryTableModel extends AbstractTableModel { /** * A serial version UID. */ private static final long serialVersionUID = -8835275996639701776L; /** * The PDF dictionary. */ protected PdfDictionary dictionary; /** * An ArrayList with the dictionary keys. */ ...
switch (columnIndex) { case 0: return keys.get(rowIndex); case 1: return dictionary.get(keys.get(rowIndex)); default: return null; }
416
59
475
<methods>public void addTableModelListener(javax.swing.event.TableModelListener) ,public int findColumn(java.lang.String) ,public void fireTableCellUpdated(int, int) ,public void fireTableChanged(javax.swing.event.TableModelEvent) ,public void fireTableDataChanged() ,public void fireTableRowsDeleted(int, int) ,public v...
LibrePDF_OpenPDF
OpenPDF/pdf-swing/src/main/java/com/lowagie/rups/view/models/PdfArrayTableModel.java
PdfArrayTableModel
getValueAt
class PdfArrayTableModel extends AbstractTableModel { /** * A serial version UID. */ private static final long serialVersionUID = 4665485782853993708L; /** * The PDF array. */ protected PdfArray array; /** * Creates the TableModel. * * @param array a PDF array ...
switch (columnIndex) { case 0: return array.getPdfObject(rowIndex); default: return null; }
357
42
399
<methods>public void addTableModelListener(javax.swing.event.TableModelListener) ,public int findColumn(java.lang.String) ,public void fireTableCellUpdated(int, int) ,public void fireTableChanged(javax.swing.event.TableModelEvent) ,public void fireTableDataChanged() ,public void fireTableRowsDeleted(int, int) ,public v...
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/toolbox/Versions.java
Versions
initialize
class Versions extends JFrame { /** * The serial version UID of this class. */ private static final long serialVersionUID = 2925242862240301106L; /** * A label with info about the library, JVM,... */ JLabel library_versions = new JLabel(); /** * The table with all...
this.getContentPane().setLayout(new BorderLayout()); scroll_versions.setViewportView(plugin_versions); library_versions.setIcon(new ImageIcon(Versions.class.getResource( "1t3xt.gif"))); this.getContentPane().add(library_versions, BorderLayout.NORTH); this.getCont...
928
621
1,549
<methods>public void <init>() throws java.awt.HeadlessException,public void <init>(java.awt.GraphicsConfiguration) ,public void <init>(java.lang.String) throws java.awt.HeadlessException,public void <init>(java.lang.String, java.awt.GraphicsConfiguration) ,public javax.accessibility.AccessibleContext getAccessibleConte...
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/toolbox/arguments/AbstractArgument.java
AbstractArgument
getUsage
class AbstractArgument implements ActionListener, PropertyChangeListener { protected PropertyChangeSupport pcs = new PropertyChangeSupport(this); /** * value of the argument. */ protected Object value = null; /** * short name for the argument. */ protected String name; /** ...
StringBuilder buf = new StringBuilder(" "); buf.append(name); buf.append(" - "); buf.append(description); buf.append('\n'); return buf.toString();
899
56
955
<no_super_class>
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/toolbox/arguments/BitsetArgument.java
BitsetArgument
actionPerformed
class BitsetArgument extends AbstractArgument { /** * These are the different options that can be true or false. */ private JCheckBox[] options; /** * Constructs an BitsetArgument. * * @param tool the tool that needs this argument * @param name the name of the a...
Object[] message = new Object[1 + options.length]; message[0] = "Check the options you need:"; System.arraycopy(options, 0, message, 1, options.length); int result = JOptionPane.showOptionDialog( tool.getInternalFrame(), message, descripti...
403
205
608
<methods>public void <init>() ,public void <init>(com.lowagie.toolbox.AbstractTool, java.lang.String, java.lang.String, java.lang.Object) ,public abstract void actionPerformed(java.awt.event.ActionEvent) ,public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener) ,public java.lang.Object getA...
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/toolbox/arguments/ColorArgument.java
ColorArgument
getArgument
class ColorArgument extends AbstractArgument { public ColorArgument() { super(); } public ColorArgument(AbstractTool tool, String name, String description) { super(tool, name, description, null); } public Object getArgument() throws InstantiationException {<FILL_FUNCTION_BODY>} ...
if (value == null) { return null; } try { return Color.decode(value.toString()); } catch (Exception e) { throw new InstantiationException(e.getMessage()); }
244
60
304
<methods>public void <init>() ,public void <init>(com.lowagie.toolbox.AbstractTool, java.lang.String, java.lang.String, java.lang.Object) ,public abstract void actionPerformed(java.awt.event.ActionEvent) ,public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener) ,public java.lang.Object getA...
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/toolbox/arguments/FileArgument.java
FileArgument
actionPerformed
class FileArgument extends AbstractArgument { /** * a filter to put on the FileChooser. */ protected FileFilter filter; /** * indicates if the argument has to point to a new or an existing file. */ protected boolean newFile; /** * the label */ PdfInformationPanel l...
JFileChooser fc = new JFileChooser(); if (filter != null) { fc.setFileFilter(filter); if (filter instanceof DirFilter) { fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); } } if (label != null) { fc.setAccessory(labe...
701
215
916
<methods>public void <init>() ,public void <init>(com.lowagie.toolbox.AbstractTool, java.lang.String, java.lang.String, java.lang.Object) ,public abstract void actionPerformed(java.awt.event.ActionEvent) ,public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener) ,public java.lang.Object getA...
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/toolbox/arguments/FileArrayArgument.java
FileArrayArgument
getArgument
class FileArrayArgument extends AbstractArgument { FileList fileList1 = new FileList(); public FileArrayArgument() { super(); try { jbInit(); } catch (Exception ex) { ex.printStackTrace(); } } public FileArrayArgument(AbstractTool tool, String n...
if (value == null) { return null; } try { return value; } catch (Exception e) { throw new InstantiationException(e.getMessage()); }
516
54
570
<methods>public void <init>() ,public void <init>(com.lowagie.toolbox.AbstractTool, java.lang.String, java.lang.String, java.lang.Object) ,public abstract void actionPerformed(java.awt.event.ActionEvent) ,public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener) ,public java.lang.Object getA...
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/toolbox/arguments/FloatArgument.java
FloatArgument
actionPerformed
class FloatArgument extends AbstractArgument { public FloatArgument() { super(); } public FloatArgument(AbstractTool tool, String name, String description) { super(tool, name, description, null); } /** * Invoked when an action occurs. * * @param e ActionEvent *...
CustomDialog cd = new CustomDialog("Enter a value for " + name + ":", CustomDialog.instantiateFloatDocument()); setValue(cd.showInputDialog(this.getValue() == null ? "0" : this.getValue().toString()));
114
63
177
<methods>public void <init>() ,public void <init>(com.lowagie.toolbox.AbstractTool, java.lang.String, java.lang.String, java.lang.Object) ,public abstract void actionPerformed(java.awt.event.ActionEvent) ,public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener) ,public java.lang.Object getA...
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/toolbox/arguments/ImageArgument.java
ImageArgument
actionPerformed
class ImageArgument extends AbstractArgument { /** * a filter to put on the FileChooser. */ private FileFilter filter; /** * Constructs a FileArgument. * * @param tool the tool that needs this argument * @param name the name of the argument * @param descrip...
JFileChooser fc = new JFileChooser(); if (filter != null) { fc.setFileFilter(filter); } fc.showOpenDialog(tool.getInternalFrame()); try { setValue(fc.getSelectedFile().getAbsolutePath()); } catch (NullPointerException npe) { }
429
94
523
<methods>public void <init>() ,public void <init>(com.lowagie.toolbox.AbstractTool, java.lang.String, java.lang.String, java.lang.Object) ,public abstract void actionPerformed(java.awt.event.ActionEvent) ,public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener) ,public java.lang.Object getA...
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/toolbox/arguments/IntegerArgument.java
IntegerArgument
actionPerformed
class IntegerArgument extends AbstractArgument { /** * Constructs a IntegerArgument. */ public IntegerArgument() { } /** * Constructs a IntegerArgument. * * @param tool the tool that needs this argument * @param name the name of the argument * @param de...
CustomDialog cd = new CustomDialog("Enter a value for " + name + ":", CustomDialog.instantiateIntegerDocument()); setValue(cd.showInputDialog(this.getValue() == null ? "0" : this.getValue().toString()));
190
65
255
<methods>public void <init>() ,public void <init>(com.lowagie.toolbox.AbstractTool, java.lang.String, java.lang.String, java.lang.Object) ,public abstract void actionPerformed(java.awt.event.ActionEvent) ,public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener) ,public java.lang.Object getA...
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/toolbox/arguments/OptionArgument.java
OptionArgument
actionPerformed
class OptionArgument extends AbstractArgument { private TreeMap<String, Entry> options = new TreeMap<>(); /** * Constructs an OptionArgument. * * @param tool the tool that needs this argument * @param name the name of the argument * @param description the description of...
Object[] message = new Object[2]; message[0] = "Choose one of the following options:"; JComboBox<Entry> cb = new JComboBox<>(); for (Entry entry : options.values()) { cb.addItem(entry); } message[1] = cb; int result = JOptionPane.showOptionDialog( ...
996
188
1,184
<methods>public void <init>() ,public void <init>(com.lowagie.toolbox.AbstractTool, java.lang.String, java.lang.String, java.lang.Object) ,public abstract void actionPerformed(java.awt.event.ActionEvent) ,public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener) ,public java.lang.Object getA...
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/toolbox/arguments/PageSizeArgument.java
PageSizeArgument
getUsage
class PageSizeArgument extends OptionArgument { private TreeMap<String, String> options = new TreeMap<>(); /** * Constructs an OptionArgument. * * @param tool the tool that needs this argument * @param name the name of the argument * @param description the description of...
StringBuilder buf = new StringBuilder(" "); buf.append(name); buf.append(" - "); buf.append(description); buf.append('\n'); buf.append(" possible options:\n"); String s; for (Object o : options.keySet()) { s = (String) o; buf....
780
124
904
<methods>public void <init>(com.lowagie.toolbox.AbstractTool, java.lang.String, java.lang.String) ,public void actionPerformed(java.awt.event.ActionEvent) ,public void addOption(java.lang.Object, java.lang.Object) ,public java.lang.Object getArgument() throws java.lang.InstantiationException,public java.lang.String get...
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/toolbox/arguments/StringArgument.java
StringArgument
actionPerformed
class StringArgument extends AbstractArgument { /** * Constructs a StringArgument. */ public StringArgument() { } /** * Constructs a StringArgument. * * @param tool the tool that needs this argument * @param name the name of the argument * @param descri...
CustomDialog cd = new CustomDialog("Enter a value for " + name + ":", CustomDialog.instantiateStringDocument()); setValue(cd.showInputDialog(this.getValue() == null ? "" : this.getValue().toString()));
190
61
251
<methods>public void <init>() ,public void <init>(com.lowagie.toolbox.AbstractTool, java.lang.String, java.lang.String, java.lang.Object) ,public abstract void actionPerformed(java.awt.event.ActionEvent) ,public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener) ,public java.lang.Object getA...
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/toolbox/arguments/filters/ImageFilter.java
ImageFilter
accept
class ImageFilter extends FileFilter { /** * Array with all kinds of image extensions. */ public static final String[] IMAGES = new String[8]; static { IMAGES[0] = ".jpg"; IMAGES[1] = ".jpeg"; IMAGES[2] = ".png"; IMAGES[3] = ".gif"; IMAGES[4] = ".bmp"; ...
if (f.isDirectory()) { return true; } for (int i = 0; i < IMAGES.length; i++) { if (filter[i] && f.getName().toLowerCase().endsWith(IMAGES[i])) { return true; } } return false;
642
85
727
<methods>public abstract boolean accept(java.io.File) ,public abstract java.lang.String getDescription() <variables>
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/toolbox/plugins/Bookmarks2XML.java
Bookmarks2XML
execute
class Bookmarks2XML extends AbstractTool { static { addVersion("$Id: Bookmarks2XML.java 3271 2008-04-18 20:39:42Z xlv $"); } /** * Constructs an Bookmarks2XML object. */ public Bookmarks2XML() { arguments.add(new FileArgument(this, "pdffile", "the PDF from which you want to e...
try { if (getValue("xmlfile") == null) { throw new InstantiationException("You need to choose an xml file"); } if (getValue("pdffile") == null) { throw new InstantiationException("You need to choose a source PDF file"); } ...
620
270
890
<methods>public void <init>() ,public void actionPerformed(java.awt.event.ActionEvent) ,public abstract void execute() ,public ArrayList<com.lowagie.toolbox.arguments.AbstractArgument> getArguments() ,public javax.swing.JInternalFrame getInternalFrame() ,public javax.swing.JMenuBar getMenubar() ,public java.lang.String...
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/toolbox/plugins/Burst.java
Burst
execute
class Burst extends AbstractTool { static { addVersion("$Id: Burst.java 3271 2008-04-18 20:39:42Z xlv $"); } /** * Constructs a Burst object. */ public Burst() { FileArgument f = new FileArgument(this, "srcfile", "The file you want to split", false, new PdfFilter()); ...
try { if (getValue("srcfile") == null) { throw new InstantiationException("You need to choose a sourcefile"); } File src = (File) getValue("srcfile"); File directory = src.getParentFile(); String name = src.getName(); name ...
580
560
1,140
<methods>public void <init>() ,public void actionPerformed(java.awt.event.ActionEvent) ,public abstract void execute() ,public ArrayList<com.lowagie.toolbox.arguments.AbstractArgument> getArguments() ,public javax.swing.JInternalFrame getInternalFrame() ,public javax.swing.JMenuBar getMenubar() ,public java.lang.String...
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/toolbox/plugins/CompressDecompressPageContent.java
CompressDecompressPageContent
execute
class CompressDecompressPageContent extends AbstractTool { static { addVersion("$Id: CompressDecompressPageContent.java 3271 2008-04-18 20:39:42Z xlv $"); } /** * Constructs a Burst object. */ public CompressDecompressPageContent() { FileArgument f = new FileArgument(this, "s...
try { if (getValue("srcfile") == null) { throw new InstantiationException("You need to choose a sourcefile"); } if (getValue("destfile") == null) { throw new InstantiationException("You need to choose a destination file"); } ...
727
298
1,025
<methods>public void <init>() ,public void actionPerformed(java.awt.event.ActionEvent) ,public abstract void execute() ,public ArrayList<com.lowagie.toolbox.arguments.AbstractArgument> getArguments() ,public javax.swing.JInternalFrame getInternalFrame() ,public javax.swing.JMenuBar getMenubar() ,public java.lang.String...
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/toolbox/plugins/Concat.java
Concat
main
class Concat extends AbstractTool { static { addVersion("$Id: Concat.java 3271 2008-04-18 20:39:42Z xlv $"); } /** * Constructs a Concat object. */ public Concat() { menuoptions = MENU_EXECUTE | MENU_EXECUTE_SHOW; arguments.add(new FileArgument(this, "srcfile1", "The ...
Concat tool = new Concat(); if (args.length < 2) { System.err.println(tool.getUsage()); } tool.setMainArguments(args); tool.execute();
1,251
56
1,307
<methods>public void <init>() ,public void actionPerformed(java.awt.event.ActionEvent) ,public abstract void execute() ,public ArrayList<com.lowagie.toolbox.arguments.AbstractArgument> getArguments() ,public javax.swing.JInternalFrame getInternalFrame() ,public javax.swing.JMenuBar getMenubar() ,public java.lang.String...
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/toolbox/plugins/ConcatN.java
ConcatN
execute
class ConcatN extends AbstractTool { static { addVersion("$Id: ConcatN.java 3271 2008-04-18 20:39:42Z xlv $"); } /** * Constructs a Concat object. */ public ConcatN() { menuoptions = MENU_EXECUTE | MENU_EXECUTE_SHOW; arguments.add(new FileArrayArgument(this, "srcfiles...
try { File[] files; if (getValue("srcfiles") == null) { throw new InstantiationException( "You need to choose a list of sourcefiles"); } files = ((File[]) getValue("srcfiles")); if (getValue("destfile") == null)...
625
595
1,220
<methods>public void <init>() ,public void actionPerformed(java.awt.event.ActionEvent) ,public abstract void execute() ,public ArrayList<com.lowagie.toolbox.arguments.AbstractArgument> getArguments() ,public javax.swing.JInternalFrame getInternalFrame() ,public javax.swing.JMenuBar getMenubar() ,public java.lang.String...
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/toolbox/plugins/Decrypt.java
Decrypt
createFrame
class Decrypt extends AbstractTool { static { addVersion("$Id: Decrypt.java 3271 2008-04-18 20:39:42Z xlv $"); } /** * Constructs a Decrypt object. */ public Decrypt() { arguments.add(new FileArgument(this, "srcfile", "The file you want to decrypt", false, new PdfFilter()));...
internalFrame = new JInternalFrame("Decrypt", true, false, true); internalFrame.setSize(300, 80); internalFrame.setJMenuBar(getMenubar()); System.out.println("=== Decrypt OPENED ===");
808
69
877
<methods>public void <init>() ,public void actionPerformed(java.awt.event.ActionEvent) ,public abstract void execute() ,public ArrayList<com.lowagie.toolbox.arguments.AbstractArgument> getArguments() ,public javax.swing.JInternalFrame getInternalFrame() ,public javax.swing.JMenuBar getMenubar() ,public java.lang.String...
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/toolbox/plugins/Divide.java
Divide
execute
class Divide extends AbstractTool { static { addVersion("$Id: Divide.java 3271 2008-04-18 20:39:42Z xlv $"); } /** * Constructs an Divide object. */ public Divide() { menuoptions = MENU_EXECUTE | MENU_EXECUTE_SHOW; arguments.add(new FileArgument(this, "srcfile", ...
try { if (getValue("srcfile") == null) { throw new InstantiationException( "You need to choose a sourcefile"); } File src = (File) getValue("srcfile"); if (getValue("destfile") == null) { throw new Instantia...
621
612
1,233
<methods>public void <init>() ,public void actionPerformed(java.awt.event.ActionEvent) ,public abstract void execute() ,public ArrayList<com.lowagie.toolbox.arguments.AbstractArgument> getArguments() ,public javax.swing.JInternalFrame getInternalFrame() ,public javax.swing.JMenuBar getMenubar() ,public java.lang.String...
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/toolbox/plugins/DvdCover.java
DvdCover
execute
class DvdCover extends AbstractTool { static { addVersion("$Id: DvdCover.java 3271 2008-04-18 20:39:42Z xlv $"); } /** * Constructs a DvdCover object. */ public DvdCover() { menuoptions = MENU_EXECUTE | MENU_EXECUTE_SHOW | MENU_EXECUTE_PRINT; arguments.add(new FileArg...
try { // step 1: creation of a document-object Rectangle pageSize = new Rectangle(780, 525); if (getValue("backgroundcolor") != null) { pageSize.setBackgroundColor((Color) getValue("backgroundcolor")); } Document document = new Documen...
781
862
1,643
<methods>public void <init>() ,public void actionPerformed(java.awt.event.ActionEvent) ,public abstract void execute() ,public ArrayList<com.lowagie.toolbox.arguments.AbstractArgument> getArguments() ,public javax.swing.JInternalFrame getInternalFrame() ,public javax.swing.JMenuBar getMenubar() ,public java.lang.String...
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/toolbox/plugins/Encrypt.java
Encrypt
valueHasChanged
class Encrypt extends AbstractTool { private final static int[] PERMISSIONS = { PdfWriter.ALLOW_PRINTING, PdfWriter.ALLOW_MODIFY_CONTENTS, PdfWriter.ALLOW_COPY, PdfWriter.ALLOW_MODIFY_ANNOTATIONS, PdfWriter.ALLOW_FILL_IN, PdfWriter.ALLOW_SCREE...
if (internalFrame == null) { // if the internal frame is null, the tool was called from the command line return; } // represent the changes of the argument in the internal frame
1,335
51
1,386
<methods>public void <init>() ,public void actionPerformed(java.awt.event.ActionEvent) ,public abstract void execute() ,public ArrayList<com.lowagie.toolbox.arguments.AbstractArgument> getArguments() ,public javax.swing.JInternalFrame getInternalFrame() ,public javax.swing.JMenuBar getMenubar() ,public java.lang.String...
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/toolbox/plugins/ExtractAttachments.java
ExtractAttachments
unpackFile
class ExtractAttachments extends AbstractTool { static { addVersion("$Id: ExtractAttachments.java 3712 2009-02-20 20:11:31Z xlv $"); } /** * Constructs a ExtractAttachements object. */ public ExtractAttachments() { FileArgument f = new FileArgument(this, "srcfile", ...
if (filespec == null) { return; } PdfName type = filespec.getAsName(PdfName.TYPE); if (!PdfName.F.equals(type) && !PdfName.FILESPEC.equals(type)) { return; } PdfDictionary ef = filespec.getAsDict(PdfName.EF); if (ef == null) { ...
1,249
317
1,566
<methods>public void <init>() ,public void actionPerformed(java.awt.event.ActionEvent) ,public abstract void execute() ,public ArrayList<com.lowagie.toolbox.arguments.AbstractArgument> getArguments() ,public javax.swing.JInternalFrame getInternalFrame() ,public javax.swing.JMenuBar getMenubar() ,public java.lang.String...
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/toolbox/plugins/Handouts.java
Handouts
execute
class Handouts extends AbstractTool { static { addVersion("$Id: Handouts.java 3271 2008-04-18 20:39:42Z xlv $"); } /** * Constructs a Handouts object. */ public Handouts() { arguments.add(new FileArgument(this, "srcfile", "The file you want to convert", false, new PdfFilter()...
try { if (getValue("srcfile") == null) { throw new InstantiationException("You need to choose a sourcefile"); } File src = (File) getValue("srcfile"); if (getValue("destfile") == null) { throw new InstantiationException("You need t...
756
1,135
1,891
<methods>public void <init>() ,public void actionPerformed(java.awt.event.ActionEvent) ,public abstract void execute() ,public ArrayList<com.lowagie.toolbox.arguments.AbstractArgument> getArguments() ,public javax.swing.JInternalFrame getInternalFrame() ,public javax.swing.JMenuBar getMenubar() ,public java.lang.String...
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/toolbox/plugins/ImageXRefViewer.java
ImageXRefViewer
execute
class ImageXRefViewer extends AbstractTool { static { addVersion("$Id: ImageXRefViewer.java 3271 2008-04-18 20:39:42Z xlv $"); } /** * The total number of pictures inside the PDF. */ int total_number_of_pictures = 0; /** * The spinner that will allow you to select an image. ...
total_number_of_pictures = 0; try { if (getValue("srcfile") == null) { throw new InstantiationException( "You need to choose a sourcefile"); } EventDispatchingThread task = new EventDispatchingThread() { public ...
1,292
628
1,920
<methods>public void <init>() ,public void actionPerformed(java.awt.event.ActionEvent) ,public abstract void execute() ,public ArrayList<com.lowagie.toolbox.arguments.AbstractArgument> getArguments() ,public javax.swing.JInternalFrame getInternalFrame() ,public javax.swing.JMenuBar getMenubar() ,public java.lang.String...
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/toolbox/plugins/InspectPDF.java
InspectPDF
main
class InspectPDF extends AbstractTool { static { addVersion("$Id: InspectPDF.java 3826 2009-03-31 17:46:18Z blowagie $"); } /** * Constructs an InpectPDF object. */ public InspectPDF() { arguments.add(new FileArgument(this, "srcfile", "The file you want to inspect", false, ne...
InspectPDF tool = new InspectPDF(); if (args.length < 1) { System.err.println(tool.getUsage()); } tool.setMainArguments(args); tool.execute();
1,103
58
1,161
<methods>public void <init>() ,public void actionPerformed(java.awt.event.ActionEvent) ,public abstract void execute() ,public ArrayList<com.lowagie.toolbox.arguments.AbstractArgument> getArguments() ,public javax.swing.JInternalFrame getInternalFrame() ,public javax.swing.JMenuBar getMenubar() ,public java.lang.String...
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/toolbox/plugins/NUp.java
NUp
execute
class NUp extends AbstractTool { static { addVersion("$Id: NUp.java 3427 2008-05-24 18:32:31Z xlv $"); } /** * Constructs an NUp object. */ public NUp() { menuoptions = MENU_EXECUTE | MENU_EXECUTE_SHOW; arguments.add(new FileArgument(this, "srcfile", "The file you wan...
try { if (getValue("srcfile") == null) { throw new InstantiationException("You need to choose a sourcefile"); } File src = (File) getValue("srcfile"); if (getValue("destfile") == null) { throw new InstantiationException("You need t...
734
845
1,579
<methods>public void <init>() ,public void actionPerformed(java.awt.event.ActionEvent) ,public abstract void execute() ,public ArrayList<com.lowagie.toolbox.arguments.AbstractArgument> getArguments() ,public javax.swing.JInternalFrame getInternalFrame() ,public javax.swing.JMenuBar getMenubar() ,public java.lang.String...
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/toolbox/plugins/Normalize.java
Ausrichtung
klassifiziere
class Ausrichtung { static final float tolerance = 60; static final int UNKNOWN = 0; static final int A4Portrait = 1; static final int A4Landscape = 2; static final int A3Portrait = 3; static final int A3Landscape = 4; float rotation; Rectangle rect; ...
if (Math.abs(rect.getWidth() - 595) < tolerance && Math.abs(rect.getHeight() - 842) < tolerance) { this.type = A4Portrait; } else if (Math.abs(rect.getWidth() - 842) < tolerance && Math.abs(rect.getHeight() - 595) < tolerance) { ...
562
244
806
<methods>public void <init>() ,public void actionPerformed(java.awt.event.ActionEvent) ,public abstract void execute() ,public ArrayList<com.lowagie.toolbox.arguments.AbstractArgument> getArguments() ,public javax.swing.JInternalFrame getInternalFrame() ,public javax.swing.JMenuBar getMenubar() ,public java.lang.String...
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/toolbox/plugins/PhotoAlbum.java
PhotoAlbum
execute
class PhotoAlbum extends AbstractTool { static { addVersion("$Id: PhotoAlbum.java 3451 2008-05-26 02:56:13Z xlv $"); } /** * Constructs a PhotoAlbum object. */ public PhotoAlbum() { menuoptions = MENU_EXECUTE | MENU_EXECUTE_SHOW; arguments.add(new FileArgument(this, "...
try { if (getValue("srcdir") == null) { throw new InstantiationException( "You need to choose a source directory"); } File directory = (File) getValue("srcdir"); if (directory.isFile()) { directory = directo...
634
995
1,629
<methods>public void <init>() ,public void actionPerformed(java.awt.event.ActionEvent) ,public abstract void execute() ,public ArrayList<com.lowagie.toolbox.arguments.AbstractArgument> getArguments() ,public javax.swing.JInternalFrame getInternalFrame() ,public javax.swing.JMenuBar getMenubar() ,public java.lang.String...
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/toolbox/plugins/RemoveLaunchApplication.java
RemoveLaunchApplication
createFrame
class RemoveLaunchApplication extends AbstractTool { static { addVersion( "$Id: RemoveLaunchApplication.java 3271 2008-04-18 20:39:42Z xlv $"); } /** * Constructs a ReversePages object. */ public RemoveLaunchApplication() { menuoptions = MENU_EXECUTE |...
internalFrame = new JInternalFrame("Remove Launch Applications", true, false, true); internalFrame.setSize(300, 80); internalFrame.setJMenuBar(getMenubar()); System.out.println("=== Remove Launch Applications OPENED ===");
1,172
71
1,243
<methods>public void <init>() ,public void actionPerformed(java.awt.event.ActionEvent) ,public abstract void execute() ,public ArrayList<com.lowagie.toolbox.arguments.AbstractArgument> getArguments() ,public javax.swing.JInternalFrame getInternalFrame() ,public javax.swing.JMenuBar getMenubar() ,public java.lang.String...
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/toolbox/plugins/ReversePages.java
ReversePages
createFrame
class ReversePages extends AbstractTool { static { addVersion( "$Id: ReversePages.java 3271 2008-04-18 20:39:42Z xlv $"); } FileArgument destfile = null; /** * Constructs a ReversePages object. */ public ReversePages() { menuoptions = MENU_EXECUTE...
internalFrame = new JInternalFrame("ReversePages", true, false, true); internalFrame.setSize(300, 80); internalFrame.setJMenuBar(getMenubar()); System.out.println("=== ReversePages OPENED ===");
1,139
73
1,212
<methods>public void <init>() ,public void actionPerformed(java.awt.event.ActionEvent) ,public abstract void execute() ,public ArrayList<com.lowagie.toolbox.arguments.AbstractArgument> getArguments() ,public javax.swing.JInternalFrame getInternalFrame() ,public javax.swing.JMenuBar getMenubar() ,public java.lang.String...
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/toolbox/plugins/SelectedPages.java
SelectedPages
createFrame
class SelectedPages extends AbstractTool { static { addVersion("$Id: SelectedPages.java 3271 2008-04-18 20:39:42Z xlv $"); } /** * Constructs a SelectedPages object. */ public SelectedPages() { menuoptions = MENU_EXECUTE | MENU_EXECUTE_SHOW; arguments.add(new FileArgu...
internalFrame = new JInternalFrame("SelectedPages", true, false, true); internalFrame.setSize(300, 80); internalFrame.setJMenuBar(getMenubar()); System.out.println("=== SelectedPages OPENED ===");
994
70
1,064
<methods>public void <init>() ,public void actionPerformed(java.awt.event.ActionEvent) ,public abstract void execute() ,public ArrayList<com.lowagie.toolbox.arguments.AbstractArgument> getArguments() ,public javax.swing.JInternalFrame getInternalFrame() ,public javax.swing.JMenuBar getMenubar() ,public java.lang.String...
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/toolbox/plugins/Split.java
Split
execute
class Split extends AbstractTool { static { addVersion("$Id: Split.java 3271 2008-04-18 20:39:42Z xlv $"); } /** * Constructs an Split object. */ public Split() { FileArgument f = new FileArgument(this, "srcfile", "The file you want to split", false, new PdfFilter()); ...
try { if (getValue("srcfile") == null) { throw new InstantiationException("You need to choose a sourcefile"); } File src = (File) getValue("srcfile"); if (getValue("destfile1") == null) { throw new InstantiationException("You need ...
691
918
1,609
<methods>public void <init>() ,public void actionPerformed(java.awt.event.ActionEvent) ,public abstract void execute() ,public ArrayList<com.lowagie.toolbox.arguments.AbstractArgument> getArguments() ,public javax.swing.JInternalFrame getInternalFrame() ,public javax.swing.JMenuBar getMenubar() ,public java.lang.String...
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/toolbox/plugins/Txt2Pdf.java
Txt2Pdf
execute
class Txt2Pdf extends AbstractTool { static { addVersion("$Id: Txt2Pdf.java 3271 2008-04-18 20:39:42Z xlv $"); } /** * Constructs a Txt2Pdf object. */ public Txt2Pdf() { menuoptions = MENU_EXECUTE | MENU_EXECUTE_SHOW | MENU_EXECUTE_PRINT_SILENT; arguments.add(new File...
try { String line = null; Document document; Font f; Rectangle pagesize = (Rectangle) getValue("pagesize"); if ("LANDSCAPE".equals(getValue("orientation"))) { f = FontFactory.getFont(FontFactory.COURIER, 10); document =...
761
325
1,086
<methods>public void <init>() ,public void actionPerformed(java.awt.event.ActionEvent) ,public abstract void execute() ,public ArrayList<com.lowagie.toolbox.arguments.AbstractArgument> getArguments() ,public javax.swing.JInternalFrame getInternalFrame() ,public javax.swing.JMenuBar getMenubar() ,public java.lang.String...
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/toolbox/plugins/XML2Bookmarks.java
XML2Bookmarks
valueHasChanged
class XML2Bookmarks extends AbstractTool { static { addVersion("$Id: XML2Bookmarks.java 3373 2008-05-12 16:21:24Z xlv $"); } /** * Constructs an XML2Bookmarks object. */ public XML2Bookmarks() { arguments.add(new FileArgument(this, "xmlfile", "the bookmarks in XML", false)); ...
if (internalFrame == null) { // if the internal frame is null, the tool was called from the command line return; } // represent the changes of the argument in the internal frame
950
51
1,001
<methods>public void <init>() ,public void actionPerformed(java.awt.event.ActionEvent) ,public abstract void execute() ,public ArrayList<com.lowagie.toolbox.arguments.AbstractArgument> getArguments() ,public javax.swing.JInternalFrame getInternalFrame() ,public javax.swing.JMenuBar getMenubar() ,public java.lang.String...
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/toolbox/plugins/watermarker/Watermarker.java
Watermarker
write
class Watermarker { private final PdfReader reader; private final ByteArrayOutputStream outputStream; private final PdfStamper stamp; private final String text; private final int fontsize; private final float opacity; private Color color = BLACK; private BaseFont font = null; /** ...
Writer writer = new Writer(reader, stamp, text, fontsize, opacity, color); if (font != null) { writer.withFont(font); } writer.write(); return outputStream.toByteArray();
471
65
536
<no_super_class>
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/toolbox/plugins/watermarker/WatermarkerTool.java
WatermarkerTool
execute
class WatermarkerTool extends AbstractTool { FileArgument destfile; /** * This tool lets you add a text watermark to all pages of a document. */ public WatermarkerTool() { super(); FileArgument inputfile = new FileArgument(this, "srcfile", "The file you want to wa...
try { if (getValue("srcfile") == null) { throw new InstantiationException( "You need to choose a sourcefile"); } if (getValue("destfile") == null) { throw new InstantiationException( "You need to...
1,137
432
1,569
<methods>public void <init>() ,public void actionPerformed(java.awt.event.ActionEvent) ,public abstract void execute() ,public ArrayList<com.lowagie.toolbox.arguments.AbstractArgument> getArguments() ,public javax.swing.JInternalFrame getInternalFrame() ,public javax.swing.JMenuBar getMenubar() ,public java.lang.String...
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/toolbox/plugins/watermarker/Writer.java
Writer
write
class Writer { private PdfReader reader; private PdfStamper stamp; private String text; private int fontsize; private float opacity; private Color color; private BaseFont font; Writer(PdfReader reader, PdfStamper stamp, String text, int fontsize, float opacity, Color color) { t...
final BaseFont bf = (font != null) ? font : createFont("Helvetica", WINANSI, false); int pagecount = reader.getNumberOfPages(); PdfGState gs1 = new PdfGState(); gs1.setFillOpacity(opacity); float txtwidth = bf.getWidthPoint(text, fontsize); for (int i = 1; i <= pagecount...
281
486
767
<no_super_class>
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/toolbox/swing/CustomDialog.java
CustomDialog
instantiateFloatDocument
class CustomDialog { JDialog dialog = null; JPanel jPanel1 = new JPanel(); PlainDocument plainDocument; String msgString1; Object[] array; private JTextField textField = new JTextField(10); private JOptionPane optionPane; public CustomDialog(String msgstring, PlainDocument plainDocumen...
PlainDocument floatDocument = new PlainDocument() { private static final long serialVersionUID = 1874451914306029381L; public void insertString(int offset, String str, AttributeSet a) throws BadLocationException { super.insertString(offset, str, a); ...
682
162
844
<no_super_class>
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/toolbox/swing/EventDispatchingThread.java
EventDispatchingThread
start
class EventDispatchingThread { /** * The value of an object constructed by the construct() method. */ private Object value; /** * A wrapper for the tread that executes a time-consuming task. */ private ThreadWrapper thread; /** * Starts a thread. Executes the time-consumin...
Thread t = thread.get(); if (t != null) { t.start(); }
612
31
643
<no_super_class>
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/toolbox/swing/FileList.java
FileList
jbInit
class FileList extends JInternalFrame implements DropTargetListener { private static final long serialVersionUID = -7238230038043975672L; private final Vector<RowContainer> filevector = new Vector<>(); private final JPanel jPanel1 = new JPanel(); private final BorderLayout borderLayout1 = new ...
this.getContentPane().setLayout(borderLayout1); jTable1.addKeyListener(new FileListJTable1KeyAdapter(this)); jLabel1.setText("pages"); jLabel2.setText("-"); model.addTableModelListener(new FileListFtmTableModelAdapter(this)); this.getContentPane().add(jPanel1, java.awt.B...
1,762
276
2,038
<methods>public void <init>() ,public void <init>(java.lang.String) ,public void <init>(java.lang.String, boolean) ,public void <init>(java.lang.String, boolean, boolean) ,public void <init>(java.lang.String, boolean, boolean, boolean) ,public void <init>(java.lang.String, boolean, boolean, boolean, boolean) ,public vo...
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/toolbox/swing/PdfInformationPanel.java
PdfInformationPanel
propertyChange
class PdfInformationPanel extends JPanel implements PropertyChangeListener { /** * A serial version id */ private static final long serialVersionUID = -4171577284617028707L; /** * The file name of the PDF we're going to label. */ String filename = ""; /** * the label cont...
filename = evt.getPropertyName(); if (filename.equals(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY)) { File file = (File) evt.getNewValue(); if (file != null) { this.createTextFromPDF(file); this.repaint(); } }
1,104
91
1,195
<methods>public void <init>() ,public void <init>(java.awt.LayoutManager) ,public void <init>(boolean) ,public void <init>(java.awt.LayoutManager, boolean) ,public javax.accessibility.AccessibleContext getAccessibleContext() ,public javax.swing.plaf.PanelUI getUI() ,public java.lang.String getUIClassID() ,public void s...
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/tools/BuildTutorial.java
BuildTutorial
main
class BuildTutorial { static String root; static FileWriter build; //~ Methods // ---------------------------------------------------------------- /** * Main method so you can call the convert method from the command line. * * @param args 4 arguments are expected: * ...
if (args.length == 4) { File srcdir = new File(args[0]); File destdir = new File(args[1]); File xsl_examples = new File(srcdir, args[2]); File xsl_site = new File(srcdir, args[3]); try { System.out.print("Building tutorial: "); ...
1,228
310
1,538
<no_super_class>
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/tools/ConcatPdf.java
ConcatPdf
concat
class ConcatPdf { /** * This class can be used to concatenate existing PDF files. (This was an example known as PdfCopy.java) * * @param args the command line arguments */ public static void main(String[] args) { if (args.length < 2) { System.err.println("arguments: file...
for (File source : sources) { if (!source.isFile() || !source.canRead()) { throw new IOException("cannot read:" + source.getAbsolutePath()); } } int pageOffset = 0; List<Map<String, Object>> master = new ArrayList<>(); Document document...
247
457
704
<no_super_class>
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/tools/EncryptPdf.java
EncryptPdf
main
class EncryptPdf { private final static int INPUT_FILE = 0; private final static int OUTPUT_FILE = 1; private final static int USER_PASSWORD = 2; private final static int OWNER_PASSWORD = 3; private final static int PERMISSIONS = 4; private final static int STRENGTH = 5; private final stati...
System.out.println("PDF document encryptor"); if (args.length <= STRENGTH || args[PERMISSIONS].length() != 8) { usage(); return; } try { int permissions = 0; String p = args[PERMISSIONS]; for (int k = 0; k < p.length(); ++k) { ...
555
337
892
<no_super_class>
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/tools/HandoutPdf.java
HandoutPdf
main
class HandoutPdf { /** * Makes handouts based on an existing PDF file. * * @param args the command line arguments */ public static void main(String[] args) {<FILL_FUNCTION_BODY>} }
if (args.length != 3) { System.err.println("arguments: srcfile destfile pages"); } else { try { int pages = Integer.parseInt(args[2]); if (pages < 2 || pages > 8) { throw new DocumentException(MessageLocalization ...
67
1,083
1,150
<no_super_class>
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/tools/SplitPdf.java
SplitPdf
main
class SplitPdf extends java.lang.Object { /** * This class can be used to split an existing PDF file. * * @param args the command line arguments */ public static void main(String[] args) {<FILL_FUNCTION_BODY>} }
if (args.length != 4) { System.err.println("arguments: srcfile destfile1 destfile2 pagenumber"); } else { try { int pagenumber = Integer.parseInt(args[3]); // we create a reader for a certain document PdfReader reader = new PdfRea...
74
826
900
<no_super_class>
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/com/lowagie/tools/ToolboxAvailable.java
ToolboxAvailable
main
class ToolboxAvailable { /** * Checks if the toolbox if available. If it is, the toolbox is started. If it isn't, an error message is shown. * * @param args the command-line args */ public static void main(String[] args) {<FILL_FUNCTION_BODY>} }
if (GraphicsEnvironment.isHeadless()) { System.out.println(Document.getVersion() + " Toolbox error: headless display"); } else { try { Toolbox.main(args); } catch (Exception e) { JOptionPane.showMessageDialog(null, ...
87
142
229
<no_super_class>
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/org/librepdf/openpdf/examples/fonts/languages/Chinese.java
Chinese
main
class Chinese { public static void main(String[] args) throws IOException {<FILL_FUNCTION_BODY>} }
// step 0: prepare font with chinese symbols // Downloaded from: // https://github.com/adobe-fonts/source-han-serif/blob/release/OTF/SimplifiedChinese/SourceHanSerifSC-Regular.otf final String fontFile = "SourceHanSerifSC-Regular.otf"; BaseFont baseFont = BaseFont ...
33
527
560
<no_super_class>
LibrePDF_OpenPDF
OpenPDF/pdf-toolbox/src/main/java/org/librepdf/openpdf/examples/fonts/languages/Japanese.java
Japanese
main
class Japanese { public static void main(String[] args) throws IOException {<FILL_FUNCTION_BODY>} }
// step 0: prepare font with chinese symbols BaseFont baseFont = BaseFont.createFont( Japanese.class.getClassLoader().getResource("fonts/GenShinGothic-Normal.ttf").getFile(), BaseFont.IDENTITY_H, BaseFont.EMBEDDED); Font font = new Font(baseFont, 12, Font.NORMAL)...
33
262
295
<no_super_class>
igniterealtime_Openfire
Openfire/starter/src/main/java/org/jivesoftware/openfire/launcher/DroppableFrame.java
DroppableFrame
drop
class DroppableFrame extends JFrame implements DropTargetListener, DragSourceListener, DragGestureListener { private DragSource dragSource = DragSource.getDefaultDragSource(); /** * Creates a droppable rame. */ public DroppableFrame() { new DropTarget(this, this); dragSo...
try { Transferable transferable = dropTargetDropEvent.getTransferable(); if (transferable.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) { dropTargetDropEvent.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE); List fileList = (List) transferable.getTran...
553
261
814
<methods>public void <init>() throws java.awt.HeadlessException,public void <init>(java.awt.GraphicsConfiguration) ,public void <init>(java.lang.String) throws java.awt.HeadlessException,public void <init>(java.lang.String, java.awt.GraphicsConfiguration) ,public javax.accessibility.AccessibleContext getAccessibleConte...
igniterealtime_Openfire
Openfire/starter/src/main/java/org/jivesoftware/openfire/launcher/DroppableTextPane.java
DroppableTextPane
drop
class DroppableTextPane extends JTextPane implements DropTargetListener, DragSourceListener, DragGestureListener { private DragSource dragSource = DragSource.getDefaultDragSource(); /** * Creates a droppable text pane. */ public DroppableTextPane() { new DropTarget(this, this); ...
try { Transferable transferable = dropTargetDropEvent.getTransferable(); if (transferable.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) { dropTargetDropEvent.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE); List fileList = (List) transferable.getTran...
556
261
817
<methods>public void <init>() ,public void <init>(javax.swing.text.StyledDocument) ,public javax.swing.text.Style addStyle(java.lang.String, javax.swing.text.Style) ,public javax.swing.text.AttributeSet getCharacterAttributes() ,public javax.swing.text.MutableAttributeSet getInputAttributes() ,public javax.swing.text.S...
igniterealtime_Openfire
Openfire/starter/src/main/java/org/jivesoftware/openfire/launcher/Uninstaller.java
Uninstaller
performAction
class Uninstaller extends UninstallAction { @Override public int getPercentOfTotalInstallation() { return 0; } @Override public boolean performAction(Context context, ProgressInterface progressInterface) {<FILL_FUNCTION_BODY>} }
final File installationDirectory = context.getInstallationDirectory(); File libDirectory = new File(installationDirectory, "lib"); // If the directory still exists, remove all JAR files. if (libDirectory.exists() && libDirectory.isDirectory()) { File[] jars = libDirectory....
73
157
230
<methods>public void <init>() ,public boolean performAction(com.install4j.api.Context, com.install4j.api.ProgressInterface) <variables>
igniterealtime_Openfire
Openfire/starter/src/main/java/org/jivesoftware/openfire/starter/JiveClassLoader.java
JiveClassLoader
accept
class JiveClassLoader extends URLClassLoader { /** * Constructs the classloader. * * @param parent the parent class loader (or null for none). * @param libDir the directory to load jar files from. * @throws java.net.MalformedURLException if the libDir path is not valid. */ JiveCla...
boolean accept = false; String smallName = name.toLowerCase(); if (smallName.endsWith(".jar")) { accept = true; } else if (smallName.endsWith(".zip")) { accept = true; } ...
322
72
394
<methods>public void <init>(java.net.URL[]) ,public void <init>(java.net.URL[], java.lang.ClassLoader) ,public void <init>(java.net.URL[], java.lang.ClassLoader, java.net.URLStreamHandlerFactory) ,public void <init>(java.lang.String, java.net.URL[], java.lang.ClassLoader) ,public void <init>(java.lang.String, java.net....
igniterealtime_Openfire
Openfire/starter/src/main/java/org/jivesoftware/openfire/starter/ServerStarter.java
ServerStarter
start
class ServerStarter { private static final Logger Log = LoggerFactory.getLogger(ServerStarter.class); /** * Default to this location if one has not been specified */ private static final String DEFAULT_LIB_DIR = "../lib"; public static void main(String [] args) { new ServerStarter()...
// Setup the classpath using JiveClassLoader try { // Load up the bootstrap container final ClassLoader parent = findParentClassLoader(); String libDirString = System.getProperty("openfire.lib.dir"); File libDir; if (libDirString != null) { ...
286
291
577
<no_super_class>
igniterealtime_Openfire
Openfire/xmppserver/src/main/java/org/jivesoftware/admin/ASN1DERTag.java
ASN1DERTag
doPrimitive
class ASN1DERTag extends BodyTagSupport { private byte[] value; // ASN.1 DER-encoded value public byte[] getValue() { return value; } public void setValue(byte[] value) { this.value = value; } @Override public int doEndTag() throws JspException { try (final ASN1I...
if (primitive == null || primitive instanceof ASN1Null) { return ""; } else if (primitive instanceof ASN1Sequence) { return doCollection(((ASN1Sequence) primitive).toArray()); } else if (primitive instanceof ASN1Set) { return doCollection(((ASN1Set) primitive...
790
230
1,020
<no_super_class>
igniterealtime_Openfire
Openfire/xmppserver/src/main/java/org/jivesoftware/admin/AdminPageBean.java
AdminPageBean
getScripts
class AdminPageBean { private String title; private Collection breadcrumbs; private String pageID; private String subPageID; private String extraParams; private Collection scripts; public AdminPageBean() { } /** * Returns the title of the page with HTML escaped. * @retur...
if (scripts == null) { scripts = new ArrayList(); } return scripts;
948
27
975
<no_super_class>
igniterealtime_Openfire
Openfire/xmppserver/src/main/java/org/jivesoftware/admin/ContentSecurityPolicyFilter.java
ContentSecurityPolicyFilter
doFilter
class ContentSecurityPolicyFilter implements Filter { private final SystemProperty<Boolean> statusProperty; private final SystemProperty<String> valueProperty; public ContentSecurityPolicyFilter(@Nonnull final SystemProperty<Boolean> statusProperty, @Nonnull final SystemProperty<String> valueProperty) ...
if (response instanceof HttpServletResponse && statusProperty.getValue()) { final String value = valueProperty.getValue(); if (value != null && !value.trim().isEmpty()) { ((HttpServletResponse) response).setHeader("Content-Security-Policy", value); } ...
140
84
224
<no_super_class>
igniterealtime_Openfire
Openfire/xmppserver/src/main/java/org/jivesoftware/admin/FlashMessageTag.java
FlashMessageTag
doTag
class FlashMessageTag extends SimpleTagSupport { public static final String SUCCESS_MESSAGE_KEY = "success"; public static final String WARNING_MESSAGE_KEY = "warning"; public static final String ERROR_MESSAGE_KEY = "error"; @Override public void doTag() throws IOException {<FILL_FUNCTION_BODY>} ...
final PageContext pageContext = (PageContext) getJspContext(); final JspWriter jspWriter = pageContext.getOut(); final HttpSession session = pageContext.getSession(); for (final String flash : new String[]{SUCCESS_MESSAGE_KEY, WARNING_MESSAGE_KEY, ERROR_MESSAGE_KEY}) { fina...
95
165
260
<no_super_class>
igniterealtime_Openfire
Openfire/xmppserver/src/main/java/org/jivesoftware/admin/JSTLFunctions.java
JSTLFunctions
urlDecode
class JSTLFunctions { /** * JSTL delegate for {@link String#replaceAll(String, String)}. The first argument is the value on which the * replacement has to occur. The other arguments are passed to {@link String#replaceAll(String, String)} directly. * @param string The string to search * @param re...
try { return URLDecoder.decode( string, "UTF-8" ); } catch ( UnsupportedEncodingException e ) { // Should never occur, as UTF-8 encoding is mandatory to implement for any JRE. throw new IllegalStateException( "Unable to URL-decode string: " + ...
921
90
1,011
<no_super_class>
igniterealtime_Openfire
Openfire/xmppserver/src/main/java/org/jivesoftware/admin/LdapGroupTester.java
LdapGroupTester
getGroups
class LdapGroupTester { private static final Logger Log = LoggerFactory.getLogger(LdapGroupTester.class); private LdapManager manager; public LdapGroupTester(LdapManager manager) { this.manager = manager; } /** * Returns fist N groups found in LDAP. The returned groups are only able...
Collection<Group> groups = new ArrayList<>(); LdapContext ctx = null; try { ctx = manager.getContext(); // Sort on group name field. Control[] searchControl = new Control[]{ new SortControl(new String[]{manager.getGroupNameField()}, Control.NO...
452
715
1,167
<no_super_class>
igniterealtime_Openfire
Openfire/xmppserver/src/main/java/org/jivesoftware/admin/LoginLimitManager.java
LoginLimitManagerContainer
recordSuccessfulAttempt
class LoginLimitManagerContainer { private static LoginLimitManager instance = new LoginLimitManager(); } /** * Returns a singleton instance of LoginLimitManager. * * @return a LoginLimitManager instance. */ public static LoginLimitManager getInstance() { return LoginLim...
attemptsPerIP.remove(address); attemptsPerUsername.remove(username); securityAuditManager.logEvent(username, "Successful admin console login attempt", "The user logged in successfully to the admin console from address " + address + ". ");
1,515
63
1,578
<no_super_class>
igniterealtime_Openfire
Openfire/xmppserver/src/main/java/org/jivesoftware/admin/PluginFilter.java
PluginFilter
removePluginFilter
class PluginFilter implements Filter { private static final Logger Log = LoggerFactory.getLogger( PluginFilter.class ); private static final Map<String, List<Filter>> filters = new ConcurrentHashMap<>(); /** * Adds a filter to the list of filters that will be run on every request of which the URL ma...
if ( filterUrl == null || filterUrl.isEmpty() || filterClassName == null || filterClassName.isEmpty() ) { throw new IllegalArgumentException(); } Filter result = null; if ( filters.containsKey( filterUrl ) ) { final List<Filter> urlFilters = Plug...
1,553
306
1,859
<no_super_class>
igniterealtime_Openfire
Openfire/xmppserver/src/main/java/org/jivesoftware/admin/SiteMinderServletRequestAuthenticator.java
SiteMinderServletRequestAuthenticator
authenticateRequest
class SiteMinderServletRequestAuthenticator implements ServletRequestAuthenticator { public static final SystemProperty<String> SITE_MINDER_HEADER = SystemProperty.Builder.ofType(String.class) .setKey("adminConsole.siteMinderHeader") .setDefaultValue("SM_USER") .setDynamic(true) .bu...
final String smUser = request.getHeader(SITE_MINDER_HEADER.getValue()); if (smUser == null || smUser.trim().isEmpty()) { // SiteMinder has not authenticated the user return null; } else { return smUser; }
207
75
282
<no_super_class>
igniterealtime_Openfire
Openfire/xmppserver/src/main/java/org/jivesoftware/admin/SubSidebarTag.java
SubSidebarTag
doStartTag
class SubSidebarTag extends SidebarTag { private SidebarTag parent; private String body; /** * Returns the body content of this tag. * @return the body of the tag */ public String getBody() { return body; } /** * Sets the body content of this tag. * @param bod...
// The I18nTag should be our parent Tag parent = (SidebarTag)findAncestorWithClass(this, SidebarTag.class); // If I18nTag was not our parent, throw Exception if (parent == null) { throw new JspTagException("SubSidebarTag with out a parent which is expected to be a SidebarTa...
386
112
498
<methods>public non-sealed void <init>() ,public int doEndTag() throws JspException,public int doStartTag() throws JspException,public java.lang.String getCss() ,public java.lang.String getCurrentcss() ,public java.lang.String getHeadercss() ,public org.jivesoftware.admin.SubSidebarTag getSubsidebarTag() ,public void s...
igniterealtime_Openfire
Openfire/xmppserver/src/main/java/org/jivesoftware/admin/SubnavTag.java
SubnavTag
doEndTag
class SubnavTag extends BodyTagSupport { private String css; private String currentcss; /** * Returns the value of the CSS class to be used for tab decoration. If not set will return a blank string. * @return the CSS for the tab */ public String getCss() { return clean(css); ...
// Start by getting the request from the page context HttpServletRequest request = (HttpServletRequest)pageContext.getRequest(); // Check for body of this tag and the child tag if (getBodyContent().getString() == null) { throw new JspException("Error, no template (body valu...
612
961
1,573
<no_super_class>
igniterealtime_Openfire
Openfire/xmppserver/src/main/java/org/jivesoftware/admin/TabsTag.java
TabsTag
doEndTag
class TabsTag extends BodyTagSupport { private String bean; private String css; private String currentcss; private Boolean justlinks = false; /** * The name of the request attribute which holds a {@link AdminPageBean} instance. * @return the name of the bean */ public String get...
HttpServletRequest request = (HttpServletRequest)pageContext.getRequest(); // Get the page data bean from the request: // If the page info bean is not in the request then no tab will be selected - so, it'll fail gracefully String pageID = (String)request.getAttribute("pageID"); ...
846
750
1,596
<no_super_class>
igniterealtime_Openfire
Openfire/xmppserver/src/main/java/org/jivesoftware/admin/servlet/BlogPostServlet.java
BlogPostServlet
parseFirstEntries
class BlogPostServlet extends HttpServlet { public static final SystemProperty<Boolean> ENABLED = SystemProperty.Builder.ofType(Boolean.class) .setKey("rss.enabled") .setDynamic(true) .setDefaultValue(true) .addListener((b) -> lastRSSFetch = Instant.EPOCH) .build(); pub...
final SimpleDateFormat dateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss Z", Locale.ENGLISH); final JSONArray result = new JSONArray(); final Document document = SAXReaderUtil.readDocument(inputStream); final List<Node> nodes = document.selectNodes("/rss/channel/item"); ...
958
282
1,240
<no_super_class>
igniterealtime_Openfire
Openfire/xmppserver/src/main/java/org/jivesoftware/admin/servlet/SecurityAuditViewerServlet.java
SecurityAuditViewerServlet
doGet
class SecurityAuditViewerServlet extends HttpServlet { private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy/MM/dd"); private static final String[] SEARCH_FIELDS = {"searchUsername", "searchNode", "searchSummary", "searchFrom", "searchTo"}; @Override protected void doGet(HttpS...
final SecurityAuditProvider securityAuditProvider = SecurityAuditManager.getSecurityAuditProvider(); final List<SecurityAuditEvent> events; if (securityAuditProvider.isWriteOnly()) { events = Collections.emptyList(); } else { // The ListPager deals with paging & ...
445
752
1,197
<no_super_class>
igniterealtime_Openfire
Openfire/xmppserver/src/main/java/org/jivesoftware/admin/servlet/SystemCacheDetailsServlet.java
SystemCacheDetailsServlet
doPost
class SystemCacheDetailsServlet extends HttpServlet { private static final String[] SEARCH_FIELDS = {"cacheName", "searchKey", "searchValue"}; @Override protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException { final String c...
final HttpSession session = request.getSession(); final Cookie csrfCookie = CookieUtils.getCookie(request, "csrf"); if (csrfCookie == null || !csrfCookie.getValue().equals(request.getParameter("csrf"))) { session.setAttribute("errorMessage", LocaleUtils.getLocalizedString("global.cs...
1,407
309
1,716
<no_super_class>
igniterealtime_Openfire
Openfire/xmppserver/src/main/java/org/jivesoftware/database/CachedPreparedStatement.java
CachedPreparedStatement
toString
class CachedPreparedStatement { private static final Logger Log = LoggerFactory.getLogger(CachedPreparedStatement.class); private String sql; private List<Object> params; private List<Integer> types; /** * Constructs a new CachedPreparedStatement. */ public CachedPreparedStatement(...
String toStringSql = sql; try { int index = toStringSql.indexOf('?'); int count = 0; while (index > -1) { Object param = params.get(count); int type = types.get(count); String val = null; // Get param ...
1,138
307
1,445
<no_super_class>
igniterealtime_Openfire
Openfire/xmppserver/src/main/java/org/jivesoftware/database/EmbeddedConnectionProvider.java
EmbeddedConnectionProvider
start
class EmbeddedConnectionProvider implements ConnectionProvider { private static final Logger Log = LoggerFactory.getLogger(EmbeddedConnectionProvider.class); private String serverURL; private PoolingDataSource<PoolableConnection> dataSource; public EmbeddedConnectionProvider() { } @Override ...
final Path databaseDir = JiveGlobals.getHomePath().resolve("embedded-db"); try { // If the database doesn't exist, create it. if (!Files.exists(databaseDir)) { Files.createDirectory(databaseDir); } } catch (IOException e) { Log.err...
379
308
687
<no_super_class>
igniterealtime_Openfire
Openfire/xmppserver/src/main/java/org/jivesoftware/database/JNDIDataSourceProvider.java
JNDIDataSourceProvider
start
class JNDIDataSourceProvider implements ConnectionProvider { private static final Logger Log = LoggerFactory.getLogger(JNDIDataSourceProvider.class); private String dataSourceName; private DataSource dataSource; /** * Keys of JNDI properties to query PropertyManager for. */ public stati...
if (dataSourceName == null || dataSourceName.equals("")) { Log.error("No name specified for DataSource. JNDI lookup will fail", new Throwable()); return; } try { Properties contextProperties = new Properties(); for (String key: jndiPropertyKeys) {...
460
226
686
<no_super_class>
igniterealtime_Openfire
Openfire/xmppserver/src/main/java/org/jivesoftware/database/ProfiledConnection.java
TimedStatement
execute
class TimedStatement extends StatementWrapper { private Statement stmt; /** * Creates a new TimedStatement that wraps {@code stmt}. * * @param stmt the statement. */ public TimedStatement(Statement stmt) { super(stmt); this.stmt = stm...
long t1 = System.currentTimeMillis(); boolean result = stmt.execute(sql); long t2 = System.currentTimeMillis(); // determine the type of query String sqlL = sql.toLowerCase().trim(); if (sqlL.startsWith("insert")) { addQuery(Typ...
546
199
745
<methods>public void abort(java.util.concurrent.Executor) throws java.sql.SQLException,public void clearWarnings() throws java.sql.SQLException,public void close() throws java.sql.SQLException,public void commit() throws java.sql.SQLException,public java.sql.Array createArrayOf(java.lang.String, java.lang.Object[]) thr...
igniterealtime_Openfire
Openfire/xmppserver/src/main/java/org/jivesoftware/openfire/Channel.java
Channel
run
class Channel<T extends Packet> { private static final Logger Log = LoggerFactory.getLogger(Channel.class); private String name; private ChannelHandler<T> channelHandler; ThreadPoolExecutor executor; /** * Creates a new channel. The channel should be registered after it's created. * ...
try { channelHandler.process( packet ); } catch ( Exception e ) { Log.error( LocaleUtils.getLocalizedString( "admin.error" ), e ); try { ...
1,263
173
1,436
<no_super_class>
igniterealtime_Openfire
Openfire/xmppserver/src/main/java/org/jivesoftware/openfire/LocalSessionManager.java
ServerCleanupTask
run
class ServerCleanupTask extends TimerTask { /** * Close incoming server sessions that have been idle for a long time. */ @Override public void run() {<FILL_FUNCTION_BODY>} }
// Do nothing if this feature is disabled int idleTime = SessionManager.getInstance().getServerSessionIdleTime(); if (idleTime == -1) { return; } final long deadline = System.currentTimeMillis() - idleTime; for (LocalIncomingServer...
59
203
262
<no_super_class>
igniterealtime_Openfire
Openfire/xmppserver/src/main/java/org/jivesoftware/openfire/PrivateStorage.java
PrivateStorage
add
class PrivateStorage extends BasicModule { private static final Logger Log = LoggerFactory.getLogger(PrivateStorage.class); /** * PubSub 7.1.5 specificy Publishing Options that are applicable to private data storage (as described in XEP-0223). */ private static final DataForm PRIVATE_DATA_PUBLIS...
if (!enabled) { return; } final JID owner = XMPPServer.getInstance().createJID( username, null ); final PEPServiceManager serviceMgr = XMPPServer.getInstance().getIQPEPHandler().getServiceManager(); PEPService pepService = serviceMgr.getPEPService( owner ); ...
921
406
1,327
<methods>public void <init>(java.lang.String) ,public void destroy() ,public java.lang.String getName() ,public void initialize(org.jivesoftware.openfire.XMPPServer) ,public void start() throws java.lang.IllegalStateException,public void stop() <variables>private java.lang.String name
igniterealtime_Openfire
Openfire/xmppserver/src/main/java/org/jivesoftware/openfire/SessionPacketRouter.java
SessionPacketRouter
route
class SessionPacketRouter implements PacketRouter { protected LocalClientSession session; private PacketRouter router; private boolean skipJIDValidation = false; public SessionPacketRouter(LocalClientSession session) { this.session = session; router = XMPPServer.getInstance().getPacket...
String tag = wrappedElement.getName(); if ("auth".equals(tag) || "response".equals(tag)) { SASLAuthentication.handle(session, wrappedElement); } else if ("iq".equals(tag)) { route(getIQ(wrappedElement)); } else if ("message".equals(tag)) { ...
1,289
158
1,447
<no_super_class>
igniterealtime_Openfire
Openfire/xmppserver/src/main/java/org/jivesoftware/openfire/SessionResultFilter.java
SessionComparator
equals
class SessionComparator implements Comparator<ClientSession> { @Override public int compare(ClientSession lhs, ClientSession rhs) { int comparison; switch (sortField) { case SessionResultFilter.SORT_CREATION_DATE: comparison = lhs.getCreationD...
if (this == object) { return true; } if (object != null && object instanceof SessionResultFilter) { SessionResultFilter o = (SessionResultFilter)object; if (sortField != o.sortField) { return false; } if (sortOrder != o...
1,319
284
1,603
<no_super_class>
igniterealtime_Openfire
Openfire/xmppserver/src/main/java/org/jivesoftware/openfire/XMPPContextListener.java
XMPPContextListener
contextDestroyed
class XMPPContextListener implements ServletContextListener { protected String XMPP_KEY = "XMPP_SERVER"; @Override public void contextInitialized(ServletContextEvent event) { if (XMPPServer.getInstance() != null) { // Running in standalone mode so do nothing return; ...
XMPPServer server = (XMPPServer) event.getServletContext().getAttribute(XMPP_KEY); if (null != server) { server.stop(); }
155
51
206
<no_super_class>
igniterealtime_Openfire
Openfire/xmppserver/src/main/java/org/jivesoftware/openfire/admin/AdminManager.java
AdminManagerContainer
userDeleting
class AdminManagerContainer { private static AdminManager instance = new AdminManager(); } /** * Returns the currently-installed AdminProvider. <b>Warning:</b> in virtually all * cases the admin provider should not be used directly. Instead, the appropriate * methods in AdminManager shou...
// OF-2758: Ensure that if a user is re-created with the same name, they're not automatically an admin. removeAdminAccount(user.getUsername());
341
48
389
<no_super_class>
igniterealtime_Openfire
Openfire/xmppserver/src/main/java/org/jivesoftware/openfire/admin/DefaultAdminProvider.java
DefaultAdminProvider
convertXMLToProvider
class DefaultAdminProvider implements AdminProvider { private static final SystemProperty<List<JID>> ADMIN_JIDS = SystemProperty.Builder.ofType(List.class) .setKey("admin.authorizedJIDs") .setDefaultValue(Collections.emptyList()) .setSorted(true) .setDynamic(true) .addListen...
if (JiveGlobals.getXMLProperty("admin.authorizedJIDs") == null && JiveGlobals.getXMLProperty("admin.authorizedUsernames") == null && JiveGlobals.getXMLProperty("adminConsole.authorizedUsernames") == null) { // No settings in openfire.xml. return; ...
694
710
1,404
<no_super_class>
igniterealtime_Openfire
Openfire/xmppserver/src/main/java/org/jivesoftware/openfire/admin/GroupBasedAdminProvider.java
GroupBasedAdminProvider
getAdmins
class GroupBasedAdminProvider implements AdminProvider { private static final Logger LOGGER = LoggerFactory.getLogger(GroupBasedAdminProvider.class); private static final SystemProperty<String> GROUP_NAME = SystemProperty.Builder.ofType(String.class) .setKey("provider.group.groupBasedAdminProvider.group...
final String groupName = GROUP_NAME.getValue(); try { // Note; the list of admins is already cached, so if the list is being refreshed force a cache refresh too return new ArrayList<>(GroupManager.getInstance().getGroup(groupName, true).getMembers()); } catch (GroupNotFo...
204
123
327
<no_super_class>