当前位置: 首页>>代码示例>>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;未经允许,请勿转载。