本文整理汇总了Java中org.eclipse.ui.actions.BuildAction类的典型用法代码示例。如果您正苦于以下问题:Java BuildAction类的具体用法?Java BuildAction怎么用?Java BuildAction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BuildAction类属于org.eclipse.ui.actions包,在下文中一共展示了BuildAction类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: BuildActionGroup
import org.eclipse.ui.actions.BuildAction; //导入依赖的package包/类
private BuildActionGroup(IWorkbenchSite site, ISelectionProvider specialSelectionProvider, RefreshAction refreshAction) {
fSelectionProvider= specialSelectionProvider != null ? specialSelectionProvider : site.getSelectionProvider();
fBuildAction= new BuildAction(new ShellProviderAdapter(site.getShell()), IncrementalProjectBuilder.INCREMENTAL_BUILD);
fBuildAction.setText(ActionMessages.BuildAction_label);
fBuildAction.setActionDefinitionId(IWorkbenchCommandConstants.PROJECT_BUILD_PROJECT);
fRefreshAction= refreshAction;
fRefreshAction.setActionDefinitionId(IWorkbenchCommandConstants.FILE_REFRESH);
if (specialSelectionProvider != null) {
fRefreshAction.setSpecialSelectionProvider(specialSelectionProvider);
}
fSelectionProvider.addSelectionChangedListener(fBuildAction);
fSelectionProvider.addSelectionChangedListener(fRefreshAction);
}
示例2: startBuildJob
import org.eclipse.ui.actions.BuildAction; //导入依赖的package包/类
private static void startBuildJob(IProject proj) {
BuildAction build = new BuildAction(
PlatformUI.getWorkbench().getActiveWorkbenchWindow(),
IncrementalProjectBuilder.FULL_BUILD);
build.selectionChanged(new StructuredSelection(proj));
build.runInBackground(null);
}
示例3: saveEditors
import org.eclipse.ui.actions.BuildAction; //导入依赖的package包/类
/**
* Causes all editors to save any modified resources in the provided collection
* of projects depending on the user's preference.
* @param projects The projects in which to save editors, or <code>null</code>
* to save editors in all projects.
*/
public static void saveEditors(Indexable<IProject> projects) {
if (!BuildAction.isSaveAllSet()) {
return;
}
IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
for (int i = 0; i < windows.length; i++) {
IWorkbenchPage[] pages = windows[i].getPages();
for (int j = 0; j < pages.length; j++) {
IWorkbenchPage page = pages[j];
if (projects == null) {
page.saveAllEditors(false);
} else {
IEditorPart[] editors = page.getDirtyEditors();
for (int k = 0; k < editors.length; k++) {
IEditorPart editor = editors[k];
IFile inputFile = ResourceUtil.getFile(editor.getEditorInput());
if (inputFile != null) {
if (projects.contains(inputFile.getProject())) {
page.saveEditor(editor, false);
}
}
}
}
}
}
}
示例4: BuildOperationsActionGroup
import org.eclipse.ui.actions.BuildAction; //导入依赖的package包/类
public BuildOperationsActionGroup(IViewPart viewPart) {
super(viewPart);
buildAction = new BuildAction(() -> viewPart.getSite().getShell(),
IncrementalProjectBuilder.INCREMENTAL_BUILD);
buildAction.setActionDefinitionId(IWorkbenchCommandConstants.PROJECT_BUILD_PROJECT);
}