|
Quick Lists
|
|
Bug ID:
|
4167856
|
|
Votes
|
0
|
|
Synopsis
|
Methods getPartialSpan and getTabbedSpan are missing in LabelView
|
|
Category
|
java:classes_swing
|
|
Reported Against
|
1.2
, swing1.1
|
|
Release Fixed
|
|
|
State
|
11-Closed, duplicate of 4191750,
bug
|
|
Priority:
|
4-Low
|
|
Related Bugs
|
4180826
,
4191750
|
|
Submit Date
|
20-AUG-1998
|
|
Description
|
Methods getPartialSpan and getTabbedSpan are missing in
com.sun.java.swing.text.LabelView class, but
they are described in javadoc.
Here is the example demonstrating the bug:
----------------Test.java---------------------
import java.awt.*;
import com.sun.java.swing.text.*;
public class Test {
public static void main(String[] args){
Element element = new StubElement("StubElement");
LabelView lView = new LabelView(element);
lView.getPartialSpan(10,10);
lView.getTabbedSpan(1.0, null);
}
}
class StubElement implements Element {
Document document = new DefaultStyledDocument();
SimpleAttributeSet attr;
String context;
public StubElement(String context) {
this.context = context;
attr = new SimpleAttributeSet();
StyleConstants.setComponent( attr, new Label());
document = new DefaultStyledDocument();
try {
document.insertString(0, context, new SimpleAttributeSet() );
} catch(BadLocationException e) {
}
}
public Document getDocument() {
return document;
}
public Element getParentElement() { return null; }
public String getName() { return "StubElement"; }
public AttributeSet getAttributes() {
return attr;
}
public int getStartOffset() { return 0; }
public int getEndOffset() {
return document.getLength();
}
public int getElementIndex(int offset) {
return 0;
}
public int getElementCount() { return 1; }
public Element getElement(int index) { return this; }
public boolean isLeaf() { return true; }
}
-- The output ----------------
#>java -version
java version "1.2fcs"
Classic VM (build JDK-1.2fcs-F, green threads, sunwjit)
#>javac Test.java
Test.java:8: Method getPartialSpan(int, int) not found in class
com.sun.java.swing.text.LabelView.
lView.getPartialSpan(10,10);
^
Test.java:9: Method getTabbedSpan(double, null) not found in class
com.sun.java.swing.text.LabelView.
lView.getTabbedSpan(1.0, null);
^
2 errors
------------------------------
======================================================================
|
|
Work Around
|
N/A
|
|
Evaluation
|
There are 1.1 and 1.2 versions of this class, with completely different
implementations. The 1.2 version should match the 1.1 version, and it
would appear that it doesn't currently. Transferring this to Brian,
keeper of the 1.2 version.
xxxxx@xxxxx 1998-08-27
|
|
Comments
|
PLEASE NOTE: JDK6 is formerly known as Project Mustang
|
|
|
 |