本文整理汇总了Java中org.eclipse.core.resources.IResourceChangeEvent.getType方法的典型用法代码示例。如果您正苦于以下问题:Java IResourceChangeEvent.getType方法的具体用法?Java IResourceChangeEvent.getType怎么用?Java IResourceChangeEvent.getType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.core.resources.IResourceChangeEvent
的用法示例。
在下文中一共展示了IResourceChangeEvent.getType方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: resourceChanged
import org.eclipse.core.resources.IResourceChangeEvent; //导入方法依赖的package包/类
/**
* Closes all project files on project close.
*/
public void resourceChanged(final IResourceChangeEvent event) {
if (event.getType() == IResourceChangeEvent.PRE_CLOSE) {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
IWorkbenchPage[] pages = getSite().getWorkbenchWindow().getPages();
for (int i = 0; i < pages.length; i++) {
if (((FileEditorInput) editor.getEditorInput()).getFile().getProject().equals(event.getResource())) {
IEditorPart editorPart = pages[i].findEditor(editor.getEditorInput());
pages[i].closeEditor(editorPart, true);
}
}
}
});
}
}
示例2: resourceChanged
import org.eclipse.core.resources.IResourceChangeEvent; //导入方法依赖的package包/类
@Override
public void resourceChanged(IResourceChangeEvent event) {
if (event.getType() == IResourceChangeEvent.PRE_CLOSE) {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
IWorkbenchPage[] pages = getSite().getWorkbenchWindow().getPages();
for (int i = 0; i < pages.length; i++) {
if (((FileEditorInput) getEditorInput()).getFile().getProject().equals(event.getResource())) {
IEditorPart editorPart = pages[i].findEditor(getEditorInput());
pages[i].closeEditor(editorPart, true);
}
}
}
});
}
}
示例3: resourceChanged
import org.eclipse.core.resources.IResourceChangeEvent; //导入方法依赖的package包/类
@Override
public void resourceChanged(IResourceChangeEvent event)
{
if( event.getType() == IResourceChangeEvent.PRE_BUILD )
{
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
if( fTouchWorkspace )
{
IProject[] projects = root.getProjects();
for( int i = 0; i < projects.length; i++ )
{
touchProject(projects[i]);
}
}
else
{
Iterator<String> iter = fProjectNames.iterator();
while( iter.hasNext() )
{
touchProject(root.getProject(iter.next()));
}
}
fTouchWorkspace = false;
fProjectNames.clear();
}
}
示例4: resourceChanged
import org.eclipse.core.resources.IResourceChangeEvent; //导入方法依赖的package包/类
/**
* Closes all project files on project close.
*/
public void resourceChanged(final IResourceChangeEvent event) {
if (event.getType() == IResourceChangeEvent.PRE_CLOSE) {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
IWorkbenchPage[] pages = getSite().getWorkbenchWindow().getPages();
for (int i = 0; i < pages.length; i++) {
if (((FileEditorInput) editor.getEditorInput()).getFile().getProject()
.equals(event.getResource())) {
IEditorPart editorPart = pages[i].findEditor(editor.getEditorInput());
pages[i].closeEditor(editorPart, true);
}
}
}
});
}
}
示例5: resourceChanged
import org.eclipse.core.resources.IResourceChangeEvent; //导入方法依赖的package包/类
/**
* Closes all project files on project close.
*/
public void resourceChanged(final IResourceChangeEvent event) {
if (event.getType() == IResourceChangeEvent.PRE_CLOSE) {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
IWorkbenchPage[] pages = getSite().getWorkbenchWindow().getPages();
for (int i = 0; i < pages.length; i++) {
// if(((FileEditorInput)editor.getEditorInput()).getFile().getProject().equals(event.getResource())){
// IEditorPart editorPart =
// pages[i].findEditor(editor.getEditorInput());
// pages[i].closeEditor(editorPart,true);
// }
}
}
});
}
}
示例6: resourceChanged
import org.eclipse.core.resources.IResourceChangeEvent; //导入方法依赖的package包/类
public void resourceChanged(IResourceChangeEvent event){
if(event.getType()==IResourceChangeEvent.PRE_CLOSE){
try{
if(event.getResource().getProject().isNatureEnabled(CommonNames.DERBY_NATURE)){
if(getRunning(event.getResource().getProject())){
stopDerbyServer(event.getResource().getProject());
}
}
}catch(SWTException swe){
//The SWTException is thrown during the Shell creation
//Logger.log("Exception shutting down "+swe,IStatus.ERROR);
//e.printStackTrace();
}catch(Exception e){
Logger.log("Exception shutting down "+e,IStatus.ERROR);
}
}
}
示例7: resourceChanged
import org.eclipse.core.resources.IResourceChangeEvent; //导入方法依赖的package包/类
/**
* @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) {
Display.getDefault().asyncExec(new Runnable() {
/**
* @see java.lang.Runnable#run()
*/
@Override
public void run() {
final IWorkbenchPage[] pages = getSite().getWorkbenchWindow().getPages();
for (final IWorkbenchPage page : pages) {
if (((FileEditorInput) SGenMultiPageEditor.this.xtextEditor.getEditorInput()).getFile()
.getProject().equals(event.getResource())) {
final IEditorPart editorPart = page
.findEditor(SGenMultiPageEditor.this.xtextEditor.getEditorInput());
page.closeEditor(editorPart, true);
}
}
}
});
}
}
示例8: workspaceChanged
import org.eclipse.core.resources.IResourceChangeEvent; //导入方法依赖的package包/类
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));
}
}
示例9: resourceChanged
import org.eclipse.core.resources.IResourceChangeEvent; //导入方法依赖的package包/类
/**
* Closes all project files on project close.
*/
public void resourceChanged(final IResourceChangeEvent event) {
if (event.getType() == IResourceChangeEvent.PRE_CLOSE) {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
IWorkbenchPage[] pages = getSite().getWorkbenchWindow().getPages();
for (int i = 0; i < pages.length; i++) {
if (((FileEditorInput) editor.getEditorInput()).getFile().getProject()
.equals(event.getResource())) {
IEditorPart editorPart = pages[i].findEditor(editor.getEditorInput());
pages[i].closeEditor(editorPart, true);
}
}
}
});
}
}
示例10: resourceChanged
import org.eclipse.core.resources.IResourceChangeEvent; //导入方法依赖的package包/类
/**
* Closes all project files on project close.
*/
public void resourceChanged(final IResourceChangeEvent event) {
if (event.getType() == IResourceChangeEvent.PRE_CLOSE) {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
IWorkbenchPage[] pages = getSite().getWorkbenchWindow()
.getPages();
for (int i = 0; i < pages.length; i++) {
if (((FileEditorInput) editor.getEditorInput())
.getFile().getProject().equals(
event.getResource())) {
IEditorPart editorPart = pages[i].findEditor(editor
.getEditorInput());
pages[i].closeEditor(editorPart, true);
}
}
}
});
}
}
示例11: resourceChanged
import org.eclipse.core.resources.IResourceChangeEvent; //导入方法依赖的package包/类
@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;
}
}
}
示例12: resourceChanged
import org.eclipse.core.resources.IResourceChangeEvent; //导入方法依赖的package包/类
@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);
}
}
示例13: resourceChanged
import org.eclipse.core.resources.IResourceChangeEvent; //导入方法依赖的package包/类
public synchronized void resourceChanged(IResourceChangeEvent event) {
if (event.getType() == IResourceChangeEvent.PRE_CLOSE)
handleCloseEvent(event);
IResourceDelta delta = event.getDelta();
try {
changedFiles.clear();
if (delta != null)
delta.accept(this);
if (changedFiles.size() > 0) {
handleHotModelReplacement();
}
} catch (CoreException e) {
e.printStackTrace();
}
}
示例14: resourceChanged
import org.eclipse.core.resources.IResourceChangeEvent; //导入方法依赖的package包/类
public void resourceChanged(IResourceChangeEvent event)
{
if (event.getType() == IResourceChangeEvent.PRE_DELETE)
{
handleProjectDeleteEvent((IProject) event.getResource());
}
else
{
try
{
event.getDelta().accept(this);
}
catch (CoreException e)
{
IdeLog.logError(ScriptingActivator.getDefault(),
Messages.BundleMonitor_Error_Processing_Resource_Change, e);
}
}
}
示例15: resourceChanged
import org.eclipse.core.resources.IResourceChangeEvent; //导入方法依赖的package包/类
/**
* Closes all project files on project close.
*
* @param event the event
*/
public void resourceChanged(final IResourceChangeEvent event) {
if (event.getType() == IResourceChangeEvent.PRE_CLOSE) {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
IWorkbenchPage[] pages = getSite().getWorkbenchWindow()
.getPages();
for (int i = 0; i < pages.length; i++) {
if (((FileEditorInput) editor.getEditorInput())
.getFile().getProject()
.equals(event.getResource())) {
IEditorPart editorPart = pages[i].findEditor(editor
.getEditorInput());
pages[i].closeEditor(editorPart, true);
}
}
}
});
}
}
开发者ID:germanattanasio,项目名称:traceability-assistant-eclipse-plugins,代码行数:25,代码来源:TraceabilityEditor.java