Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2009 itemis AG (http://www.itemis.eu) and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html /
  
  package org.eclipse.xtext.ui.editor;
  
 import java.util.List;
 

Author(s):
Sebastian Zarnekow - Initial contribution and API
 
 // TODO: batch events according to the contract of IDirtyStateManager
 
 	
 	public DirtyStateManager() {
 	}
 	
 	public void announceDirtyStateChanged(IDirtyResource dirtyResource) {
 		// avoid putting a dirtyResource into the map that wasn't managed before
 		if (.replace(dirtyResource.getURI(), dirtyResource) != null) {
 			notifyListeners(dirtyResourcetrue);
 		}
 	}
 
 	public void discardDirtyState(IDirtyResource dirtyResource) {
 		if (.remove(dirtyResource.getURI(), dirtyResource)) {
 			notifyListeners(dirtyResourcefalse);
 		}
 	}
 
 	protected void notifyListeners(final IDirtyResource dirtyResourceboolean managed) {
 		if (managed) {
 				public boolean haveEObjectDescriptionsChanged() {
 					return true;
 				}
 				
 					return null;
 				}
 				
 					return dirtyResource.getDescription();
 				}
 
 				public URI getUri() {
 					return dirtyResource.getURI();
 				}
 			};
 		} else {
 				public boolean haveEObjectDescriptionsChanged() {
 					return true;
 				}
 				
 					return dirtyResource.getDescription();
 				}
 				
 					return null;
 				}
 				public URI getUri() {
					return dirtyResource.getURI();
				}
			};
		}
	}
	public boolean manageDirtyState(IDirtyResource dirtyResource) {
		IDirtyResource prevValue = .putIfAbsent(dirtyResource.getURI(), dirtyResource);
		return prevValue == null || prevValue == dirtyResource;
	}
		return .get(uri);
	}
		IDirtyResource dirtyResource = getDirtyResource(uri);
		if (dirtyResource != null) {
			if (dirtyResource instanceof IDirtyResource.InitializationAware) {
			}
			return dirtyResource.getDescription();
		}
		return null;
	}
	public String getContent(URI uri) {
		if (dirtyResource != null) {
			if (dirtyResource instanceof IDirtyResource.InitializationAware) {
			}
			return dirtyResource.getContents();
		}
		return null;
	}

Since:
2.8
Noreference:
This method is not intended to be referenced by clients.
Nooverride:
This method is not intended to be re-implemented or extended by clients.
		if (dirtyResource instanceof IDirtyResource.ICurrentStateProvidingExtension) {
		}
		return null;
	}

Since:
2.4
		IDirtyResource dirtyResource = .get(uri);
		if (dirtyResource == null) {
			while (dirtyResource == null && iterator.hasNext()) {
				IDirtyResource res = iterator.next();
					if (normalizedURI.equals(uri)) {
						dirtyResource = res;
					}
				}
			}
		}
		return dirtyResource;
	}
		return new IExternalContentProvider() {
			public boolean hasContent(URI uri) {
				return DirtyStateManager.this.hasContent(uri);
			}
			public String getContent(URI uri) {
				if (dirtyResource != null) {
					if (dirtyResource instanceof IDirtyResource.InitializationAware) {
					}
					return dirtyResource.getActualContents();
				}
				return null;
			}
				return this;
			}
		};
	}
	public boolean hasContent(URI uri) {
	}
	public boolean isEmpty() {
	}
				if (from != null)
				return Collections.emptyList();
			}
		}));
	}
	public Iterable<IEObjectDescriptiongetExportedObjects(final EClass typefinal QualifiedName namefinal boolean ignoreCase) {
				if (from != null)
					return from.getDescription().getExportedObjects(typenameignoreCase);
				return Collections.emptyList();
			}
		}));
	}
		URI resourceURI = EcoreUtil2.getPlatformResourceOrNormalizedURI(object).trimFragment();
		IDirtyResource dirtyResource = getDirtyResource(resourceURI);
		if (dirtyResource != null) {
			return dirtyResource.getDescription().getExportedObjectsByObject(object);
		}
		return Collections.emptyList();
	}
				if (from != null)
				return Collections.emptyList();
			}
		}));
	}

Since:
2.7
		return ImmutableList.copyOf(.keySet());
	}
New to GrepCode? Check out our FAQ X