use of org.talend.core.ui.branding.IBrandingConfiguration in project tdi-studio-se by Talend.
the class LoginDialogV2 method getFirstTimeStartupPageIfNeeded.
protected AbstractLoginActionPage getFirstTimeStartupPageIfNeeded() {
AbstractLoginActionPage loginPage = null;
IBrandingService service = (IBrandingService) GlobalServiceRegister.getDefault().getService(IBrandingService.class);
if (service != null) {
IBrandingConfiguration brandingConfiguration = service.getBrandingConfiguration();
if (brandingConfiguration != null && brandingConfiguration.isOnlyRemoteConnection()) {
return null;
}
}
// try to find if there are projects in workspace
Project[] projects = LoginHelper.getInstance().getProjects(LoginHelper.createDefaultLocalConnection());
if (projects == null || projects.length == 0) {
List<ConnectionBean> storedConnections = LoginHelper.getInstance().getStoredConnections();
if (storedConnections == null || storedConnections.isEmpty() || (storedConnections.size() == 1 && !LoginHelper.isRemoteConnection(storedConnections.get(0)) && LoginHelper.isWorkspaceSame(storedConnections.get(0)))) {
// for local license case
loginPage = new LoginFirstTimeStartupActionPage(base, this, SWT.NONE);
}
}
return loginPage;
}
use of org.talend.core.ui.branding.IBrandingConfiguration in project tdi-studio-se by Talend.
the class LoginHelper method filterUsableConnections.
protected List<ConnectionBean> filterUsableConnections(List<ConnectionBean> iStoredConnections) {
if (iStoredConnections == null) {
return null;
}
List<ConnectionBean> filteredConnections = new ArrayList<ConnectionBean>(iStoredConnections);
boolean isOnlyRemoteConnection = false;
IBrandingConfiguration brandingConfiguration = brandingService.getBrandingConfiguration();
if (brandingConfiguration != null) {
isOnlyRemoteConnection = brandingConfiguration.isOnlyRemoteConnection();
}
if (!isOnlyRemoteConnection && PluginChecker.isSVNProviderPluginLoaded()) {
// if this plugin loaded, then means support remote connections, then no need to filter
return filteredConnections;
}
// can be two case: 1 only local connection, 2 only remote connection
Iterator<ConnectionBean> connectionBeanIter = filteredConnections.iterator();
while (connectionBeanIter.hasNext()) {
boolean isRemoteConnection = LoginHelper.isRemoteConnection(connectionBeanIter.next());
if (isOnlyRemoteConnection && !isRemoteConnection) {
// only remote connection, should remove local
connectionBeanIter.remove();
} else if (!isOnlyRemoteConnection && isRemoteConnection) {
// only local connection, should remove remote
connectionBeanIter.remove();
}
}
return filteredConnections;
}
Aggregations