protected void onUserdocLinkClicked(final IObservableValue userdocUrlObservable) { String userdocUrl = (String) userdocUrlObservable.getValue(); if (StringUtils.isEmpty(userdocUrl)) { return; } new BrowserUtility() .checkedCreateExternalBrowser( userdocUrl, OpenShiftCommonUIActivator.PLUGIN_ID, OpenShiftCommonUIActivator.getDefault().getLog()); }
private void showHideUserdocLink() { boolean signupUrlExists = !StringUtils.isEmpty(pageModel.getUserdocUrl()); if (signupUrlExists) { IConnectionFactory factory = pageModel.getConnectionFactory(); if (factory != null) { StyledTextUtils.emulateLinkWidget( NLS.bind( "New to OpenShift {0}? Explore the <a>getting started documentation</a>.", factory.getName()), userdocLink); } } UIUtils.setVisibleAndExclude(signupUrlExists, userdocLink); }
@Override public StyledString getStyledText(Object arg) { if (arg instanceof IResource) { IResource resource = (IResource) arg; StyledString text = new StyledString(); if (isFailedStatus(resource)) { text.append(((IStatus) resource).getMessage()); } else { text.append(StringUtils.humanize(resource.getKind().toString())); text.append(resource.getName(), StyledString.QUALIFIER_STYLER); } return text; } return null; }
private boolean importProject() { try { final DelegatingProgressMonitor delegatingMonitor = new DelegatingProgressMonitor(); ImportJob importJob = new ImportJob(model.getGitUrl(), model.getCloneDestination(), delegatingMonitor) .setGitRef(model.getGitRef()); String gitContextDir = model.getGitContextDir(); if (!StringUtils.isEmptyOrNull(gitContextDir)) { importJob.setFilters(Collections.singleton(gitContextDir)); } IStatus jobResult = WizardUtils.runInWizard(importJob, delegatingMonitor, getContainer()); return JobUtils.isOk(jobResult); } catch (Exception e) { ErrorDialog.openError( getShell(), "Error", "Could not create local git repository.", OpenShiftUIActivator.statusFactory() .errorStatus("An exception occurred while creating local git repository.", e)); return false; } }