本文整理匯總了Java中org.eclipse.core.resources.IResourceDelta.ADDED屬性的典型用法代碼示例。如果您正苦於以下問題:Java IResourceDelta.ADDED屬性的具體用法?Java IResourceDelta.ADDED怎麽用?Java IResourceDelta.ADDED使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.eclipse.core.resources.IResourceDelta
的用法示例。
在下文中一共展示了IResourceDelta.ADDED屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: handleResourceDelta
/**
* Handles the given resource delta.
*
* Fires workspace repository changed event if a project was opened/closed or a project was added/removed.
*/
private boolean handleResourceDelta(IResourceDelta delta) {
IResource affectedResource = delta.getResource();
if (affectedResource instanceof IProject) {
// check if kind is CHANGED
if ((delta.getKind() & IResourceDelta.CHANGED) == IResourceDelta.CHANGED) {
// if project was opened/closed
if ((delta.getFlags() & IResourceDelta.OPEN) == IResourceDelta.OPEN) {
fireWorkspaceRepositoriesChanged();
return false;
}
}
// check if kind is ADDED or REMOVED
else if ((delta.getKind() & IResourceDelta.ADDED | IResourceDelta.REMOVED) != 0) {
fireWorkspaceRepositoriesChanged();
return false;
}
}
return true;
}
示例2: visit
public boolean visit(IResourceDelta delta) throws CoreException {
IResource resource = delta.getResource();
switch (delta.getKind()) {
case IResourceDelta.ADDED:
updateProjectPluginConfiguration(resource);
checkConsistency(resource);
break;
case IResourceDelta.REMOVED:
updateProjectPluginConfiguration(resource);
checkConsistency(resource);
break;
case IResourceDelta.CHANGED:
updateProjectPluginConfiguration(resource);
checkConsistency(resource);
break;
}
//return true to continue visiting children.
return true;
}
示例3: breakpointChanged
/**
* {@inheritDoc}
*
* @see org.eclipse.debug.core.IBreakpointListener#breakpointChanged(org.eclipse.debug.core.model.IBreakpoint,
* org.eclipse.core.resources.IMarkerDelta)
*/
public void breakpointChanged(IBreakpoint breakpoint, IMarkerDelta delta) {
if (supportsBreakpoint(breakpoint)) {
try {
final URI uri = ((DSLBreakpoint)breakpoint).getURI();
final IMarker marker = breakpoint.getMarker();
for (Entry<String, Object> entry : delta.getAttributes().entrySet()) {
final Object markerValue = marker.getAttribute(entry.getKey());
final Object deltaValue = entry.getValue();
if ((markerValue != null && !markerValue.equals(deltaValue)) || (deltaValue != null
&& !deltaValue.equals(markerValue))) {
if (delta.getKind() == IResourceDelta.ADDED) {
factory.getDebugger().handleEvent(new ChangeBreakPointRequest(uri, entry.getKey(),
(Serializable)deltaValue));
} else {
factory.getDebugger().handleEvent(new ChangeBreakPointRequest(uri, entry.getKey(),
(Serializable)markerValue));
}
}
}
} catch (CoreException e) {
Activator.getDefault().error(e);
}
}
}
示例4: handleFileDelta
@Override
protected void handleFileDelta(IResourceDelta delta)
{
IFile file = (IFile) delta.getResource();
JarPluginModelImpl existing = jarModels.get(file);
if( delta.getKind() == IResourceDelta.REMOVED && existing != null )
{
removeJar(existing);
}
else if( delta.getKind() == IResourceDelta.ADDED )
{
if( isPluginJar(file) )
{
addJarModel(fModels.get(file.getProject()), file, true);
}
}
else if( delta.getKind() == IResourceDelta.CHANGED && existing != null )
{
existing.reload();
addChange(existing, IModelProviderEvent.MODELS_CHANGED);
}
}
示例5: visit
public boolean visit(IResourceDelta delta) throws CoreException {
IResource resource = delta.getResource();
if (!PreferenceManager.isBuildEnabled(resource.getProject().getName())) {
if (resource instanceof IFile) {
deleteMarkers((IFile)resource);
}
return true;
}
switch (delta.getKind()) {
case IResourceDelta.ADDED:
checkResource(resource);
break;
case IResourceDelta.REMOVED:
checkRemovedResource(resource);
break;
case IResourceDelta.CHANGED:
checkResource(resource);
break;
}
// return true to continue visiting children.
return true;
}
示例6: visit
public boolean visit(IResourceDelta delta) throws CoreException {
IResource resource = delta.getResource();
if (resource.getFileExtension() != null){
switch (delta.getKind()) {
case IResourceDelta.ADDED:
if(resource.getFileExtension().equals("java")){
executeBuild = true;
return false;
}
break;
case IResourceDelta.REMOVED:
if(resource.getFileExtension().equals("java")){
executeBuild = true;
return false;
}
break;
case IResourceDelta.CHANGED:
if( resource.getFileExtension().equals("java")){
executeBuild = true;
return false;
}
break;
}
}
return true;
}
示例7: handleSVNDir
protected void handleSVNDir(IContainer svnDir, int kind) {
if((kind & IResourceDelta.ALL_WITH_PHANTOMS)!=0) {
if(kind==IResourceDelta.ADDED) {
// should this dir be made team-private? If it contains Entries then yes!
IFile entriesFile = svnDir.getFile(new Path(SVNConstants.SVN_ENTRIES));
if (entriesFile.exists() && !svnDir.isTeamPrivateMember()) {
try {
svnDir.setTeamPrivateMember(true);
if(Policy.DEBUG_METAFILE_CHANGES) {
System.out.println("[svn] found a new SVN meta folder, marking as team-private: " + svnDir.getFullPath()); //$NON-NLS-1$
}
} catch(CoreException e) {
SVNProviderPlugin.log(SVNException.wrapException(svnDir, Policy.bind("SyncFileChangeListener.errorSettingTeamPrivateFlag"), e)); //$NON-NLS-1$
}
}
}
}
}
示例8: visit
@Override
public boolean visit(final IResourceDelta delta) throws CoreException {
final IResource iResource = delta.getResource();
final String fileExtension = iResource.getFileExtension();
final boolean isMonitoredResource = VitruviusEmfBuilder.this.getMonitoredFileTypes().contains(fileExtension);
if (isMonitoredResource) {
switch (delta.getKind()) {
case IResourceDelta.ADDED:
LOGGER.debug("Importing to Vitruvius: " + iResource);
VitruviusEmfBuilder.this.importToVitruvius(iResource);
break;
case IResourceDelta.REMOVED:
LOGGER.debug("Removing from Vitruvius: " + iResource);
VitruviusEmfBuilder.this.removeFromVitruvius(iResource);
break;
case IResourceDelta.CHANGED:
// LOGGER.debug("Resource changed: " + iResource);
VitruviusEmfBuilder.this.triggerSynchronisation(iResource);
break;
default:
LOGGER.debug("No action for change kind: '" + delta.getKind() + "' executed.");
}
}
// return true to continue visiting children.
return true;
}
示例9: visit
public boolean visit(IResourceDelta delta) throws CoreException {
IResource resource = delta.getResource();
switch (delta.getKind()) {
case IResourceDelta.ADDED:
checkABAP(resource);
break;
case IResourceDelta.REMOVED:
break;
case IResourceDelta.CHANGED:
checkABAP(resource);
break;
default: // do nothing
break;
}
return true;
}
示例10: isProblemDelta
private boolean isProblemDelta(IResourceDelta delta) {
if ((delta.getFlags() & IResourceDelta.MARKERS) == 0) {
return false;
}
for (IMarkerDelta markerDelta : delta.getMarkerDeltas()) {
if (markerDelta.isSubtypeOf(IMarker.PROBLEM)) {
// Detect added/removed problem markers
int kind = markerDelta.getKind();
if (kind == IResourceDelta.ADDED || kind == IResourceDelta.REMOVED) {
return true;
}
// Detect changes in problem marker severity
int oldSeverity = markerDelta.getAttribute(IMarker.SEVERITY, -1);
int newSeverity = markerDelta.getMarker().getAttribute(IMarker.SEVERITY, -1);
if (newSeverity != oldSeverity) {
return true;
}
}
}
return false;
}
示例11: processDelta
/**
* Processes the given {@link IResourceDelta} by
* {@link WorkspaceListener#fireChange(fr.obeo.dsl.workspace.listener.change.IChange) firing}
* {@link fr.obeo.dsl.workspace.listener.change.IChange IChange}.
*
* @param delta
* the {@link IResourceDelta} to process
* @param movedResources
* mapping of moved {@link IResource}
* @param base
* the current {@link IBase}
*/
private void processDelta(IResourceDelta delta, HashMap<IPath, IResource> movedResources, IBase base) {
switch (delta.getKind()) {
case IResourceDelta.ADDED:
processAddedDelta(delta, movedResources, base);
break;
case IResourceDelta.REMOVED:
processRemovedDelta(delta, movedResources, base);
break;
case IResourceDelta.CHANGED:
processChangedDelta(delta, base);
break;
default:
break;
}
}
示例12: add
/**
* add
*
* @param resource
* @param marker
* @throws CoreException
*/
public void add(IUniformResource resource, MarkerInfo marker) throws CoreException
{
ResourceInfo info = getResourceInfo(resource);
if (info == null)
{
info = createResourceInfo(resource);
}
MarkerSet markers = info.getMarkers(true);
if (markers == null)
{
markers = new MarkerSet(1);
}
basicAdd(resource, markers, marker);
if (!markers.isEmpty())
{
info.setMarkers(markers);
}
IMarkerSetElement[] changes = new IMarkerSetElement[1];
changes[0] = new MarkerDelta(IResourceDelta.ADDED, resource, marker);
changedMarkers(resource, changes);
}
示例13: visit
/**
* @see org.eclipse.core.resources.IResourceDeltaVisitor#visit(org.eclipse.core.resources.IResourceDelta)
*/
public boolean visit(IResourceDelta delta) throws CoreException {
IResource resource = delta.getResource();
switch (delta.getKind()) {
case IResourceDelta.ADDED:
// handle added resource
System.out.println("RBE DELTA added");
checkBundleResource(resource);
break;
case IResourceDelta.REMOVED:
System.out.println("RBE DELTA Removed"); //$NON-NLS-1$
// handle removed resource
break;
case IResourceDelta.CHANGED:
System.out.println("RBE DELTA changed");
// handle changed resource
checkBundleResource(resource);
break;
}
//return true to continue visiting children.
return true;
}
示例14: dispatchMarkerDelta
protected void dispatchMarkerDelta(final IMarkerDelta iMarkerDelta, final String elementID) {
switch (iMarkerDelta.getKind()) {
case IResourceDelta.ADDED :
addSCTIssue(iMarkerDelta, elementID);
break;
case IResourceDelta.REMOVED :
removeSCTIssue(iMarkerDelta, elementID);
break;
case IResourceDelta.CHANGED :
removeSCTIssue(iMarkerDelta, elementID);
addSCTIssue(iMarkerDelta, elementID);
break;
default :
break;
}
}
示例15: visit
public boolean visit(IResourceDelta delta) throws CoreException {
IResource resource = delta.getResource();
switch (delta.getKind()) {
case IResourceDelta.ADDED:
// handle added resource
doIt(resource, buildSgens);
break;
case IResourceDelta.REMOVED:
// handle removed resource
break;
case IResourceDelta.CHANGED:
// handle changed resource
doIt(resource, buildSgens);
break;
}
// return true to continue visiting children.
return true;
}