本文整理汇总了Java中org.eclipse.swt.custom.BusyIndicator.showWhile方法的典型用法代码示例。如果您正苦于以下问题:Java BusyIndicator.showWhile方法的具体用法?Java BusyIndicator.showWhile怎么用?Java BusyIndicator.showWhile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.custom.BusyIndicator
的用法示例。
在下文中一共展示了BusyIndicator.showWhile方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: endTableEdit
import org.eclipse.swt.custom.BusyIndicator; //导入方法依赖的package包/类
protected void endTableEdit(TableCursor tableCursor, ControlEditor editor,
final CommitEditRunnable commitEditRunnable, TableItem row, int column, String newValue) throws Exception {
if (commitEditRunnable == null) {
return;
}
commitEditRunnable.setTableCursor(tableCursor);
commitEditRunnable.setEditor(editor);
commitEditRunnable.setRow(row);
commitEditRunnable.setColumn(column);
commitEditRunnable.setNewValue(newValue);
BusyIndicator.showWhile(row.getDisplay(), commitEditRunnable);
Exception error = commitEditRunnable.getError();
if (error != null) {
throw error;
}
}
示例2: buttonPressed
import org.eclipse.swt.custom.BusyIndicator; //导入方法依赖的package包/类
protected void buttonPressed(int buttonId) {
switch (buttonId) {
case DETAILS_ID:
BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {
public void run() {
IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
InstallationDialog dialog = new InstallationDialog(getShell(), workbenchWindow);
dialog.setModalParent(CustomAboutDialog.this);
dialog.open();
}
});
break;
default:
super.buttonPressed(buttonId);
break;
}
}
示例3: expandAll
import org.eclipse.swt.custom.BusyIndicator; //导入方法依赖的package包/类
public static void expandAll(final TreeViewer treeViewer, final String context) {
AvroSchemaLogger.logMsg(context + " BEGIN", false);
BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
@Override
public void run() {
long time1 = System.currentTimeMillis();
try {
treeViewer.getTree().setRedraw(false);
treeViewer.expandAll();
} finally {
treeViewer.getTree().setRedraw(true);
long time2 = System.currentTimeMillis();
long delay = time2 - time1;
AvroSchemaLogger.logMsg(context + " END : " + delay + " ms", false);
}
}
});
}
示例4: run
import org.eclipse.swt.custom.BusyIndicator; //导入方法依赖的package包/类
public static void run(final TreeViewer treeViewer, final Runnable runnable, final String context) {
AvroSchemaLogger.logMsg(context + " BEGIN", false);
BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
@Override
public void run() {
long time1 = System.currentTimeMillis();
try {
treeViewer.getTree().setRedraw(false);
runnable.run();
} finally {
treeViewer.getTree().setRedraw(true);
long time2 = System.currentTimeMillis();
long delay = time2 - time1;
AvroSchemaLogger.logMsg(context + " END : " + delay + " ms", false);
}
}
});
}
示例5: updateProjectSelector
import org.eclipse.swt.custom.BusyIndicator; //导入方法依赖的package包/类
private void updateProjectSelector() {
final Credential credential = accountSelector.getSelectedCredential();
if (credential == null) {
projectSelector.setProjects(new ArrayList<GcpProject>());
return;
}
BusyIndicator.showWhile(projectSelector.getDisplay(), new Runnable() {
@Override
public void run() {
try {
List<GcpProject> gcpProjects = projectRepository.getProjects(credential);
projectSelector.setProjects(gcpProjects);
} catch (ProjectRepositoryException e) {
logger.log(Level.WARNING,
"Could not retrieve GCP project information from server.", e); //$NON-NLS-1$
}
}
});
}
示例6: getTreeConflict
import org.eclipse.swt.custom.BusyIndicator; //导入方法依赖的package包/类
private SVNTreeConflict getTreeConflict(final IResource resource) {
BusyIndicator.showWhile(Display.getDefault(), new Runnable() {
public void run() {
ISVNClientAdapter client = null;
try {
client = SVNWorkspaceRoot.getSVNResourceFor(resource).getRepository().getSVNClient();
ISVNStatus[] statuses = client.getStatus(resource.getLocation().toFile(), true, true, true);
for (int i = 0; i < statuses.length; i++) {
if (statuses[i].hasTreeConflict()) {
treeConflict = new SVNTreeConflict(statuses[i]);
break;
}
}
} catch (Exception e) {
SVNUIPlugin.log(IStatus.ERROR, e.getMessage(), e);
}
finally {
SVNWorkspaceRoot.getSVNResourceFor(resource).getRepository().returnSVNClient(client);
}
}
});
return treeConflict;
}
示例7: openLinkUnderMouseCursor
import org.eclipse.swt.custom.BusyIndicator; //导入方法依赖的package包/类
/**
* Handles the user clicking (or typing control-enter on) an existing link
* in the editor.
*/
private void openLinkUnderMouseCursor() {
log.debug("opening link under mouse cursor"); //$NON-NLS-1$
BusyIndicator.showWhile(getDisplay(), new Runnable() {
@Override
public void run() {
// More immediate feedback.
hideToolTip();
final Object linkObject = evaluate("return editor.getLinkUnderMouseCursor() || '';"); //$NON-NLS-1$
if ((linkObject instanceof String) && linkObject.toString().length() > 0) {
openLink((String) linkObject);
}
}
});
}
示例8: okPressed
import org.eclipse.swt.custom.BusyIndicator; //导入方法依赖的package包/类
@Override
protected void okPressed() {
net.tourbook.ui.UI.disableAllControls(_inputContainer);
BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
@Override
public void run() {
try {
doPrint();
} catch (final Exception e) {
e.printStackTrace();
displayErrorMessage(e);
}
}
});
super.okPressed();
}
示例9: checkStateChanged
import org.eclipse.swt.custom.BusyIndicator; //导入方法依赖的package包/类
public void checkStateChanged(final CheckStateChangedEvent event)
{
BusyIndicator.showWhile(fTreeViewer.getControl().getDisplay(), new Runnable() {
public void run()
{
if(event.getCheckable().equals(fTreeViewer))
treeItemChecked(event.getElement(), event.getChecked());
else
listItemChecked(event.getElement(), event.getChecked(), true);
notifyCheckStateChangeListeners(event);
}
}
);
}
示例10: create
import org.eclipse.swt.custom.BusyIndicator; //导入方法依赖的package包/类
@Override
public void create() {
BusyIndicator.showWhile(null, new Runnable() {
@Override
public void run() {
access$superCreate();
fViewer.setCheckedElements(
getInitialElementSelections().toArray());
fViewer.expandToLevel(2);
if (fExisting != null) {
for (Iterator iter= fExisting.iterator(); iter.hasNext();) {
fViewer.reveal(iter.next());
}
}
updateOKStatus();
}
});
}
示例11: getSelectedTours
import org.eclipse.swt.custom.BusyIndicator; //导入方法依赖的package包/类
@Override
public ArrayList<TourData> getSelectedTours() {
// get selected tour id's
final Set<Long> tourIds = getSelectedTourIDs();
/*
* show busyindicator when multiple tours needs to be retrieved from the database
*/
final ArrayList<TourData> selectedTourData = new ArrayList<TourData>();
if (tourIds.size() > 1) {
BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
@Override
public void run() {
getSelectedTourData(selectedTourData, tourIds);
}
});
} else {
getSelectedTourData(selectedTourData, tourIds);
}
return selectedTourData;
}
示例12: configureWorkspaceSettings
import org.eclipse.swt.custom.BusyIndicator; //导入方法依赖的package包/类
private void configureWorkspaceSettings() {
String preferenceNodeId = this.getPreferenceNodeId();
IPreferencePage preferencePage = newPreferencePage();
final IPreferenceNode preferenceNode = new PreferenceNode(preferenceNodeId, preferencePage);
PreferenceManager manager = new PreferenceManager();
manager.addToRoot(preferenceNode);
final PreferenceDialog dialog = new PreferenceDialog(this.getControl().getShell(), manager);
BusyIndicator.showWhile(this.getControl().getDisplay(), new Runnable() {
@Override
public void run() {
dialog.create();
dialog.setMessage(preferenceNode.getLabelText());
dialog.open();
}
});
}
示例13: performFinish
import org.eclipse.swt.custom.BusyIndicator; //导入方法依赖的package包/类
@Override
public boolean performFinish() {
projectsInstalled = true;
final ExampleDescriptor[] selectedExamples = page.getSelectedExamples();
BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
@Override
public void run() {
try {
// Install and check that at least one project was imported.
ExamplesInstaller installer = new ExamplesInstaller(selectedExamples);
projectsInstalled = !installer.installExamples().isEmpty();
} catch (ExampleInstallationException eie) {
projectsInstalled = false;
EasyProducerDialog.showErrorDialog(eie.getMessage());
}
}
});
return projectsInstalled;
}
示例14: validator
import org.eclipse.swt.custom.BusyIndicator; //导入方法依赖的package包/类
/**
* 访问api以验证 Key是否可用。 ;
*/
private void validator() {
final String googleKey = googleKeyText.getText();
BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {
public void run() {
// TODO Auto-generated method stub
if (googleKey != null && !googleKey.trim().equals("")) {
GoogleAPI.setHttpReferrer("http://www.heartsome.net");
GoogleAPI.setKey(googleKey);
try {
String result = Translate.DEFAULT.execute("test", GoogleTransUtils.processLanguage("en-US"),
GoogleTransUtils.processLanguage("zh-CN"));
if (result.equals("测试")) {
state = true;
}
} catch (GoogleAPIException e) {
state = false;
}
} else {
state = false;
}
}
});
}
示例15: valueChanged
import org.eclipse.swt.custom.BusyIndicator; //导入方法依赖的package包/类
private void valueChanged(final boolean on, boolean store) {
setChecked(on);
BusyIndicator.showWhile(fOutlineViewer.getControl().getDisplay(), new Runnable() {
public void run() {
if (on) {
fOutlineViewer.setComparator(fComparator);
fDropSupport.setFeedbackEnabled(false);
} else {
fOutlineViewer.setComparator(fSourcePositonComparator);
fDropSupport.setFeedbackEnabled(true);
}
}
});
if (store)
JavaPlugin.getDefault().getPreferenceStore().setValue("LexicalSortingAction.isChecked", on); //$NON-NLS-1$
}