Revision 9398c95d
Added by Andreas Müller almost 3 years ago
eu.etaxonomy.taxeditor.local/src/main/java/eu/etaxonomy/taxeditor/local/server/RemotingLoginDialogLocal.java | ||
---|---|---|
653 | 653 |
selectedServerInfo.refreshInstances(); |
654 | 654 |
} |
655 | 655 |
final List<CdmInstanceInfo> instances = selectedServerInfo.getInstances(); |
656 |
Display.getDefault().asyncExec(new Runnable() { |
|
657 |
@Override |
|
658 |
public void run() { |
|
659 |
if(!instances.isEmpty()) { |
|
660 |
for(CdmInstanceInfo cdmInstance : instances) { |
|
661 |
comboCdmInstance.add(cdmInstance.getName()); |
|
662 |
} |
|
663 |
int instanceIndex = -1; |
|
664 |
if(instanceName != null) { |
|
665 |
instanceIndex = comboCdmInstance.indexOf(instanceName); |
|
666 |
} |
|
667 |
if(instanceIndex == -1) { |
|
668 |
comboCdmInstance.select(0); |
|
669 |
autoConnect = false; |
|
670 |
} else { |
|
671 |
comboCdmInstance.select(instanceIndex); |
|
672 |
} |
|
673 |
onRefreshCdmInstance(); |
|
674 |
comboCdmInstance.setEnabled(true); |
|
675 |
if(autoConnect) { |
|
676 |
connect(); |
|
677 |
} |
|
656 |
Display.getDefault().asyncExec(()->{ |
|
657 |
if(!instances.isEmpty()) { |
|
658 |
for(CdmInstanceInfo cdmInstance : instances) { |
|
659 |
comboCdmInstance.add(cdmInstance.getName()); |
|
660 |
} |
|
661 |
int instanceIndex = -1; |
|
662 |
if(instanceName != null) { |
|
663 |
instanceIndex = comboCdmInstance.indexOf(instanceName); |
|
664 |
} |
|
665 |
if(instanceIndex == -1) { |
|
666 |
comboCdmInstance.select(0); |
|
667 |
autoConnect = false; |
|
678 | 668 |
} else { |
679 |
txtCdmInstanceStatus.setText(STATUS_NO_INSTANCES); |
|
680 |
btnConnect.setEnabled(false); |
|
669 |
comboCdmInstance.select(instanceIndex); |
|
670 |
} |
|
671 |
onRefreshCdmInstance(); |
|
672 |
comboCdmInstance.setEnabled(true); |
|
673 |
if(autoConnect) { |
|
674 |
connect(); |
|
681 | 675 |
} |
676 |
} else { |
|
677 |
txtCdmInstanceStatus.setText(STATUS_NO_INSTANCES); |
|
678 |
btnConnect.setEnabled(false); |
|
682 | 679 |
} |
683 | 680 |
}); |
684 | 681 |
} |
Also available in: Unified diff
cleanup