本文整理汇总了Java中org.eclipse.core.resources.IResourceChangeEvent.PRE_CLOSE属性的典型用法代码示例。如果您正苦于以下问题:Java IResourceChangeEvent.PRE_CLOSE属性的具体用法?Java IResourceChangeEvent.PRE_CLOSE怎么用?Java IResourceChangeEvent.PRE_CLOSE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.core.resources.IResourceChangeEvent
的用法示例。
在下文中一共展示了IResourceChangeEvent.PRE_CLOSE属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: resourceChanged
/**
* Closes all project files on project close.
*/
public void resourceChanged(final IResourceChangeEvent event) {
if (event.getType() == IResourceChangeEvent.PRE_CLOSE) {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
IWorkbenchPage[] pages = getSite().getWorkbenchWindow().getPages();
for (int i = 0; i < pages.length; i++) {
if (((FileEditorInput) editor.getEditorInput()).getFile().getProject().equals(event.getResource())) {
IEditorPart editorPart = pages[i].findEditor(editor.getEditorInput());
pages[i].closeEditor(editorPart, true);
}
}
}
});
}
}
示例2: resourceChanged
@Override
public void resourceChanged(IResourceChangeEvent event) {
if (event.getType() == IResourceChangeEvent.PRE_CLOSE) {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
IWorkbenchPage[] pages = getSite().getWorkbenchWindow().getPages();
for (int i = 0; i < pages.length; i++) {
if (((FileEditorInput) getEditorInput()).getFile().getProject().equals(event.getResource())) {
IEditorPart editorPart = pages[i].findEditor(getEditorInput());
pages[i].closeEditor(editorPart, true);
}
}
}
});
}
}
示例3: resourceChanged
/**
* Closes all project files on project close.
*/
public void resourceChanged(final IResourceChangeEvent event) {
if (event.getType() == IResourceChangeEvent.PRE_CLOSE) {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
IWorkbenchPage[] pages = getSite().getWorkbenchWindow().getPages();
for (int i = 0; i < pages.length; i++) {
if (((FileEditorInput) editor.getEditorInput()).getFile().getProject()
.equals(event.getResource())) {
IEditorPart editorPart = pages[i].findEditor(editor.getEditorInput());
pages[i].closeEditor(editorPart, true);
}
}
}
});
}
}
示例4: resourceChanged
/**
* Closes all project files on project close.
*/
public void resourceChanged(final IResourceChangeEvent event) {
if (event.getType() == IResourceChangeEvent.PRE_CLOSE) {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
IWorkbenchPage[] pages = getSite().getWorkbenchWindow().getPages();
for (int i = 0; i < pages.length; i++) {
// if(((FileEditorInput)editor.getEditorInput()).getFile().getProject().equals(event.getResource())){
// IEditorPart editorPart =
// pages[i].findEditor(editor.getEditorInput());
// pages[i].closeEditor(editorPart,true);
// }
}
}
});
}
}
示例5: resourceChanged
public void resourceChanged(IResourceChangeEvent event){
if(event.getType()==IResourceChangeEvent.PRE_CLOSE){
try{
if(event.getResource().getProject().isNatureEnabled(CommonNames.DERBY_NATURE)){
if(getRunning(event.getResource().getProject())){
stopDerbyServer(event.getResource().getProject());
}
}
}catch(SWTException swe){
//The SWTException is thrown during the Shell creation
//Logger.log("Exception shutting down "+swe,IStatus.ERROR);
//e.printStackTrace();
}catch(Exception e){
Logger.log("Exception shutting down "+e,IStatus.ERROR);
}
}
}
示例6: resourceChanged
/**
* @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent)
*/
@Override
public void resourceChanged(final IResourceChangeEvent event) {
if (event.getType() == IResourceChangeEvent.PRE_CLOSE) {
Display.getDefault().asyncExec(new Runnable() {
/**
* @see java.lang.Runnable#run()
*/
@Override
public void run() {
final IWorkbenchPage[] pages = getSite().getWorkbenchWindow().getPages();
for (final IWorkbenchPage page : pages) {
if (((FileEditorInput) SGenMultiPageEditor.this.xtextEditor.getEditorInput()).getFile()
.getProject().equals(event.getResource())) {
final IEditorPart editorPart = page
.findEditor(SGenMultiPageEditor.this.xtextEditor.getEditorInput());
page.closeEditor(editorPart, true);
}
}
}
});
}
}
示例7: workspaceChanged
void workspaceChanged(IResourceChangeEvent event) {
try {
if (event.getType() == IResourceChangeEvent.PRE_DELETE || event.getType() == IResourceChangeEvent.PRE_CLOSE) {
if (Platform.isPlatformProject((IProject)event.getResource())) {
clear();
}
}
else if (event.getType() == IResourceChangeEvent.POST_CHANGE) {
event.getDelta().accept(new IResourceDeltaVisitor() {
@Override
public boolean visit(IResourceDelta delta) throws CoreException {
if (delta.getKind() == IResourceDelta.ADDED
&& delta.getResource().getType() == IResource.PROJECT) {
projectAdded((IProject) delta.getResource());
}
return delta.getResource().getType() == IResource.ROOT;
}
});
}
} catch (CoreException e) {
log.log(new Status(Status.ERROR, log.getBundle().getSymbolicName(), "Error when handling IResourceChangedEvent", e));
}
}
示例8: resourceChanged
/**
* Closes all project files on project close.
*/
public void resourceChanged(final IResourceChangeEvent event) {
if (event.getType() == IResourceChangeEvent.PRE_CLOSE) {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
IWorkbenchPage[] pages = getSite().getWorkbenchWindow().getPages();
for (int i = 0; i < pages.length; i++) {
if (((FileEditorInput) editor.getEditorInput()).getFile().getProject()
.equals(event.getResource())) {
IEditorPart editorPart = pages[i].findEditor(editor.getEditorInput());
pages[i].closeEditor(editorPart, true);
}
}
}
});
}
}
示例9: resourceChanged
/**
* Closes all project files on project close.
*/
public void resourceChanged(final IResourceChangeEvent event) {
if (event.getType() == IResourceChangeEvent.PRE_CLOSE) {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
IWorkbenchPage[] pages = getSite().getWorkbenchWindow()
.getPages();
for (int i = 0; i < pages.length; i++) {
if (((FileEditorInput) editor.getEditorInput())
.getFile().getProject().equals(
event.getResource())) {
IEditorPart editorPart = pages[i].findEditor(editor
.getEditorInput());
pages[i].closeEditor(editorPart, true);
}
}
}
});
}
}
示例10: resourceChanged
public synchronized void resourceChanged(IResourceChangeEvent event) {
if (event.getType() == IResourceChangeEvent.PRE_CLOSE)
handleCloseEvent(event);
IResourceDelta delta = event.getDelta();
try {
changedFiles.clear();
if (delta != null)
delta.accept(this);
if (changedFiles.size() > 0) {
handleHotModelReplacement();
}
} catch (CoreException e) {
e.printStackTrace();
}
}
示例11: resourceChanged
/**
* Closes all project files on project close.
*
* @param event the event
*/
public void resourceChanged(final IResourceChangeEvent event){
if(event.getType() == IResourceChangeEvent.PRE_CLOSE){
Display.getDefault().asyncExec(new Runnable(){
public void run(){
IWorkbenchPage[] pages = getSite().getWorkbenchWindow().getPages();
for (int i = 0; i<pages.length; i++){
if(((FileEditorInput)editor.getEditorInput()).getFile().getProject().equals(event.getResource())){
IEditorPart editorPart = pages[i].findEditor(editor.getEditorInput());
pages[i].closeEditor(editorPart,true);
}
}
}
});
}
}
示例12: resourceChanged
/**
* Closes all project files on project close.
*
* @param event the event
*/
public void resourceChanged(final IResourceChangeEvent event) {
if (event.getType() == IResourceChangeEvent.PRE_CLOSE) {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
IWorkbenchPage[] pages = getSite().getWorkbenchWindow()
.getPages();
for (int i = 0; i < pages.length; i++) {
if (((FileEditorInput) editor.getEditorInput())
.getFile().getProject()
.equals(event.getResource())) {
IEditorPart editorPart = pages[i].findEditor(editor
.getEditorInput());
pages[i].closeEditor(editorPart, true);
}
}
}
});
}
}
开发者ID:germanattanasio,项目名称:traceability-assistant-eclipse-plugins,代码行数:24,代码来源:TraceabilityEditor.java
示例13: resourceChanged
@Override
public void resourceChanged(final IResourceChangeEvent event) {
/**
* Closes all project files on project close.
*/
if(event.getType() != IResourceChangeEvent.PRE_CLOSE){
return;
}
Display.getDefault().asyncExec(new Runnable(){
public void run(){
final IWorkbenchPage[] pages =
getSite().getWorkbenchWindow().getPages();
final FileEditorInput input =
(FileEditorInput)editor.getEditorInput();
final IProject proj = input.getFile().getProject();
for (int i = 0; i<pages.length; i++){
if(proj.equals(event.getResource())){
final IEditorPart editorPart =
pages[i].findEditor(editor.getEditorInput());
pages[i].closeEditor(editorPart, true);
}
}
}
});
}
示例14: resourceChanged
/**
* Closes all project files on project close.
*/
@Override
public void resourceChanged(final IResourceChangeEvent event) {
if (event.getType() == IResourceChangeEvent.PRE_CLOSE) {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
IWorkbenchPage[] pages = getSite().getWorkbenchWindow().getPages();
for (int i = 0; i < pages.length; i++) {
if (((FileEditorInput) textEditor.getEditorInput()).getFile().getProject().equals(event.getResource())) {
IEditorPart editorPart = pages[i].findEditor(textEditor.getEditorInput());
pages[i].closeEditor(editorPart, true);
}
}
}
});
}
}
示例15: resourceChanged
/**
* Closes all project files on project close.
*/
public void resourceChanged(final IResourceChangeEvent event) {
if (event.getType() == IResourceChangeEvent.PRE_CLOSE) {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
IWorkbenchPage[] pages = getSite().getWorkbenchWindow().getPages();
for (int i = 0; i < pages.length; i++) {
if (((FileEditorInput) bpmnEditor.getEditorInput()).getFile().getProject().equals(event.getResource())) {
IEditorPart editorPart = pages[i].findEditor(bpmnEditor.getEditorInput());
pages[i].closeEditor(editorPart, true);
}
}
}
});
}
}