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


Java IResourceChangeEvent類代碼示例

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


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

示例1: initializeCache

import org.eclipse.core.resources.IResourceChangeEvent; //導入依賴的package包/類
@Override
public void initializeCache() {
	Optional<? extends IN4JSEclipseProject> projectOpt = null;
	IN4JSEclipseProject n4jsProject = null;
	for (IProject project : workspace.getRoot().getProjects()) {
		projectOpt = eclipseCore.create(project);
		if (projectOpt.isPresent()) {
			n4jsProject = projectOpt.get();
			if (n4jsProject.exists()) {
				updateCache(n4jsProject);
			}
		}
	}
	Listener listener = new Listener();
	workspace.addResourceChangeListener(listener, IResourceChangeEvent.POST_CHANGE);
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:17,代碼來源:NfarStorageMapper.java

示例2: isMarkerChangeForThisEditor

import org.eclipse.core.resources.IResourceChangeEvent; //導入依賴的package包/類
private boolean isMarkerChangeForThisEditor(IResourceChangeEvent event) {
	IResource resource = ResourceUtil.getResource(getEditorInput());
	if (resource == null) {
		return false;
	}
	IPath path = resource.getFullPath();
	if (path == null) {
		return false;
	}
	IResourceDelta eventDelta = event.getDelta();
	if (eventDelta == null) {
		return false;
	}
	IResourceDelta delta = eventDelta.findMember(path);
	if (delta == null) {
		return false;
	}
	boolean isMarkerChangeForThisResource = (delta.getFlags() & IResourceDelta.MARKERS) != 0;
	return isMarkerChangeForThisResource;
}
 
開發者ID:de-jcup,項目名稱:eclipse-batch-editor,代碼行數:21,代碼來源:BatchEditor.java

示例3: PreviewEditorImpl

import org.eclipse.core.resources.IResourceChangeEvent; //導入依賴的package包/類
public PreviewEditorImpl ()
{
    this.adapterFactory = new ComposedAdapterFactory ( ComposedAdapterFactory.Descriptor.Registry.INSTANCE );
    this.adapterFactory.addAdapterFactory ( new ResourceItemProviderAdapterFactory () );
    this.adapterFactory.addAdapterFactory ( new ReflectiveItemProviderAdapterFactory () );

    final BasicCommandStack commandStack = new BasicCommandStack ();

    this.editingDomain = new AdapterFactoryEditingDomain ( this.adapterFactory, commandStack, new HashMap<Resource, Boolean> () );

    this.factoryContext = new FactoryContext () {

        @Override
        public void loadedResource ( final URI uri )
        {
            handleLoadedResource ( uri );
        }
    };

    ResourcesPlugin.getWorkspace ().addResourceChangeListener ( this.resourceChangeListener, IResourceChangeEvent.POST_CHANGE );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:22,代碼來源:PreviewEditorImpl.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:dstl,項目名稱:Open_Source_ECOA_Toolset_AS5,代碼行數:19,代碼來源:TypesEditor.java

示例5: 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

示例6: 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

示例7: getParserForBuilder

import org.eclipse.core.resources.IResourceChangeEvent; //導入依賴的package包/類
/**
 * @param buildType single element array; element may be altered to indicate
 *                  actual required build type
 */
public static PgDbParser getParserForBuilder(IProject proj, int[] buildType) {
    PgDbParser pnew = new PgDbParser();
    PgDbParser p = PROJ_PARSERS.putIfAbsent(proj, pnew);
    if (p == null) {
        p = pnew;
        // prepare newly created parser
        ResourcesPlugin.getWorkspace().addResourceChangeListener(p,
                IResourceChangeEvent.PRE_CLOSE | IResourceChangeEvent.PRE_DELETE);

        if (buildType == null) {
            // not a builder call, start builder
            startBuildJob(proj);
        } else {
            // builder call, change build type to FULL for new parsers
            buildType[0] = IncrementalProjectBuilder.FULL_BUILD;
        }
    }
    return p;
}
 
開發者ID:pgcodekeeper,項目名稱:pgcodekeeper,代碼行數:24,代碼來源:PgDbParser.java

示例8: resourceChanged

import org.eclipse.core.resources.IResourceChangeEvent; //導入依賴的package包/類
@Override
public void resourceChanged(IResourceChangeEvent event) {
	if ((event.getDelta().getFlags() ^ IResourceDelta.MARKERS) != 0) {
		try {
			event.getDelta().accept(delta -> {
				if (delta.getResource().equals(this.resource)) {
					viewer.getControl().getDisplay().asyncExec(() -> {
						if (viewer instanceof StructuredViewer) {
							viewer.refresh(true);
						}
					});
				}
				return delta.getResource().getFullPath().isPrefixOf(this.resource.getFullPath());
			});
		} catch (CoreException e) {
			// LanguageServerPlugin.logError(e);
		}
	}
}
 
開發者ID:angelozerr,項目名稱:ec4e,代碼行數:20,代碼來源:EditorConfigContentProvider.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:bsteker,項目名稱:bdf2,代碼行數:20,代碼來源:PropEditor.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:Itema-as,項目名稱:dawn-marketplace-server,代碼行數:20,代碼來源:SolutionEditor.java

示例11: resourceChanged

import org.eclipse.core.resources.IResourceChangeEvent; //導入依賴的package包/類
@Override
public void resourceChanged(IResourceChangeEvent event) {
	
	
	/*
       IResource res = event.getResource();
       
       switch (event.getType()) {
       	case IResourceChangeEvent.POST_CHANGE:
			try {
				event.getDelta().accept(this);
			} catch (CoreException e) {
				e.printStackTrace();
			}
       		if (event.getDelta().getKind() == IResourceDelta.CHANGED && event.getDelta().getFlags() == (IResourceDelta.ADDED | IResourceDelta.REMOVED)) {
       			System.out.println("Resources have RENAMED.");
       		} else {
       			System.out.println("Resources have RENAMED." + event.getDelta().getKind() + " = " + event.getDelta().getFlags());
       		}
       	default:
       }*/
}
 
開發者ID:jason-lang,項目名稱:jason-eclipse-plugin,代碼行數:23,代碼來源:NavigatorContentProvider.java

示例12: start

import org.eclipse.core.resources.IResourceChangeEvent; //導入依賴的package包/類
@Override
public void start(BundleContext context) throws Exception {
	super.start(context);
	plugin = this;
	IResourceChangeListener resourceChangeListener = new IResourceChangeListener() {
		
		@Override
		public void resourceChanged(IResourceChangeEvent event) {
			IResource resource = event.getResource();
			if (resource.getFileExtension().equals("e")) {
				//TODO:
				//Run compiler
			}
		}
	};
	ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener);
}
 
開發者ID:Imhotup,項目名稱:LibertyEiffel-Eclipse-Plugin,代碼行數:18,代碼來源:Activator.java

示例13: 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

示例14: start

import org.eclipse.core.resources.IResourceChangeEvent; //導入依賴的package包/類
@Override
public void start(final BundleContext context) throws Exception {
    super.start(context);

    ResourcesPlugin.getWorkspace().addResourceChangeListener(
        ignoreFileResourceChangeListener,
        IResourceChangeEvent.POST_CHANGE);

    ResourcesPlugin.getWorkspace().addResourceChangeListener(
        projectCreationListener,
        IResourceChangeEvent.POST_CHANGE);

    getRepositoryManager().addListener(repositoryListener);

    registerProtocolHandler();
}
 
開發者ID:Microsoft,項目名稱:team-explorer-everywhere,代碼行數:17,代碼來源:TFSEclipseClientUIPlugin.java

示例15: resourceChanged

import org.eclipse.core.resources.IResourceChangeEvent; //導入依賴的package包/類
@Override
public void resourceChanged(final IResourceChangeEvent event) {
    try {
        event.getDelta().accept(new IResourceDeltaVisitor() {
            @Override
            public boolean visit(final IResourceDelta delta) throws CoreException {
                if (delta.getKind() == IResourceDelta.ADDED) {
                    final IResource resource = delta.getResource();
                    if (resource.getType() == IResource.PROJECT) {
                        newProject = (IProject) resource;
                    } else if (resource.getType() == IResource.FILE
                        && PluginResourceFilters.STANDARD_FILTER.filter(
                            resource) == ResourceFilterResult.ACCEPT) {
                        filepaths.add(resource.getLocation().toOSString());
                    }
                }
                return true;
            }
        });
    } catch (final CoreException e) {
        throw new RuntimeException(e);
    }
}
 
開發者ID:Microsoft,項目名稱:team-explorer-everywhere,代碼行數:24,代碼來源:ImportLocalPathStrategy.java


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