本文整理匯總了Java中org.eclipse.core.resources.IResourceChangeEvent.PRE_CLOSE屬性的典型用法代碼示例。如果您正苦於以下問題:Java IResourceChangeEvent.PRE_CLOSE屬性的具體用法?Java IResourceChangeEvent.PRE_CLOSE怎麽用?Java IResourceChangeEvent.PRE_CLOSE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.eclipse.core.resources.IResourceChangeEvent
的用法示例。
在下文中一共展示了IResourceChangeEvent.PRE_CLOSE屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: resourceChanged
/**
* 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
@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
/**
* 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);
}
}
}
});
}
}
示例4: resourceChanged
/**
* 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
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);
}
}
}
示例6: resourceChanged
/**
* @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);
}
}
}
});
}
}
示例7: 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));
}
}
示例8: resourceChanged
/**
* 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);
}
}
}
});
}
}
示例9: resourceChanged
/**
* 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
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();
}
}
示例11: resourceChanged
/**
* 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);
}
}
}
});
}
}
示例12: resourceChanged
/**
* 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,代碼行數:24,代碼來源:TraceabilityEditor.java
示例13: resourceChanged
@Override
public void resourceChanged(final IResourceChangeEvent event) {
/**
* Closes all project files on project close.
*/
if(event.getType() != IResourceChangeEvent.PRE_CLOSE){
return;
}
Display.getDefault().asyncExec(new Runnable(){
public void run(){
final IWorkbenchPage[] pages =
getSite().getWorkbenchWindow().getPages();
final FileEditorInput input =
(FileEditorInput)editor.getEditorInput();
final IProject proj = input.getFile().getProject();
for (int i = 0; i<pages.length; i++){
if(proj.equals(event.getResource())){
final IEditorPart editorPart =
pages[i].findEditor(editor.getEditorInput());
pages[i].closeEditor(editorPart, true);
}
}
}
});
}
示例14: resourceChanged
/**
* Closes all project files on project close.
*/
@Override
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) textEditor.getEditorInput()).getFile().getProject().equals(event.getResource())) {
IEditorPart editorPart = pages[i].findEditor(textEditor.getEditorInput());
pages[i].closeEditor(editorPart, true);
}
}
}
});
}
}
示例15: resourceChanged
/**
* 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) bpmnEditor.getEditorInput()).getFile().getProject().equals(event.getResource())) {
IEditorPart editorPart = pages[i].findEditor(bpmnEditor.getEditorInput());
pages[i].closeEditor(editorPart, true);
}
}
}
});
}
}