Lines 43-48
Link Here
|
43 |
import org.netbeans.spi.editor.fold.FoldOperation; |
43 |
import org.netbeans.spi.editor.fold.FoldOperation; |
44 |
import org.openide.util.Exceptions; |
44 |
import org.openide.util.Exceptions; |
45 |
import org.openide.util.NbBundle; |
45 |
import org.openide.util.NbBundle; |
|
|
46 |
import org.openide.util.RequestProcessor; |
46 |
|
47 |
|
47 |
/** |
48 |
/** |
48 |
* This class is an implementation of @see org.netbeans.spi.editor.fold.FoldManager |
49 |
* This class is an implementation of @see org.netbeans.spi.editor.fold.FoldManager |
Lines 112-128
Link Here
|
112 |
} |
113 |
} |
113 |
} |
114 |
} |
114 |
|
115 |
|
115 |
public void initFolds(FoldHierarchyTransaction transaction) { |
116 |
public void initFolds(final FoldHierarchyTransaction transaction) { |
|
|
117 |
RequestProcessor.getDefault().post(new Runnable() { |
118 |
//SwingUtilities.invokeLater(new Runnable() { |
119 |
public void run() { |
120 |
doInit(transaction); |
121 |
} |
122 |
}); |
123 |
} |
124 |
|
125 |
private void doInit(final FoldHierarchyTransaction transaction) { |
116 |
try { |
126 |
try { |
117 |
Document doc = getOperation().getHierarchy().getComponent().getDocument(); |
127 |
Document doc = getOperation().getHierarchy().getComponent().getDocument(); |
118 |
//filtering of the PlainDocument set during the JEditorPane initializatin |
128 |
//filtering of the PlainDocument set during the JEditorPane initializatin |
119 |
if (!(doc instanceof BaseDocument)) { |
129 |
if (!(doc instanceof BaseDocument)) { |
120 |
return; |
130 |
return; |
121 |
} |
131 |
} |
122 |
model = DocumentModel.getDocumentModel((BaseDocument) getDocument()); |
132 |
model = DocumentModel.getDocumentModel(getDocument()); |
123 |
model.addDocumentModelStateListener(DMLS); |
133 |
model.addDocumentModelStateListener(DMLS); |
124 |
model.addDocumentModelListener(DML); |
134 |
model.addDocumentModelListener(DML); |
125 |
|
|
|
126 |
updateFolds(transaction); |
135 |
updateFolds(transaction); |
127 |
} catch (DocumentModelException ex) { |
136 |
} catch (DocumentModelException ex) { |
128 |
Exceptions.printStackTrace(ex); |
137 |
Exceptions.printStackTrace(ex); |