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


Java IResourceChangeEvent.getType方法代碼示例

本文整理匯總了Java中org.eclipse.core.resources.IResourceChangeEvent.getType方法的典型用法代碼示例。如果您正苦於以下問題:Java IResourceChangeEvent.getType方法的具體用法?Java IResourceChangeEvent.getType怎麽用?Java IResourceChangeEvent.getType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.core.resources.IResourceChangeEvent的用法示例。


在下文中一共展示了IResourceChangeEvent.getType方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: resourceChanged

import org.eclipse.core.resources.IResourceChangeEvent; //導入方法依賴的package包/類
/**
 * 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,代碼行數:19,代碼來源:TypesEditor.java

示例2: resourceChanged

import org.eclipse.core.resources.IResourceChangeEvent; //導入方法依賴的package包/類
@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,代碼行數:17,代碼來源:IntLogicalSysEditor.java

示例3: resourceChanged

import org.eclipse.core.resources.IResourceChangeEvent; //導入方法依賴的package包/類
@Override
public void resourceChanged(IResourceChangeEvent event)
{
	if( event.getType() == IResourceChangeEvent.PRE_BUILD )
	{
		IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
		if( fTouchWorkspace )
		{
			IProject[] projects = root.getProjects();
			for( int i = 0; i < projects.length; i++ )
			{
				touchProject(projects[i]);
			}
		}
		else
		{
			Iterator<String> iter = fProjectNames.iterator();
			while( iter.hasNext() )
			{
				touchProject(root.getProject(iter.next()));
			}
		}
		fTouchWorkspace = false;
		fProjectNames.clear();
	}
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:27,代碼來源:JPFPluginRebuilder.java

示例4: resourceChanged

import org.eclipse.core.resources.IResourceChangeEvent; //導入方法依賴的package包/類
/**
 * 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,代碼行數:20,代碼來源:PropEditor.java

示例5: resourceChanged

import org.eclipse.core.resources.IResourceChangeEvent; //導入方法依賴的package包/類
/**
 * 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,代碼行數:20,代碼來源:SolutionEditor.java

示例6: resourceChanged

import org.eclipse.core.resources.IResourceChangeEvent; //導入方法依賴的package包/類
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,代碼行數:18,代碼來源:DerbyServerUtils.java

示例7: resourceChanged

import org.eclipse.core.resources.IResourceChangeEvent; //導入方法依賴的package包/類
/**
 * @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,代碼行數:27,代碼來源:SGenMultiPageEditor.java

示例8: workspaceChanged

import org.eclipse.core.resources.IResourceChangeEvent; //導入方法依賴的package包/類
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,代碼行數:26,代碼來源:PlatformHolder.java

示例9: resourceChanged

import org.eclipse.core.resources.IResourceChangeEvent; //導入方法依賴的package包/類
/**
 * 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,代碼行數:20,代碼來源:ImpexPageEditor.java

示例10: resourceChanged

import org.eclipse.core.resources.IResourceChangeEvent; //導入方法依賴的package包/類
/**
 * 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,代碼行數:23,代碼來源:NCLMultiPageEditor.java

示例11: resourceChanged

import org.eclipse.core.resources.IResourceChangeEvent; //導入方法依賴的package包/類
@Override
public void resourceChanged(IResourceChangeEvent event) {
	if (event.getSource() instanceof IWorkspace) {
		switch (event.getType()) {
			case IResourceChangeEvent.POST_CHANGE:
				try {
					if (event.getDelta() != null && editor.isActiveOn(event.getResource())) {
						editor.getPageModel();
					}
				} catch (Exception e) {
					Log.error("Failed handing post_change of resource", e);
				}
				break;
		}
	}
}
 
開發者ID:grosenberg,項目名稱:fluentmark,代碼行數:17,代碼來源:PageRoot.java

示例12: resourceChanged

import org.eclipse.core.resources.IResourceChangeEvent; //導入方法依賴的package包/類
@Override
public void resourceChanged(IResourceChangeEvent event) {
	if ((IResourceChangeEvent.POST_CHANGE != event.getType())) {
		return;
	}

	ResourceDeltaToIssueResult markerChangeResult = null;
	synchronized (visibleIssues) {
		markerChangeResult = resourceChangeToIssues.process(event, connectedResource, visibleIssues);
		if (markerChangeResult != null)
			visibleIssues = markerChangeResult.getIssues();
	}

	if (markerChangeResult != null)
		for (String elementID : markerChangeResult.getChangedElementIDs()) {
			notifyListeners(elementID);
		}

}
 
開發者ID:Yakindu,項目名稱:statecharts,代碼行數:20,代碼來源:DefaultValidationIssueStore.java

示例13: resourceChanged

import org.eclipse.core.resources.IResourceChangeEvent; //導入方法依賴的package包/類
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,代碼行數:18,代碼來源:SCTHotModelReplacementManager.java

示例14: resourceChanged

import org.eclipse.core.resources.IResourceChangeEvent; //導入方法依賴的package包/類
public void resourceChanged(IResourceChangeEvent event)
{
	if (event.getType() == IResourceChangeEvent.PRE_DELETE)
	{
		handleProjectDeleteEvent((IProject) event.getResource());
	}
	else
	{
		try
		{
			event.getDelta().accept(this);
		}
		catch (CoreException e)
		{
			IdeLog.logError(ScriptingActivator.getDefault(),
					Messages.BundleMonitor_Error_Processing_Resource_Change, e);
		}
	}
}
 
開發者ID:apicloudcom,項目名稱:APICloud-Studio,代碼行數:20,代碼來源:BundleMonitor.java

示例15: resourceChanged

import org.eclipse.core.resources.IResourceChangeEvent; //導入方法依賴的package包/類
/**
 * 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,代碼行數:25,代碼來源:TraceabilityEditor.java


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