当前位置: 首页>>代码示例>>Java>>正文


Java IResourceChangeEvent.POST_CHANGE属性代码示例

本文整理汇总了Java中org.eclipse.core.resources.IResourceChangeEvent.POST_CHANGE属性的典型用法代码示例。如果您正苦于以下问题:Java IResourceChangeEvent.POST_CHANGE属性的具体用法?Java IResourceChangeEvent.POST_CHANGE怎么用?Java IResourceChangeEvent.POST_CHANGE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.eclipse.core.resources.IResourceChangeEvent的用法示例。


在下文中一共展示了IResourceChangeEvent.POST_CHANGE属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

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

示例2: resourceChanged

@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,代码行数:16,代码来源:PageRoot.java

示例3: resourceChanged

@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,代码行数:19,代码来源:DefaultValidationIssueStore.java

示例4: resourceChanged

@Override
public void resourceChanged(IResourceChangeEvent event) {
	switch (event.getType()) {
	case IResourceChangeEvent.POST_CHANGE:
		handleResourceDelta(event.getDelta());
		break;
	case IResourceChangeEvent.PRE_DELETE:
		// fall through
	case IResourceChangeEvent.PRE_CLOSE:
		IProject project = event.getResource().getProject();
		if (isInterestingProject(project)) {
			removeTemplates(project.getName());
		}
		break;
	}
}
 
开发者ID:secondfiddle,项目名称:pep-tools,代码行数:16,代码来源:WorkspaceProjectTemplateProvider.java

示例5: resourceChanged

@Override
public void resourceChanged(IResourceChangeEvent event) {
	List<IFile> resourcesDeleted = new ArrayList<IFile>();
	if (event.getType() == IResourceChangeEvent.POST_CHANGE){
		iterateResourceDelta(event.getDelta(), resourcesDeleted);
		for(IFile resource : resourcesDeleted){
			String resourceString = resource.getRawLocation().toOSString();
			availableDefaults.remove(resourceString);
			if (resourceString.equals(actualDefault)){
				actualDefault = null;
				defaultReport = null;
				defaultConfig = null;
			}
		}
		savePreferences();
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:17,代码来源:DefaultManager.java

示例6: resourceChanged

public void resourceChanged(final IResourceChangeEvent event) {
	switch (event.getType()) {
	case IResourceChangeEvent.PRE_DELETE:
		break;
	case IResourceChangeEvent.POST_CHANGE:
		try {
			DeltaVisitor visitor = new DeltaVisitor(ABasicEditor.this);
			event.getDelta().accept(visitor);
		} catch (CoreException e) {
			UIUtils.showError(e);
		}
		break;
	case IResourceChangeEvent.PRE_BUILD:
	case IResourceChangeEvent.POST_BUILD:
		break;
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:17,代码来源:ABasicEditor.java

示例7: resourceChanged

@Override
public void resourceChanged(IResourceChangeEvent event) {
	if (event.getType() == IResourceChangeEvent.POST_CHANGE) {
		IResourceDelta delta = event.getDelta();
		try {
			final WorkspaceDeltaVisitor visitor = new WorkspaceDeltaVisitor();
			delta.accept(visitor);
			if (!pendingChanges && visitor.anyChanges) {
				pendingChanges = true;
				indexer.requestImmediateSync();
			}
		} catch (Exception e) {
			console.printerrln(e);
		}
	}
}
 
开发者ID:mondo-project,项目名称:mondo-hawk,代码行数:16,代码来源:Workspace.java

示例8: N4JSProjectExplorerContentProvider

/**
 * Creates a new content provider for the navigator with N4JS content support.
 *
 * @param store
 *            the preference store;
 */
@Inject
public N4JSProjectExplorerContentProvider(final ExternalLibraryPreferenceStore store) {
	store.addListener(this);
	int eventMask = IResourceChangeEvent.PRE_BUILD | IResourceChangeEvent.POST_CHANGE;
	getWorkspace().addResourceChangeListener(this::cleanBuildOrManifestChangedEvent, eventMask);
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:12,代码来源:N4JSProjectExplorerContentProvider.java

示例9: resourceChanged

@Override
public void resourceChanged(IResourceChangeEvent event)
{
	switch( event.getType() )
	{
	case IResourceChangeEvent.POST_CHANGE:
		handleResourceDelta(event.getDelta());
		processModelChanges();
		break;
	case IResourceChangeEvent.PRE_CLOSE:
		removeModel((IProject) event.getResource());
		processModelChanges();
		break;
	}
}
 
开发者ID:equella,项目名称:Equella,代码行数:15,代码来源:WorkspaceModelManager.java

示例10: resourceChanged

@Override
public void resourceChanged(IResourceChangeEvent event) {
    switch (event.getType()) {
    case IResourceChangeEvent.PRE_CLOSE:
    case IResourceChangeEvent.PRE_DELETE:
        handlerCloseProject(event);
        break;
    case IResourceChangeEvent.POST_CHANGE:
        handleChangeProject(event.getDelta());
        break;
    default:
        break;
    }
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:14,代码来源:ProjectEditorDiffer.java

示例11: resourceChanged

@Override
public void resourceChanged(IResourceChangeEvent event) {
	if (event == null || event.getDelta() == null || event.getType() != IResourceChangeEvent.POST_CHANGE) {
		return;
	}

	try {
		event.getDelta().accept(new IResourceDeltaVisitor() {
			public boolean visit(IResourceDelta delta) throws CoreException {
				final IResource resource = delta.getResource();

				/* Visite le workspace. */
				if (resource instanceof IWorkspaceRoot) {
					return true;
				}

				/* Visite le projet. */
				if (resource instanceof IProject && delta.getKind() == IResourceDelta.CHANGED) {
					/* Cas d'un changement : potentiellement une ouverture de projet. */
					handleProject(resource.getProject());
				}

				return false;
			}
		});
	} catch (CoreException e) {
		ErrorUtils.handle(e);
	}
}
 
开发者ID:sebez,项目名称:vertigo-chroma-kspplugin,代码行数:29,代码来源:LegacyManager.java

示例12: resourceChanged

@Override
public void resourceChanged(IResourceChangeEvent event) {
	if (event.getType() != IResourceChangeEvent.POST_CHANGE) {
		return;
	}
	IEditorInput editorInput = this.getEditorInput();
	if (!(editorInput instanceof FileEditorInput)) {
		return;
	}

	FileEditorInput fileInput = (FileEditorInput) editorInput;
	IFile file = fileInput.getFile();
	IResourceDelta candidate = event.getDelta().findMember(file.getFullPath());
	if (candidate == null) {
		return;
	}
	/* Changement de contenu. */
	if ((candidate.getFlags() & IResourceDelta.CONTENT) == 0) {
		return;
	}
	switch (candidate.getKind()) {
	case IResourceDelta.ADDED:
	case IResourceDelta.CHANGED:
		checkKsp(file);
		break;
	case IResourceDelta.REMOVED:
	default:
		break;
	}
}
 
开发者ID:sebez,项目名称:vertigo-chroma-kspplugin,代码行数:30,代码来源:KspEditor.java

示例13: resourceChanged

@Override
public void resourceChanged(IResourceChangeEvent event) {
	if (event.getType() == IResourceChangeEvent.POST_CHANGE) {
		IResourceDelta delta = event.getDelta();
		if (delta != null) {
			try {
				delta.accept(this);
			} catch (CoreException e) {
				EditorConfigPlugin.logError("Error while .editorconfig resource changed", e);
			}
		}
	}
}
 
开发者ID:angelozerr,项目名称:ec4e,代码行数:13,代码来源:IDEEditorConfigManager.java

示例14: resourceChanged

@Override
public void resourceChanged(IResourceChangeEvent event) {
	try {
		if (event.getType() != IResourceChangeEvent.POST_CHANGE)
			return;
		IResourceDelta rootDelta = event.getDelta();
		rootDelta.accept(new IResourceDeltaVisitor() {
			@Override
			public boolean visit(IResourceDelta delta) throws CoreException {
				if (delta.getKind() != IResourceDelta.CHANGED)
					return true;
				if ((delta.getFlags() & IResourceDelta.CONTENT) == 0)
					return true;
				IResource resource = delta.getResource();
				if (resource.getType() == IResource.FILE 
						&& "proto".equalsIgnoreCase(resource.getFileExtension())) {
					String projectPathStr = workspacePathStr + "/" + resource.getFullPath().segment(0).toString();
					String protoPathStr = workspacePathStr + resource.getFullPath().toString();
					executor.execute(new ProtocRunnable(log, genDirName, projectPathStr, protoPathStr));
				}
				return true;
			}
		});
	} catch (Throwable th) {
		log.error(th);
	}
}
 
开发者ID:tcolloca,项目名称:ProtoGen,代码行数:27,代码来源:ResourceChangeListener.java

示例15: resourceChanged

@Override
public void resourceChanged(IResourceChangeEvent event) {
	try {
		IResource resource = event.getResource();
		switch (event.getType()) {
		case IResourceChangeEvent.PRE_DELETE:
			if (resource != null) {
				switch (resource.getType()) {
				case IResource.PROJECT:
					// called when project is deleted.
					deleteProject((IProject) resource);
					break;
				}
			}
			break;
		case IResourceChangeEvent.PRE_CLOSE:
			if (resource != null) {
				switch (resource.getType()) {
				case IResource.PROJECT:
					// called when project is closed.
					closeProject((IProject) resource);
					break;
				}
			}
			break;
		case IResourceChangeEvent.POST_CHANGE:
			IResourceDelta delta = event.getDelta();
			if (delta != null) {
				delta.accept(this);
			}
			break;
		}
	} catch (Throwable e) {
		Trace.trace(Trace.SEVERE, "Error while TypeScript resource changed", e);
	}
}
 
开发者ID:angelozerr,项目名称:typescript.java,代码行数:36,代码来源:ResourcesWatcher.java


注:本文中的org.eclipse.core.resources.IResourceChangeEvent.POST_CHANGE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。