Lines 97-102
Link Here
|
97 |
CloneableOpenSupport redirect = CloneableOpenSupportRedirector.findRedirect(this); |
97 |
CloneableOpenSupport redirect = CloneableOpenSupportRedirector.findRedirect(this); |
98 |
if (redirect != null) { |
98 |
if (redirect != null) { |
99 |
redirect.open(); |
99 |
redirect.open(); |
|
|
100 |
redirectedOpenImpl(redirect); |
100 |
return; |
101 |
return; |
101 |
} |
102 |
} |
102 |
//Bugfix #10688 open() is now run in AWT thread |
103 |
//Bugfix #10688 open() is now run in AWT thread |
Lines 246-251
Link Here
|
246 |
*/ |
247 |
*/ |
247 |
protected abstract String messageOpened(); |
248 |
protected abstract String messageOpened(); |
248 |
|
249 |
|
|
|
250 |
private void redirectedOpenImpl(CloneableOpenSupport redirectedTo) { |
251 |
// there is a common patern in user code: |
252 |
// CloneableEditorSupport ces = ...; |
253 |
// ces.edit(); |
254 |
// JEditorPane[] panes = ces.getOpenedPanes(); |
255 |
// if (panes != null) panes[0].setPosition(offset); |
256 |
// in case when redirection has happened during edit() call |
257 |
// 'ces' instance returns null for getOpenedPanes |
258 |
// but we want panes to be available for 'ces' instance after redirection; |
259 |
// remember editors from redirected instance to have correct opened panes |
260 |
// for this instance as well |
261 |
this.allEditors = redirectedTo.allEditors; |
262 |
// this.env = redirect.env; |
263 |
redirectedOpen(redirectedTo); |
264 |
} |
265 |
|
266 |
/** |
267 |
* notify that other redirected cos was opened instead of this one. |
268 |
* @param redirectedTo redirected instance which was opened instead of this one |
269 |
*/ |
270 |
protected void redirectedOpen(CloneableOpenSupport redirectedTo) { |
271 |
} |
272 |
|
249 |
/** Abstract interface that is used by CloneableOpenSupport to |
273 |
/** Abstract interface that is used by CloneableOpenSupport to |
250 |
* talk to outside world. |
274 |
* talk to outside world. |
251 |
*/ |
275 |
*/ |