}
break;
}
case Link.ANCHOR_PC_OFFSET: {
Object row = this.list.getSelectedValue();
MethodDefRow mdr = null;
if (row instanceof CodeRow) {
CodeRow cr = (CodeRow) row;
mdr = cr.getEnclosingMethodDef();
} else if (row instanceof LabelRow) {
LabelRow lr = (LabelRow) row;
mdr = lr.getEnclosingMethodDef();
} else if (row instanceof LocalVariableDefRow) {
LocalVariableDefRow lvdr = (LocalVariableDefRow) row;
mdr = lvdr.getEnclosingMethodDef();
} else if (row instanceof MethodDefRow) {
mdr = (MethodDefRow) row;
}
if (mdr != null) {
List codeRows = mdr.getCodeRows();
for (int i = 0; i < codeRows.size(); i++) {
if (codeRows.get(i) instanceof LabelRow)
continue;
CodeRow cr = (CodeRow) codeRows.get(i);
if (cr.getPosition() >= link.getPosition()) {
int index = this.rows.indexOf(cr);
this.list.setSelectedIndex(index);
this.list.ensureIndexIsVisible(index);
break;
}
}
}
break;
}
case Link.ANCHOR_CLASS_DEF: {
int index = this.rows.indexOf(this.classDef);
this.list.setSelectedIndex(index);
break;
}
case Link.ANCHOR_FIELD_DEF: {
List fields = this.classDef.getFields();
for (int i = 0; i < fields.size(); i++) {
FieldDefRow fdr = (FieldDefRow) fields.get(i);
if (fdr.getField().getSignatureLine().equals(
link.getField().getSignatureLine())) {
int index = this.rows.indexOf(fdr);
this.list.setSelectedIndex(index);
this.list.ensureIndexIsVisible(index);
break switchLabel;
}
}
throw new AssertionError("Field in link not found: " + link.dump());
}
case Link.ANCHOR_METHOD_CODE: {
List methods = this.classDef.getMethods();
for (int i = 0; i < methods.size(); i++) {
MethodDefRow mdr = (MethodDefRow) methods.get(i);
if (mdr.getMethod().getSignatureLine().equals(
link.getMethod().getSignatureLine())) {
for (EditorRow er : mdr.getCodeRows()) {
if (er instanceof CodeRow) {
CodeRow cr = (CodeRow) er;
if (cr.getPosition() == link.getPosition()) {
int index = this.rows.indexOf(cr);
this.list.setSelectedIndex(index);
this.list.ensureIndexIsVisible(index);
break switchLabel;
}
}
}
throw new AssertionError(
"Position of method in link not found: "
+ link.dump());
}
}
throw new AssertionError("Method in link not found: " + link.dump());
}
case Link.ANCHOR_METHOD_DEF: {
List methods = this.classDef.getMethods();
for (int i = 0; i < methods.size(); i++) {
MethodDefRow mdr = (MethodDefRow) methods.get(i);
if (mdr.getMethod().getSignatureLine().equals(
link.getMethod().getSignatureLine())) {
int index = this.rows.indexOf(mdr);
this.list.setSelectedIndex(index);
this.list.ensureIndexIsVisible(index);
break switchLabel;
}
}
throw new AssertionError("Method in link not found: " + link.dump());
}
case Link.ANCHOR_METHOD_LV: {
List methods = this.classDef.getMethods();
for (int i = 0; i < methods.size(); i++) {
MethodDefRow mdr = (MethodDefRow) methods.get(i);
if (mdr.getMethod().getSignatureLine().equals(
link.getMethod().getSignatureLine())) {
java.util.List lvRows = mdr.getLocalVariables();
for (int j = 0; j < lvRows.size(); j++) {
LocalVariableDefRow lvdr = (LocalVariableDefRow) lvRows
.get(j);
if (lvdr.getLocalVariable().getSignatureLine().equals(
link.getLv().getSignatureLine())) {