當前位置: 首頁>>代碼示例>>Java>>正文


Java IResourceChangeEvent.PRE_CLOSE屬性代碼示例

本文整理匯總了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);
					}
				}
			}
		});
	}
}
 
開發者ID:dstl,項目名稱:Open_Source_ECOA_Toolset_AS5,代碼行數:18,代碼來源:TypesEditor.java

示例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);
					}
				}
			}
		});
	}
}
 
開發者ID:dstl,項目名稱:Open_Source_ECOA_Toolset_AS5,代碼行數:16,代碼來源:IntLogicalSysEditor.java

示例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);
					}
				}
			}
		});
	}
}
 
開發者ID:bsteker,項目名稱:bdf2,代碼行數:19,代碼來源:PropEditor.java

示例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);
					// }
				}
			}
		});
	}
}
 
開發者ID:Itema-as,項目名稱:dawn-marketplace-server,代碼行數:19,代碼來源:SolutionEditor.java

示例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);
   	}
   }
}
 
開發者ID:gemxd,項目名稱:gemfirexd-oss,代碼行數:17,代碼來源:DerbyServerUtils.java

示例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);
					}
				}
			}
		});
	}
}
 
開發者ID:wendehals,項目名稱:arduino_sct_tools,代碼行數:26,代碼來源:SGenMultiPageEditor.java

示例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));
	}
}
 
開發者ID:SAP,項目名稱:hybris-commerce-eclipse-plugin,代碼行數:25,代碼來源:PlatformHolder.java

示例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);
					}
				}
			}
		});
	}
}
 
開發者ID:SAP,項目名稱:hybris-commerce-eclipse-plugin,代碼行數:19,代碼來源:ImpexPageEditor.java

示例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);
					}
				}
			}
		});
	}
}
 
開發者ID:ncleclipse,項目名稱:ncl30-eclipse,代碼行數:22,代碼來源:NCLMultiPageEditor.java

示例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();
	}
}
 
開發者ID:Yakindu,項目名稱:statecharts,代碼行數:17,代碼來源:SCTHotModelReplacementManager.java

示例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);
					}
				}
			}            
		});
	}
}
 
開發者ID:germanattanasio,項目名稱:traceability-assistant-eclipse-plugins,代碼行數:20,代碼來源:DXMIEditor.java

示例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);
				}
			}
		}            
	});
}
 
開發者ID:insweat,項目名稱:hssd,代碼行數:25,代碼來源:MultiPageEditorWithTextPage.java

示例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);
					}
				}
			}
		});
	}
}
 
開發者ID:mondo-project,項目名稱:mondo-integration,代碼行數:19,代碼來源:HawkMultiPageEditor.java

示例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);
          }
        }
      }
    });
  }
}
 
開發者ID:logicalhacking,項目名稱:SecureBPMN,代碼行數:19,代碼來源:ActivitiMultiPageEditor.java


注:本文中的org.eclipse.core.resources.IResourceChangeEvent.PRE_CLOSE屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。