|
Lines 30-35
Link Here
|
| 30 |
|
30 |
|
| 31 |
import org.eclipse.core.resources.IFile; |
31 |
import org.eclipse.core.resources.IFile; |
| 32 |
import org.eclipse.core.runtime.CoreException; |
32 |
import org.eclipse.core.runtime.CoreException; |
|
|
33 |
import org.eclipse.core.runtime.IAdaptable; |
| 33 |
import org.eclipse.core.runtime.NullProgressMonitor; |
34 |
import org.eclipse.core.runtime.NullProgressMonitor; |
| 34 |
import org.eclipse.rse.core.RSECorePlugin; |
35 |
import org.eclipse.rse.core.RSECorePlugin; |
| 35 |
import org.eclipse.rse.core.events.ISystemResourceChangeEvents; |
36 |
import org.eclipse.rse.core.events.ISystemResourceChangeEvents; |
|
Lines 102-107
Link Here
|
| 102 |
{ |
103 |
{ |
| 103 |
super(); |
104 |
super(); |
| 104 |
} |
105 |
} |
|
|
106 |
|
| 107 |
|
| 105 |
/** |
108 |
/** |
| 106 |
* Create the page's GUI contents. |
109 |
* Create the page's GUI contents. |
| 107 |
*/ |
110 |
*/ |
|
Lines 374-380
Link Here
|
| 374 |
protected IRemoteFile getRemoteFile() |
377 |
protected IRemoteFile getRemoteFile() |
| 375 |
{ |
378 |
{ |
| 376 |
Object element = getElement(); |
379 |
Object element = getElement(); |
| 377 |
return ((IRemoteFile)element); |
380 |
IRemoteFile file = (IRemoteFile)element; |
|
|
381 |
|
| 382 |
return file; |
| 378 |
} |
383 |
} |
| 379 |
|
384 |
|
| 380 |
/** |
385 |
/** |
|
Lines 515-520
Link Here
|
| 515 |
// refresh |
520 |
// refresh |
| 516 |
ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry(); |
521 |
ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry(); |
| 517 |
|
522 |
|
|
|
523 |
remoteFile.markStale(true); |
| 524 |
|
| 518 |
// oldCanWrite and updatedValue may not be the same depending on the underlying file service |
525 |
// oldCanWrite and updatedValue may not be the same depending on the underlying file service |
| 519 |
// If the file service updates the underlying object, then there is no need for a remote refresh |
526 |
// If the file service updates the underlying object, then there is no need for a remote refresh |
| 520 |
if (oldCanWrite == updatedValue) |
527 |
if (oldCanWrite == updatedValue) |
|
Lines 572-582
Link Here
|
| 572 |
} catch (CoreException e) { |
579 |
} catch (CoreException e) { |
| 573 |
} |
580 |
} |
| 574 |
} |
581 |
} |
|
|
582 |
|
| 575 |
} |
583 |
} |
| 576 |
|
584 |
|
| 577 |
return ok; |
585 |
return ok; |
| 578 |
} |
586 |
} |
| 579 |
|
587 |
|
|
|
588 |
protected boolean wantDefaultAndApplyButton() |
| 589 |
{ |
| 590 |
return true; |
| 591 |
} |
| 592 |
|
| 593 |
protected void performApply() { |
| 594 |
performOk(); |
| 595 |
} |
| 596 |
|
| 597 |
protected void performDefaults() { |
| 598 |
doInitializeFields(); |
| 599 |
} |
| 600 |
|
| 601 |
|
| 580 |
/** |
602 |
/** |
| 581 |
* Validate all the widgets on the page |
603 |
* Validate all the widgets on the page |
| 582 |
* <p> |
604 |
* <p> |
|
Lines 597-600
Link Here
|
| 597 |
|
619 |
|
| 598 |
} |
620 |
} |
| 599 |
|
621 |
|
|
|
622 |
|
| 623 |
public void setVisible(boolean visible) { |
| 624 |
if (visible){ |
| 625 |
IRemoteFile file = getRemoteFile(); |
| 626 |
if (file.isStale()){ // has file changed? |
| 627 |
try |
| 628 |
{ |
| 629 |
file = file.getParentRemoteFileSubSystem().getRemoteFileObject(file.getAbsolutePath(), new NullProgressMonitor()); |
| 630 |
} |
| 631 |
catch (Exception e){ |
| 632 |
} |
| 633 |
setElement((IAdaptable)file); |
| 634 |
|
| 635 |
// reset according to the changed file |
| 636 |
performDefaults(); |
| 637 |
} |
| 638 |
} |
| 639 |
super.setVisible(visible); |
| 640 |
} |
| 641 |
|
| 600 |
} |
642 |
} |