當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。