|
Lines 8-14
Link Here
|
| 8 |
* Contributors: |
8 |
* Contributors: |
| 9 |
* IBM Corporation - initial API and implementation |
9 |
* IBM Corporation - initial API and implementation |
| 10 |
* Jacek Pospychala <jacek.pospychala@pl.ibm.com> - bug 211127 |
10 |
* Jacek Pospychala <jacek.pospychala@pl.ibm.com> - bug 211127 |
| 11 |
* Wojciech Galanciak <wojciech.galanciak@gmail.com> - bug 282804, 277648 |
11 |
* Wojciech Galanciak <wojciech.galanciak@gmail.com> - bug 282804, 277648, 284086 |
| 12 |
*******************************************************************************/ |
12 |
*******************************************************************************/ |
| 13 |
package org.eclipse.pde.internal.runtime.registry; |
13 |
package org.eclipse.pde.internal.runtime.registry; |
| 14 |
|
14 |
|
|
Lines 169-175
Link Here
|
| 169 |
|
169 |
|
| 170 |
initializeModelJob = new Job(PDERuntimeMessages.RegistryBrowser_InitializingView) { |
170 |
initializeModelJob = new Job(PDERuntimeMessages.RegistryBrowser_InitializingView) { |
| 171 |
public IStatus run(IProgressMonitor monitor) { |
171 |
public IStatus run(IProgressMonitor monitor) { |
| 172 |
model.connect(monitor, true); |
172 |
if (model.connect(monitor, true) == false) { |
|
|
173 |
fTreeViewer.getControl().getDisplay().asyncExec(new Runnable() { |
| 174 |
public void run() { |
| 175 |
MessageDialog.openInformation(getSite().getShell(), PDERuntimeMessages.RegistryView_connectionError_title, PDERuntimeMessages.RegistryView_connectionError_message + model.getURI()); |
| 176 |
initializeModelJob = null; |
| 177 |
initializeModel("local:///"); //$NON-NLS-1$ |
| 178 |
} |
| 179 |
}); |
| 180 |
return Status.CANCEL_STATUS; |
| 181 |
} |
| 173 |
initializeModelJob = null; |
182 |
initializeModelJob = null; |
| 174 |
return monitor.isCanceled() ? Status.CANCEL_STATUS : Status.OK_STATUS; |
183 |
return monitor.isCanceled() ? Status.CANCEL_STATUS : Status.OK_STATUS; |
| 175 |
} |
184 |
} |
|
Lines 369-386
Link Here
|
| 369 |
private void makeActions() { |
378 |
private void makeActions() { |
| 370 |
fConnectAction = new Action(PDERuntimeMessages.RegistryView_connectAction_label) { |
379 |
fConnectAction = new Action(PDERuntimeMessages.RegistryView_connectAction_label) { |
| 371 |
public void run() { |
380 |
public void run() { |
| 372 |
InputDialog cd = new InputDialog(Display.getCurrent().getActiveShell(), PDERuntimeMessages.RegistryView_connectAction_label, PDERuntimeMessages.RegistryView_enterURL, new String(), new IInputValidator() { |
381 |
InputDialog cd = new InputDialog(Display.getCurrent().getActiveShell(), PDERuntimeMessages.RegistryView_connectAction_label, PDERuntimeMessages.RegistryView_enterURL, "r-osgi://localhost:9278", new IInputValidator() { //$NON-NLS-1$ |
| 373 |
|
382 |
|
| 374 |
public String isValid(String url) { |
383 |
public String isValid(String url) { |
| 375 |
try { |
384 |
try { |
| 376 |
// check if it's possible to instantiate given url |
385 |
// check if it's possible to instantiate given url |
| 377 |
new URI(url); |
386 |
new URI(url); |
| 378 |
} catch (URISyntaxException e) { |
387 |
} catch (URISyntaxException e) { |
| 379 |
return e.getMessage(); |
388 |
return e.getMessage(); |
| 380 |
} |
389 |
} |
| 381 |
return null; |
390 |
return null; |
| 382 |
} |
391 |
} |
| 383 |
}); |
392 |
}); |
| 384 |
if (cd.open() == Window.OK) { |
393 |
if (cd.open() == Window.OK) { |
| 385 |
model.disconnect(); |
394 |
model.disconnect(); |
| 386 |
initializeModel(cd.getValue()); |
395 |
initializeModel(cd.getValue()); |
|
Lines 534-540
Link Here
|
| 534 |
} |
543 |
} |
| 535 |
|
544 |
|
| 536 |
public void updateTitle() { |
545 |
public void updateTitle() { |
| 537 |
setContentDescription(getTitleSummary()); |
546 |
URI uri = null; |
|
|
547 |
try { |
| 548 |
uri = new URI(model.getURI()); |
| 549 |
} catch (URISyntaxException e) { |
| 550 |
e.printStackTrace(); |
| 551 |
} |
| 552 |
String uriString = ""; //$NON-NLS-1$ |
| 553 |
if (!"local".equals(uri.getScheme()) && uri.getScheme() != null) //$NON-NLS-1$ |
| 554 |
uriString = "[" + uri.toString() + "] "; //$NON-NLS-1$ //$NON-NLS-2$ |
| 555 |
|
| 556 |
setContentDescription(uriString + getTitleSummary()); |
| 538 |
} |
557 |
} |
| 539 |
|
558 |
|
| 540 |
protected Tree getUndisposedTree() { |
559 |
protected Tree getUndisposedTree() { |