本文整理汇总了Java中org.eclipse.core.runtime.Status.OK_STATUS属性的典型用法代码示例。如果您正苦于以下问题:Java Status.OK_STATUS属性的具体用法?Java Status.OK_STATUS怎么用?Java Status.OK_STATUS使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.core.runtime.Status
的用法示例。
在下文中一共展示了Status.OK_STATUS属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: resfreshFileInContainer
/**
* @param folder
* @param filetorefresh
* @return
* @throws CoreException
* @throws InterruptedException
*/
public static IResource resfreshFileInContainer(IContainer folder, String filetorefresh)
throws CoreException, InterruptedException {
final IResource buildfile = find(folder, filetorefresh);
Job job = new WorkspaceJob("Refresh folders") {
public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
if (buildfile != null && buildfile.exists()) {
try {
buildfile.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
} catch (CoreException e) {
ResourceManager.logException(e);
}
}
return Status.OK_STATUS;
}
};
job.setUser(true);
job.schedule();
return buildfile;
}
示例2: run
@Override
protected IStatus run(IProgressMonitor monitor) {
SubMonitor pm = SubMonitor.convert(
monitor, Messages.commitPartDescr_commiting, 2);
Log.log(Log.LOG_INFO, "Applying diff tree to db"); //$NON-NLS-1$
pm.newChild(1).subTask(Messages.commitPartDescr_modifying_db_model); // 1
pm.newChild(1).subTask(Messages.commitPartDescr_exporting_db_model); // 2
try {
Collection<TreeElement> checked = new TreeFlattener()
.onlySelected()
.onlyEdits(dbProject.getDbObject(), dbRemote.getDbObject())
.flatten(tree);
new ProjectUpdater(dbRemote.getDbObject(), dbProject.getDbObject(),
checked, proj).updatePartial();
monitor.done();
} catch (IOException | CoreException e) {
return new Status(Status.ERROR, PLUGIN_ID.THIS,
Messages.ProjectEditorDiffer_commit_error, e);
}
if (monitor.isCanceled()) {
return Status.CANCEL_STATUS;
}
return Status.OK_STATUS;
}
示例3: run
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
if (editor!=null) editor.setSafeEnabled(false);
scannable.setPosition(value); // Blocking call
if (editor!=null && value instanceof Number) {
editor.setSafeValue(((Number)value).doubleValue());
}
return Status.OK_STATUS;
} catch (Exception e) {
editor.setSafeText(e.getMessage());
logger.error("Cannot set position!", e);
return Status.CANCEL_STATUS;
} finally {
editor.setSafeEnabled(true);
}
}
示例4: run
@Override
protected IStatus run(IProgressMonitor monitor)
{
boolean more = false;
do
{
IModel[] changedModels = null;
synchronized( models )
{
changedModels = models.toArray(new IModel[models.size()]);
models.clear();
}
fireModelProviderEvent(new ModelProviderEvent(this, IModelProviderEvent.MODELS_CHANGED, new IModel[0],
new IModel[0], changedModels));
synchronized( models )
{
more = !models.isEmpty();
}
}
while( more );
return Status.OK_STATUS;
}
示例5: createJob
/**
* @param jobname
* @param tasks
* @return
*/
public static Job createJob(String jobname, List<UITask.Task> tasks) {
Job job = new Job(jobname) {
@Override
protected IStatus run(IProgressMonitor monitor) {
SubMonitor subMonitor = SubMonitor.convert(monitor, tasks.size());
for (UITask.Task task : tasks) {
try {
subMonitor.setTaskName(task.getSummary());
workOnTask(task, subMonitor.split(1));
} catch (Exception e) {
return Status.CANCEL_STATUS;
}
}
return Status.OK_STATUS;
}
};
job.setUser(true);
return job;
}
示例6: performFinish
public boolean performFinish() {
final Collection<ProjectDescriptor> projectDescriptors = getProjectDescriptors();
WorkspaceJob job = new WorkspaceJob("Unzipping Projects") {
@Override
public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
monitor.beginTask("Unzipping Projects", projectDescriptors.size());
//System.out.println("Unzipping projects...");
for ( ProjectDescriptor desc : projectDescriptors ) {
unzipProject(desc, monitor);
monitor.worked(1);
}
//System.out.println("Projects unzipped");
return Status.OK_STATUS;
}
};
job.setRule(ResourcesPlugin.getWorkspace().getRoot());
job.schedule();
return true;
}
示例7: run
@Override
public void run(IMarker marker) {
Job job = new WorkspaceJob("GW4E Fix Job") {
@Override
public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
fix(marker, monitor);
return Status.OK_STATUS;
}
};
job.setRule(marker.getResource().getProject());
job.setUser(true);
job.schedule();
}
示例8: validate
@Override
public IStatus validate(Object value) {
if (value instanceof String) {
String s = (String) value;
if (s.length() == 0) {
return ValidationStatus.error("列名不能为空!");
} else if (s.length() > 32) {
return ValidationStatus.error("列名长度不能超过32位!");
} else {
return Status.OK_STATUS;
}
} else {
throw new RuntimeException("not supposed!");
}
}
示例9: run
@Override
public void run(IMarker marker) {
IWorkbenchWindow ww= PlatformUI.getWorkbench().getActiveWorkbenchWindow();
Job job = new WorkspaceJob("GW4E Synchronization Job") {
@Override
public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
fix(marker,ww,monitor);
return Status.OK_STATUS;
}
};
job.setRule(marker.getResource().getProject());
job.setUser(true);
job.schedule();
}
示例10: run
@Override
protected IStatus run(IProgressMonitor monitor) {
BuildConfiguration buildConfig = CorePlugin.configurationManager()
.loadBuildConfiguration(new File(project.getRawLocationURI()));
RunConfiguration runConfiguration = CorePlugin.configurationManager().createDefaultRunConfiguration(buildConfig);
BuildLauncher launcher = CorePlugin.gradleWorkspaceManager().getGradleBuild(buildConfig)
.newBuildLauncher(runConfiguration, CharStreams.nullWriter(),
getTransientRequestAttributes(GradleConnector.newCancellationTokenSource().token(), monitor));
launcher.forTasks(":" + project.getName() + ":gfBundle").run();
return Status.OK_STATUS;
}
示例11: convertStatus
public static IStatus convertStatus ( final String pluginId, final String message, final Throwable e )
{
if ( e == null )
{
return Status.OK_STATUS;
}
if ( e instanceof CoreException )
{
return ( (CoreException)e ).getStatus ();
}
return new Status ( IStatus.ERROR, pluginId, message, e );
}
示例12: run
@Override
protected IStatus run(IProgressMonitor monitor) {
if (monitor.isCanceled()) {
return Status.CANCEL_STATUS;
}
monitor.beginTask(Messages.UsageReport_Querying_Enablement, 2);
if (monitor.isCanceled()) {
return Status.CANCEL_STATUS;
}
monitor.worked(1);
try {
lockToAskUser.lock();
if (mainPrefs.getBoolean(USAGE_REPORT_PREF.ASK_USER_USAGEREPORT_ID)) {
if (monitor.isCanceled()) {
return Status.CANCEL_STATUS;
}
askUser();
}
} finally {
lockToAskUser.unlock();
}
report();
monitor.worked(2);
monitor.done();
return Status.OK_STATUS;
}
示例13: triggerProjectRebuild
@Override
public void triggerProjectRebuild() {
WorkspaceJob build = new WorkspaceJob("rebuild") {
@Override
public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, monitor);
return Status.OK_STATUS;
}
};
build.schedule();
}
示例14: triggerBuild
public void triggerBuild(IProject project) throws CoreException {
if (isVisuflowNatureEnabled(project) && ResourcesPlugin.getWorkspace().isAutoBuilding()) {
WorkspaceJob fullBuild = new WorkspaceJob("Full build for " + project.getName()) {
@Override
public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
project.build(IncrementalProjectBuilder.FULL_BUILD, monitor);
return Status.OK_STATUS;
}
};
fullBuild.schedule();
}
}
示例15: submitRecordCountJob
public void submitRecordCountJob() {
Job job = new Job(Messages.FETCHING_TOTAL_NUMBER_OF_RECORDS) {
@Override
protected IStatus run(IProgressMonitor monitor) {
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
statusManager.getStatusLineManager().getProgressMonitor().beginTask(Messages.FETCHING_TOTAL_NUMBER_OF_RECORDS, IProgressMonitor.UNKNOWN);
}
});
final StatusMessage status = dataViewerAdapter.fetchRowCount();
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
statusManager.getStatusLineManager().getProgressMonitor().done();
statusManager.setStatus(status);
statusManager.enableJumpPagePanel(true);
actionFactory.getAction(ResetSortAction.class.getName()).setEnabled(false);
actionFactory.getAction(ClearFilterAction.class.getName()).setEnabled(false);
}
});
return Status.OK_STATUS;
}
};
job.schedule();
}