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


Java IResourceDelta.LOCAL_CHANGED屬性代碼示例

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


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

示例1: resourceChanged

@Override
public void resourceChanged(final IResourceChangeEvent event) {
	final IResourceDelta delta = event.getDelta().findMember(imageFile.getFullPath());
	if (delta != null) {
		// file deleted -- close the editor
		if (delta.getKind() == IResourceDelta.REMOVED) {
			final Runnable r = () -> getSite().getPage().closeEditor(ImageViewer.this, false);
			getSite().getShell().getDisplay().asyncExec(r);
		}
		// file changed -- reload image
		else if (delta.getKind() == IResourceDelta.CHANGED) {
			final int flags = delta.getFlags();
			if ((flags & IResourceDelta.CONTENT) != 0 || (flags & IResourceDelta.LOCAL_CHANGED) != 0) {
				startImageLoad();
			}
		}
	}
}
 
開發者ID:gama-platform,項目名稱:gama,代碼行數:18,代碼來源:ImageViewer.java

示例2: resourceChanged

/**
 * Closes all project files on project close.
 *
 * @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent)
 */
@Override
public void resourceChanged(final IResourceChangeEvent event) {
	if (event.getType() == IResourceChangeEvent.PRE_CLOSE || event.getType() == IResourceChangeEvent.PRE_DELETE) {
		WorkbenchHelper.asyncRun(() -> {
			final IWorkbenchPage[] pages = getSite().getWorkbenchWindow().getPages();
			for (final IWorkbenchPage page : pages) {
				if (((FileEditorInput) editor.getEditorInput()).getFile().getProject()
						.equals(event.getResource())) {
					final IEditorPart editorPart = page.findEditor(editor.getEditorInput());
					page.closeEditor(editorPart, true);
				}
			}
		});
	} else {

		final IResourceDelta delta = event.getDelta().findMember(getFileFor(getEditorInput()).getFullPath());
		if (delta != null) {
			// file deleted -- close the editor
			if (delta.getKind() == IResourceDelta.REMOVED) {
				final Runnable r = () -> getSite().getPage().closeEditor(MultiPageCSVEditor.this, false);
				getSite().getShell().getDisplay().asyncExec(r);
			}
			// file changed -- reload
			else if (delta.getKind() == IResourceDelta.CHANGED) {
				final int flags = delta.getFlags();
				if ((flags & IResourceDelta.CONTENT) != 0 || (flags & IResourceDelta.LOCAL_CHANGED) != 0) {
					MultiPageCSVEditor.this.updateTableFromTextEditor();
				}
			}
		}

	}
}
 
開發者ID:gama-platform,項目名稱:gama,代碼行數:38,代碼來源:MultiPageCSVEditor.java

示例3: getFlagTxt

/**
 * Adds debug messages.
 * 
 * @param flag
 * @return debug message
 */
private String getFlagTxt(int flag) {
	String flags = "F_";
	if ((flag & IResourceDelta.ADDED) != 0) {
		flags += "ADDED ";
	}
	if ((flag & IResourceDelta.ADDED_PHANTOM) != 0) {
		flags += "ADDED_PHANTOM ";
	}
	if ((flag & IResourceDelta.ALL_WITH_PHANTOMS) != 0) {
		flags += "ALL_WITH_PHANTOMS ";
	}
	if ((flag & IResourceDelta.CHANGED) != 0) {
		flags += "CHANGED ";
	}
	if ((flag & IResourceDelta.CONTENT) != 0) {
		flags += "CONTENT ";
	}
	if ((flag & IResourceDelta.COPIED_FROM) != 0) {
		flags += "COPIED_FROM ";
	}
	if ((flag & IResourceDelta.DERIVED_CHANGED) != 0) {
		flags += "DERIVED_CHANGED ";
	}
	if ((flag & IResourceDelta.DESCRIPTION) != 0) {
		flags += "DESCRIPTION ";
	}
	if ((flag & IResourceDelta.ENCODING) != 0) {
		flags += "ENCODING ";
	}
	if ((flag & IResourceDelta.LOCAL_CHANGED) != 0) {
		flags += "LOCAL_CHANGED ";
	}
	if ((flag & IResourceDelta.MARKERS) != 0) {
		flags += "MARKERS ";
	}
	if ((flag & IResourceDelta.MOVED_FROM) != 0) {
		flags += "MOVED_FROM ";
	}
	if ((flag & IResourceDelta.MOVED_TO) != 0) {
		flags += "MOVED_TO ";
	}
	if ((flag & IResourceDelta.NO_CHANGE) != 0) {
		flags += "NO_CHANGE ";
	}
	if ((flag & IResourceDelta.OPEN) != 0) {
		flags += "OPEN ";
	}
	if ((flag & IResourceDelta.REMOVED) != 0) {
		flags += "REMOVED ";
	}
	if ((flag & IResourceDelta.REMOVED_PHANTOM) != 0) {
		flags += "REMOVED_PHANTOM ";
	}
	if ((flag & IResourceDelta.REPLACED) != 0) {
		flags += "REPLACED ";
	}
	if ((flag & IResourceDelta.SYNC) != 0) {
		flags += "SYNC ";
	}
	if ((flag & IResourceDelta.TYPE) != 0) {
		flags += "TYPE ";
	}
	return flags;
}
 
開發者ID:1Tristan,項目名稱:VariantSync,代碼行數:70,代碼來源:ChangeHandler.java


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