rem stringlengths 0 477k | add stringlengths 0 313k | context stringlengths 6 599k |
|---|---|---|
defaults.put("TabbedPane.selected", new ColorUIResource(200, 221, 242)); defaults.put("TabbedPane.unselectedBackground", SECONDARY3); | defaults.put("MenuBarUI", "javax.swing.plaf.metal.MetalMenuBarUI"); defaults.put("Button.rolloverIconType", "ocean"); | public void addCustomEntriesToTable(UIDefaults defaults) { defaults.put("Button.gradient", Arrays.asList(new Object[] {new Double(0.3), new Double(0.0), new ColorUIResource(221, 232, 243), new ColorUIResource(Color.WHITE), new ColorUIResource(184, 207, 229)})); defaults.put("CheckBox.gradient", Arra... |
Document doc = new DomDocument(this); | Document doc = createDocument(); | public Document createDocument(String namespaceURI, String rootName, DocumentType doctype) { Document doc = new DomDocument(this); Element root = null; if (rootName != null) { root = doc.createElementNS(namespaceURI, rootName); ... |
if ("html".equalsIgnoreCase(feature) || "xhtml".equalsIgnoreCase(feature)) { return new DomHTMLImpl(); } | public Object getFeature(String feature, String version) { if (hasFeature(feature, version)) { return this; } return null; } | |
else if ("html".equals(name) || "xhtml".equals(name)) { return (version == null || "".equals(version) || "2.0".equals(version)); } | public boolean hasFeature(String name, String version) { if (name.length() == 0) { return false; } name = name.toLowerCase(); if (name.charAt(0) == '+') { name = name.substring(1); } if ("xml".equals(name) || "core".equals(name)) { return (version == null... | |
public InvalidTypeForEncoding(String why) | public InvalidTypeForEncoding() | public InvalidTypeForEncoding(String why) { super(why); } |
super(why); | public InvalidTypeForEncoding(String why) { super(why); } | |
has = holderFactory.createHolder(a_type); | has = HolderLocator.createHolder(a_type); | public void read_value(org.omg.CORBA.portable.InputStream input, TypeCode a_type ) throws MARSHAL { try { int kind = a_type.kind().value(); // Fixed needs special handling. if (kind == TCKind._tk_fixed) { ... |
cdrBufOutput buffer = new cdrBufOutput(); | BufferedCdrOutput buffer = new BufferedCdrOutput(); | public void read_value(org.omg.CORBA.portable.InputStream input, TypeCode a_type ) throws MARSHAL { try { int kind = a_type.kind().value(); // Fixed needs special handling. if (kind == TCKind._tk_fixed) { ... |
has = new universalHolder(buffer); | has = new GeneralHolder(buffer); | public void read_value(org.omg.CORBA.portable.InputStream input, TypeCode a_type ) throws MARSHAL { try { int kind = a_type.kind().value(); // Fixed needs special handling. if (kind == TCKind._tk_fixed) { ... |
if (!(has instanceof universalHolder) && | if (!(has instanceof GeneralHolder) && | public void read_value(org.omg.CORBA.portable.InputStream input, TypeCode a_type ) throws MARSHAL { try { int kind = a_type.kind().value(); // Fixed needs special handling. if (kind == TCKind._tk_fixed) { ... |
print(Graphics graphics, PageFormat format, int page_number) | int print(Graphics graphics, PageFormat format, int page_number) | print(Graphics graphics, PageFormat format, int page_number) throws PrinterException; |
{ valid = new Boolean( DIGEST0.equals(Util.toString(new Whirlpool().digest()))); } | valid = new Boolean(DIGEST0.equals(Util.toString(new Whirlpool().digest()))); | public boolean selfTest() { if (valid == null) { valid = new Boolean( DIGEST0.equals(Util.toString(new Whirlpool().digest()))); } return valid.booleanValue(); } |
return null; | return new char[0]; | public char[] getPassword() { return null; // TODO } |
case SYSTEM_EXCLUSIVE: return 0; | protected final int getDataLength(int status) throws InvalidMidiDataException { int originalStatus = status; if ((status & 0xF0) != 0xF0) status &= 0xF0; switch (status) { case NOTE_OFF: case NOTE_ON: case POLY_PRESSURE: case CONTROL_CHANGE: case PITCH_BEND: case SO... | |
if (opaque || pixel >= map_size) | if (opaque && pixel != trans) | public final int getAlpha (int pixel) { if (opaque || pixel >= map_size) return 255; return (int) ((generateMask (3) & rgb[pixel]) >> (3 * pixel_bits)); } |
return (int) ((generateMask (3) & rgb[pixel]) >> (3 * pixel_bits)); | return (0xFF000000 & rgb[pixel]) >> 24; | public final int getAlpha (int pixel) { if (opaque || pixel >= map_size) return 255; return (int) ((generateMask (3) & rgb[pixel]) >> (3 * pixel_bits)); } |
getComponents (a, 3); | int i; for (i = 0; i < map_size; i++) if (i == trans) a[i] = (byte) 0; else a[i] = (byte) ((0xFF000000 & rgb[i]) >> 24); | public final void getAlphas (byte[] a) { getComponents (a, 3); } |
return (int) (generateMask (0) & rgb[pixel]); | return 0x000000FF & rgb[pixel]; | public final int getBlue (int pixel) { if (pixel < map_size) return (int) (generateMask (0) & rgb[pixel]); return 0; } |
getComponents (b, 0); | int i; for (i = 0; i < map_size; i++) b[i] = (byte) (0x000000FF & rgb[i]); | public final void getBlues (byte[] b) { getComponents (b, 0); } |
return (int) ((generateMask (1) & rgb[pixel]) >> (1 * pixel_bits)); | return (0x0000FF00 & rgb[pixel]) >> 8; | public final int getGreen (int pixel) { if (pixel < map_size) return (int) ((generateMask (1) & rgb[pixel]) >> (1 * pixel_bits)); return 0; } |
getComponents (g, 1); | int i; for (i = 0; i < map_size; i++) g[i] = (byte) ((0x0000FF00 & rgb[i]) >> 8); | public final void getGreens (byte[] g) { getComponents (g, 1); } |
return (int) ((generateMask (2) & rgb[pixel]) >> (2 * pixel_bits)); | return (0x00FF0000 & rgb[pixel]) >> 16; | public final int getRed (int pixel) { if (pixel < map_size) return (int) ((generateMask (2) & rgb[pixel]) >> (2 * pixel_bits)); return 0; } |
getComponents (r, 2); | int i; for (i = 0; i < map_size; i++) r[i] = (byte) ((0x00FF0000 & rgb[i]) >> 16); | public final void getReds (byte[] r) { getComponents (r, 2); } |
return false; | public boolean isValid(int pixel) { return validBits.testBit(pixel); } | |
public PrinterJob() { } | PrinterJob() { ; } | public PrinterJob() { } |
public abstract void cancel(); | cancel(); | public abstract void cancel(); |
public PageFormat defaultPage() { return (new PageFormat()); } | defaultPage() { return(new PageFormat()); } | public PageFormat defaultPage() { return (new PageFormat()); } |
public abstract int getCopies(); | getCopies(); | public abstract int getCopies(); |
public abstract String getJobName(); | getJobName(); | public abstract String getJobName(); |
public static PrinterJob getPrinterJob() { | getPrinterJob() { | public static PrinterJob getPrinterJob() { // FIXME: Need to fix this to load a default implementation instance. return (null); } |
public abstract String getUserName(); | getUserName(); | public abstract String getUserName(); |
public abstract boolean isCancelled(); | isCancelled(); | public abstract boolean isCancelled(); |
public abstract PageFormat pageDialog(PageFormat page_format); | pageDialog(PageFormat page_format); | public abstract PageFormat pageDialog(PageFormat page_format); |
public abstract void print(); | public abstract void print () throws PrinterException; | public abstract void print(); |
public abstract boolean printDialog(); | printDialog(); | public abstract boolean printDialog(); |
public abstract void setCopies(); | public abstract void setCopies (int copies); | public abstract void setCopies(); |
public abstract String setJobName(String job_name); | public abstract void setJobName (String job_name); | public abstract String setJobName(String job_name); |
public abstract void setPageable(Pageable pageable); | setPageable(Pageable pageable); | public abstract void setPageable(Pageable pageable); |
public abstract void setPrintable(Printable printable); | setPrintable(Printable printable); | public abstract void setPrintable(Printable printable); |
public abstract PageFormat validatePage(PageFormat page); | validatePage(PageFormat page); | public abstract PageFormat validatePage(PageFormat page); |
return maximum.compareTo(num) >= 0 ? num : null; | if ((maximum != null) && maximum.compareTo(num) < 0) num = null; return num; | public Object getNextValue() { Number num; if (value instanceof Double) num = new Double(value.doubleValue() + stepSize.doubleValue()); else if (value instanceof Float) num = new Double(value.floatValue() + stepSize.floatValue()); else if (value instanceof Long) num = new Long(value.longVa... |
return minimum.compareTo(num) <= 0 ? num : null; | if ((minimum != null) && minimum.compareTo(num) > 0) num = null; return num; | public Object getPreviousValue() { Number num; if (value instanceof Double) num = new Double(value.doubleValue() - stepSize.doubleValue()); else if (value instanceof Float) num = new Double(value.floatValue() - stepSize.floatValue()); else if (value instanceof Long) num = new Long(value.lo... |
Graphics g2 = g.create(); g2.setFont(this.getFont()); g2.setColor(this.getForeground()); | if (g instanceof Graphics2D) { g.setFont (this.getFont()); g.setColor (this.getForeground()); return g; } else { Graphics g2 = g.create (); g2.setFont (this.getFont()); g2.setColor (this.getForeground()); | protected Graphics getComponentGraphics(Graphics g) { Graphics g2 = g.create(); g2.setFont(this.getFont()); g2.setColor(this.getForeground()); return g2; } |
} | protected Graphics getComponentGraphics(Graphics g) { Graphics g2 = g.create(); g2.setFont(this.getFont()); g2.setColor(this.getForeground()); return g2; } | |
if (ui != null) | else if (ui != null) | public Dimension getPreferredSize() { Dimension prefSize = null; if (preferredSize != null) prefSize = preferredSize; if (ui != null) { Dimension s = ui.getPreferredSize(this); if (s != null) prefSize = s; } if (prefSize == null) prefSize = super.getPreferredSize(); // make sure ... |
super(TYPE_BYTE, size, numBanks); bankData = new byte[numBanks][size]; data = bankData[0]; | super(TYPE_BYTE, size); data = new byte[size]; | public DataBufferByte(int size, int numBanks) { super(TYPE_BYTE, size, numBanks); bankData = new byte[numBanks][size]; data = bankData[0]; } |
void removePropertyChangeListener(PropertyChangeListener listener) | public void removePropertyChangeListener(PropertyChangeListener listener) | void removePropertyChangeListener(PropertyChangeListener listener) { propertyChangeSupport.removePropertyChangeListener(listener); } |
Unsafe.debug(nr); Unsafe.debug(address); | public static Throwable systemException(int nr, int address) throws PragmaUninterruptible { //Unsafe.getCurrentProcessor().getArchitecture().getStackReader().debugStackTrace(); //Unsafe.die(); final String hexAddress = NumberUtils.hex(address, 8); final String state = " (" + Unsafe.getCurrentProcessor().getCurrent... | |
root.pred = this; | void access() { if (accessOrder && succ != null) { modCount++; if (this == root) { root = succ; pred.succ = this; succ = null; } else { pred.succ = succ; succ.pred = pred; ... | |
protected void doResolve(AbstractVmClassLoader clc) { | protected void doResolve(VmClassLoader clc) { | protected void doResolve(AbstractVmClassLoader clc) { if (vmClass == null) { final String name = getClassName(); try { vmClass = clc.loadClass(name, true); } catch (ClassNotFoundException ex) { throw (NoClassDefFoundError)new NoClassDefFoundError(name).initCause(ex); } } } |
} | protected void paintBorder(Graphics g) { if (borderPainted) getBorder().paintBorder(this, g, 0, 0, getSize(null).width, getSize(null).height); } | |
invalidate(); | public void updateUI() { setUI((MenuBarUI) UIManager.getUI(this)); invalidate(); } | |
public abstract void addPropertyChangeListener(PropertyChangeListener l); | void addPropertyChangeListener(PropertyChangeListener l); | public abstract void addPropertyChangeListener(PropertyChangeListener l); |
public abstract void removePropertyChangeListener(PropertyChangeListener l); | void removePropertyChangeListener(PropertyChangeListener l); | public abstract void removePropertyChangeListener(PropertyChangeListener l); |
public abstract void setObject(Object bean); | void setObject(Object bean); | public abstract void setObject(Object bean); |
this.pll2 = hasCRTC2 ? new RadeonPllRegs(true) : null; | public RadeonVgaState(boolean hasCRTC2, RadeonVgaIO io) { this.common = new RadeonCommonRegs(); this.crtc = new RadeonCrtcRegs(); this.fp = new RadeonFpRegs(); this.pll = new RadeonPllRegs(false); this.pll2 = hasCRTC2 ? new RadeonPllRegs(true) : null; saveFromVGA(io); } | |
OID oid = new OID(); oid.components = this.components; oid.strRep = this.strRep; return oid; | try { return super.clone(); } catch (CloneNotSupportedException cnse) { InternalError ie = new InternalError(); ie.initCause(cnse); throw ie; } | public Object clone() { OID oid = new OID(); oid.components = this.components; oid.strRep = this.strRep; return oid; } |
ORB orb = Restricted_ORB.Singleton; | ORB orb = OrbRestricted.Singleton; | public static TypeCode type() { ORB orb = Restricted_ORB.Singleton; return orb.create_alias_tc(id(), "Istring", orb.create_string_tc(0)); } |
Charset charset = null; | private static int writeString(OutputStream out, int tag, String str) throws IOException { Charset charset = null; byte[] b = null; switch (tag & 0x1F) { case NUMERIC_STRING: case PRINTABLE_STRING: case T61_STRING: case VIDEOTEX_STRING: case IA5_STRING: case... | |
charset = Charset.forName("ISO-8859-1"); | b = toIso88591(str); | private static int writeString(OutputStream out, int tag, String str) throws IOException { Charset charset = null; byte[] b = null; switch (tag & 0x1F) { case NUMERIC_STRING: case PRINTABLE_STRING: case T61_STRING: case VIDEOTEX_STRING: case IA5_STRING: case... |
charset = Charset.forName("UTF-16BE"); | b = toUtf16Be(str); | private static int writeString(OutputStream out, int tag, String str) throws IOException { Charset charset = null; byte[] b = null; switch (tag & 0x1F) { case NUMERIC_STRING: case PRINTABLE_STRING: case T61_STRING: case VIDEOTEX_STRING: case IA5_STRING: case... |
charset = Charset.forName("UTF-8"); | b = toUtf8(str); | private static int writeString(OutputStream out, int tag, String str) throws IOException { Charset charset = null; byte[] b = null; switch (tag & 0x1F) { case NUMERIC_STRING: case PRINTABLE_STRING: case T61_STRING: case VIDEOTEX_STRING: case IA5_STRING: case... |
} if (charset == null) throw new DEREncodingException("no charset"); CharsetEncoder encoder = charset.newEncoder(); ByteBuffer result = encoder.encode(CharBuffer.wrap(str)); if (result.hasArray()) { b = result.array(); } else { b = new byte[result.remaining()]; result.get(b); | private static int writeString(OutputStream out, int tag, String str) throws IOException { Charset charset = null; byte[] b = null; switch (tag & 0x1F) { case NUMERIC_STRING: case PRINTABLE_STRING: case T61_STRING: case VIDEOTEX_STRING: case IA5_STRING: case... | |
if (e == null) { header.repaint(draggingHeaderRect); draggingHeaderRect = null; return; } else | void endDragging(MouseEvent e) { header.setDraggedColumn(null); // Return if the mouse have left the header area while pressed. if (e == null) { header.repaint(draggingHeaderRect); draggingHeaderRect = null; return; } else draggingHeaderRect = null; ... | |
int col = - 1; | int col = model.getColumnCount()-1; | void endDragging(MouseEvent e) { header.setDraggedColumn(null); // Return if the mouse have left the header area while pressed. if (e == null) { header.repaint(draggingHeaderRect); draggingHeaderRect = null; return; } else draggingHeaderRect = null; ... |
if (col >= 0) | void endDragging(MouseEvent e) { header.setDraggedColumn(null); // Return if the mouse have left the header area while pressed. if (e == null) { header.repaint(draggingHeaderRect); draggingHeaderRect = null; return; } else draggingHeaderRect = null; ... | |
if (header.getResizingColumn() != null && header.getResizingAllowed()) endResizing(); if (header.getDraggedColumn() != null && header.getReorderingAllowed()) endDragging(null); | public void mouseExited(MouseEvent e) { if (header.getResizingColumn() != null && header.getResizingAllowed()) endResizing(); if (header.getDraggedColumn() != null && header.getReorderingAllowed()) endDragging(null); } | |
public void setRect(Raster srcRaster) { setRect(srcRaster, 0, 0); } | public void setRect(Raster srcRaster) { setRect(0, 0, srcRaster); } | public void setRect(Raster srcRaster) { setRect(srcRaster, 0, 0); } |
private String makeString(int tag, byte[] value) | private static String makeString(int tag, byte[] value) | private String makeString(int tag, byte[] value) throws IOException { Charset charset = null; switch (tag & 0x1F) { case NUMERIC_STRING: case PRINTABLE_STRING: case T61_STRING: case VIDEOTEX_STRING: case IA5_STRING: case GRAPHIC_STRING: case ISO646_STRIN... |
Charset charset = null; | private String makeString(int tag, byte[] value) throws IOException { Charset charset = null; switch (tag & 0x1F) { case NUMERIC_STRING: case PRINTABLE_STRING: case T61_STRING: case VIDEOTEX_STRING: case IA5_STRING: case GRAPHIC_STRING: case ISO646_STRIN... | |
charset = Charset.forName("ISO-8859-1"); break; | return fromIso88591(value); | private String makeString(int tag, byte[] value) throws IOException { Charset charset = null; switch (tag & 0x1F) { case NUMERIC_STRING: case PRINTABLE_STRING: case T61_STRING: case VIDEOTEX_STRING: case IA5_STRING: case GRAPHIC_STRING: case ISO646_STRIN... |
charset = Charset.forName("UTF-16BE"); break; | return fromUtf16Be(value); | private String makeString(int tag, byte[] value) throws IOException { Charset charset = null; switch (tag & 0x1F) { case NUMERIC_STRING: case PRINTABLE_STRING: case T61_STRING: case VIDEOTEX_STRING: case IA5_STRING: case GRAPHIC_STRING: case ISO646_STRIN... |
charset = Charset.forName("UTF-8"); break; | return fromUtf8(value); | private String makeString(int tag, byte[] value) throws IOException { Charset charset = null; switch (tag & 0x1F) { case NUMERIC_STRING: case PRINTABLE_STRING: case T61_STRING: case VIDEOTEX_STRING: case IA5_STRING: case GRAPHIC_STRING: case ISO646_STRIN... |
if (charset == null) throw new DEREncodingException("no decoder"); CharsetDecoder decoder = charset.newDecoder(); CharBuffer result = decoder.decode(ByteBuffer.wrap(value)); char[] buf = new char[result.remaining()]; result.get(buf); return new String(buf); | private String makeString(int tag, byte[] value) throws IOException { Charset charset = null; switch (tag & 0x1F) { case NUMERIC_STRING: case PRINTABLE_STRING: case T61_STRING: case VIDEOTEX_STRING: case IA5_STRING: case GRAPHIC_STRING: case ISO646_STRIN... | |
return "JToolBar"; } | StringBuffer sb = new StringBuffer(super.paramString()); sb.append(",floatable=").append(floatable); sb.append(",margin="); if (margin != null) sb.append(margin); sb.append(",orientation="); if (orientation == HORIZONTAL) sb.append("HORIZONTAL"); else sb.append(VERTICAL); sb.append(",paintBorder=").append(paintBorder);... | protected String paramString() { return "JToolBar"; } // paramString() |
{ this.e = e; this.index = i; this.removed = removed; this.added = added; } | { this.e = e; this.index = i; addRemovedElements(removed); addAddedElements(added); } | public Edit(Element e, int i, Element[] removed, Element[] added) { this.e = e; this.index = i; this.removed = removed; this.added = added; } |
par.replace(index, removed.length, added); edits.add(new Edit(par, index, removed, added)); | Edit edit = getEditForParagraphAndIndex(par, index); edit.addRemovedElements(removed); edit.addAddedElements(added); | protected void changeUpdate() { // Split up the element at the start offset if necessary. Element el = getCharacterElement(offset); Element[] res = split(el, offset, 0); BranchElement par = (BranchElement) el.getParentElement(); if (res[1] != null) { int index = par.getEl... |
elementStack.push(root); elementStack.push(root.getElement(root.getElementIndex(offset))); | Element current = root; int index; while (!current.isLeaf()) { index = current.getElementIndex(offset); elementStack.push(current); current = current.getElement(index); } | public void insert(int offset, int length, ElementSpec[] data, DefaultDocumentEvent ev) { if (length == 0) return; this.offset = offset; this.length = length; this.endOffset = offset + length; documentEvent = ev; // Push the root and the paragraph at off... |
addEdit(curr.e, curr.index, curr.removed, curr.added); | BranchElement e = (BranchElement) curr.e; Element[] removed = curr.getRemovedElements(); Element[] added = curr.getAddedElements(); e.replace(curr.index, removed.length, added); addEdit(e, curr.index, removed, added); | public void insert(int offset, int length, ElementSpec[] data, DefaultDocumentEvent ev) { if (length == 0) return; this.offset = offset; this.length = length; this.endOffset = offset + length; documentEvent = ev; // Push the root and the paragraph at off... |
Element[] add = new Element[] { newEl1, newEl2 }; paragraph.replace (index, 2, add); edits.add(new Edit(paragraph, index, new Element[] { target, next }, add)); | Edit edit = getEditForParagraphAndIndex(paragraph, index); edit.addRemovedElement(target); edit.addRemovedElement(next); edit.addAddedElement (newEl1); edit.addAddedElement (newEl2); | private void insertContentTag(ElementSpec tag) { int len = tag.getLength(); int dir = tag.getDirection(); AttributeSet tagAtts = tag.getAttributes(); if (dir == ElementSpec.JoinPreviousDirection) { // The mauve tests to this class show that a JoinPrevious insertion //... |
paragraph.replace(index, removed.length, added); edits.add(new Edit(paragraph, index, removed, added)); | Edit edit = getEditForParagraphAndIndex(paragraph, index); edit.addRemovedElements(removed); edit.addAddedElements(added); | private void insertContentTag(ElementSpec tag) { int len = tag.getLength(); int dir = tag.getDirection(); AttributeSet tagAtts = tag.getAttributes(); if (dir == ElementSpec.JoinPreviousDirection) { // The mauve tests to this class show that a JoinPrevious insertion //... |
edits.add(new Edit(newBranch, 0, null, newLeaves)); | private void insertFracture(ElementSpec tag) { // This is the parent of the paragraph about to be fractured. We will // create a new child of this parent. BranchElement parent = (BranchElement) elementStack.peek(); int parentIndex = parent.getElementIndex(offset); // This is the o... | |
Element[] add = new Element[] { newPreviousLeaf }; | private void insertFracture(ElementSpec tag) { // This is the parent of the paragraph about to be fractured. We will // create a new child of this parent. BranchElement parent = (BranchElement) elementStack.peek(); int parentIndex = parent.getElementIndex(offset); // This is the o... | |
previous.replace(previousIndex, removeSize, add); edits.add(new Edit(previous, previousIndex, remove, add)); | Edit edit = getEditForParagraphAndIndex(previous, previousIndex); edit.addRemovedElements(remove); | private void insertFracture(ElementSpec tag) { // This is the parent of the paragraph about to be fractured. We will // create a new child of this parent. BranchElement parent = (BranchElement) elementStack.peek(); int parentIndex = parent.getElementIndex(offset); // This is the o... |
Element[] nb = new Element[] { newBranch }; | private void insertFracture(ElementSpec tag) { // This is the parent of the paragraph about to be fractured. We will // create a new child of this parent. BranchElement parent = (BranchElement) elementStack.peek(); int parentIndex = parent.getElementIndex(offset); // This is the o... | |
parent.replace(index, 0, nb); edits.add(new Edit(parent, index, null, nb)); | Edit edit2 = getEditForParagraphAndIndex(parent, index); edit2.addAddedElement(newBranch); elementStack.push(newBranch); | private void insertFracture(ElementSpec tag) { // This is the parent of the paragraph about to be fractured. We will // create a new child of this parent. BranchElement parent = (BranchElement) elementStack.peek(); int parentIndex = parent.getElementIndex(offset); // This is the o... |
par.replace(index, removed.length, added); edits.add(new Edit(par, index, removed, added)); | Edit edit = getEditForParagraphAndIndex(par, index); edit.addRemovedElements(removed); edit.addAddedElements(added); | private Element insertParagraph(BranchElement par, int offset) { Element current = par.getElement(par.getElementIndex(offset)); Element[] res = split(current, offset, 0); int index = par.getElementIndex(offset); Element ret; if (res[1] != null) { Element[] removed; ... |
Element[] added = new Element[]{ ret }; par.replace(index, 0, added); edits.add(new Edit(par, index, new Element[0], added)); | Edit edit = getEditForParagraphAndIndex(par, index); edit.addAddedElement(ret); | private Element insertParagraph(BranchElement par, int offset) { Element current = par.getElement(par.getElementIndex(offset)); Element[] res = split(current, offset, 0); int index = par.getElementIndex(offset); Element ret; if (res[1] != null) { Element[] removed; ... |
if (data[0].getType() == ElementSpec.EndTagType) | int i = 0; if (data[0].getType() == ElementSpec.ContentType) | protected void insertUpdate(ElementSpec[] data) { if (data[0].getType() == ElementSpec.EndTagType) { // fracture deepest child here BranchElement paragraph = (BranchElement) elementStack.peek(); Element curr = paragraph.getParentElement(); int index = curr.getEleme... |
BranchElement paragraph = (BranchElement) elementStack.peek(); Element curr = paragraph.getParentElement(); int index = curr.getElementIndex(offset); while (!curr.isLeaf()) { index = curr.getElementIndex(offset); curr = curr.getElement(index); } Element parent = curr.getParentElement(); Element newEl1 = createLeafEleme... | i = 1; insertFirstContentTag(data); | protected void insertUpdate(ElementSpec[] data) { if (data[0].getType() == ElementSpec.EndTagType) { // fracture deepest child here BranchElement paragraph = (BranchElement) elementStack.peek(); Element curr = paragraph.getParentElement(); int index = curr.getEleme... |
for (int i = 0; i < data.length; i++) | for (; i < data.length; i++) | protected void insertUpdate(ElementSpec[] data) { if (data[0].getType() == ElementSpec.EndTagType) { // fracture deepest child here BranchElement paragraph = (BranchElement) elementStack.peek(); Element curr = paragraph.getParentElement(); int index = curr.getEleme... |
Element paragraph = root.getElement(i); | BranchElement paragraph = (BranchElement) root.getElement(i); | protected void removeUpdate() { int startParagraph = root.getElementIndex(offset); int endParagraph = root.getElementIndex(offset + length); Element[] empty = new Element[0]; int removeStart = -1; int removeEnd = -1; for (int i = startParagraph; i < endParagraph; i++) { ... |
((BranchElement) paragraph).replace(contentStart, removeLen, empty); documentEvent.addEdit(new ElementEdit(paragraph, contentStart, removed, empty)); | Edit edit = getEditForParagraphAndIndex(paragraph, contentStart); edit.addRemovedElements(removed); | protected void removeUpdate() { int startParagraph = root.getElementIndex(offset); int endParagraph = root.getElementIndex(offset + length); Element[] empty = new Element[0]; int removeStart = -1; int removeEnd = -1; for (int i = startParagraph; i < endParagraph; i++) { ... |
((BranchElement) root).replace(removeStart, removeLen, empty); documentEvent.addEdit(new ElementEdit(root, removeStart, removed, empty)); | Edit edit = getEditForParagraphAndIndex((BranchElement)root, removeStart); edit.addRemovedElements(removed); | protected void removeUpdate() { int startParagraph = root.getElementIndex(offset); int endParagraph = root.getElementIndex(offset + length); Element[] empty = new Element[0]; int removeStart = -1; int removeEnd = -1; for (int i = startParagraph; i < endParagraph; i++) { ... |
((BranchElement) el).replace(index, removed.length, added); edits.add(new Edit(el, index, removed, added)); | Edit edit = getEditForParagraphAndIndex((BranchElement)el, index); edit.addRemovedElements(removed); edit.addAddedElements(added); | private Element[] split(Element el, int offset, int space) { // If we are at an element boundary, then return an empty array. if ((offset == el.getStartOffset() || offset == el.getEndOffset()) && space == 0 && el.isLeaf()) return new Element[2]; // If the element is an instance of ... |
newPar.replace(0, 0, newAdded); | Edit edit2 = getEditForParagraphAndIndex(newPar, 0); edit2.addAddedElements(newAdded); | private Element[] split(Element el, int offset, int space) { // If we are at an element boundary, then return an empty array. if ((offset == el.getStartOffset() || offset == el.getEndOffset()) && space == 0 && el.isLeaf()) return new Element[2]; // If the element is an instance of ... |
newPar.replace(0, 0, removed); | Edit edit2 = getEditForParagraphAndIndex(newPar, 0); edit2.addAddedElements(removed); | private Element[] split(Element el, int offset, int space) { // If we are at an element boundary, then return an empty array. if ((offset == el.getStartOffset() || offset == el.getEndOffset()) && space == 0 && el.isLeaf()) return new Element[2]; // If the element is an instance of ... |
{ try { String last = getText(endOffset - 1, 1); if (!last.equals("\n")) | protected void insertUpdate(DefaultDocumentEvent ev, AttributeSet attr) { super.insertUpdate(ev, attr); // If the attribute set is null, use an empty attribute set. if (attr == null) attr = SimpleAttributeSet.EMPTY; int offset = ev.getOffset(); int length = ev.getLength(); int endOffset = offs... | |
} catch (BadLocationException ble) { AssertionError ae = new AssertionError(); ae.initCause(ble); throw ae; } } | protected void insertUpdate(DefaultDocumentEvent ev, AttributeSet attr) { super.insertUpdate(ev, attr); // If the attribute set is null, use an empty attribute set. if (attr == null) attr = SimpleAttributeSet.EMPTY; int offset = ev.getOffset(); int length = ev.getLength(); int endOffset = offs... | |
public ElementChange getChange(Element elem) | public DocumentEvent.ElementChange getChange(Element elem) | public ElementChange getChange(Element elem) { return (ElementChange) changes.get(elem); } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.