mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-06 07:45:50 +02:00
[308783] Value in Properties view remains "Pending..."
This commit is contained in:
parent
743a7edceb
commit
09e42b0a8a
3 changed files with 80 additions and 6 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2006, 2008 IBM Corporation and others.
|
* Copyright (c) 2006, 2010 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -15,6 +15,7 @@
|
||||||
* Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin
|
* Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin
|
||||||
* Martin Oberhuber (Wind River) - [234726] Update IRemoteFile Javadocs
|
* Martin Oberhuber (Wind River) - [234726] Update IRemoteFile Javadocs
|
||||||
* David McKnight (IBM) - [246897] Wrong canonical path for a symbolic link
|
* David McKnight (IBM) - [246897] Wrong canonical path for a symbolic link
|
||||||
|
* David McKnight (IBM) - [308783] Value in Properties view remains "Pending..."
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.internal.subsystems.files.dstore;
|
package org.eclipse.rse.internal.subsystems.files.dstore;
|
||||||
|
@ -180,6 +181,13 @@ public class DStoreFile extends AbstractRemoteFile
|
||||||
super(ss,context, parent, hostFile);
|
super(ss,context, parent, hostFile);
|
||||||
_dstoreHostFile = hostFile;
|
_dstoreHostFile = hostFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public void setHostFile(IHostFile hostFile) {
|
||||||
|
super.setHostFile(hostFile);
|
||||||
|
_dstoreHostFile = (DStoreHostFile)hostFile;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isVirtual()
|
public boolean isVirtual()
|
||||||
{
|
{
|
||||||
|
|
|
@ -74,6 +74,7 @@
|
||||||
* David McKnight (IBM) - [283793] [dstore] Expansion indicator(+) does not reset after no connect
|
* David McKnight (IBM) - [283793] [dstore] Expansion indicator(+) does not reset after no connect
|
||||||
* Uwe Stieber (Wind River) - [238519] [usability][api] Adapt RSE view(s) to follow decoration style of the Eclipse platform common navigator
|
* Uwe Stieber (Wind River) - [238519] [usability][api] Adapt RSE view(s) to follow decoration style of the Eclipse platform common navigator
|
||||||
* David McKnight (IBM) - [330973] Drag/drop a local file generates an error message in the Remote system view
|
* David McKnight (IBM) - [330973] Drag/drop a local file generates an error message in the Remote system view
|
||||||
|
* David McKnight (IBM) - [308783] Value in Properties view remains "Pending..."
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.internal.ui.view;
|
package org.eclipse.rse.internal.ui.view;
|
||||||
|
@ -3259,7 +3260,13 @@ public class SystemView extends SafeTreeViewer
|
||||||
}
|
}
|
||||||
|
|
||||||
// STEP 4: update the property sheet in case we changed properties of first selected item
|
// STEP 4: update the property sheet in case we changed properties of first selected item
|
||||||
updatePropertySheet();
|
ISelection selection = getSelection();
|
||||||
|
if (selection instanceof IStructuredSelection){
|
||||||
|
Object sel = ((IStructuredSelection)selection).getFirstElement();
|
||||||
|
if (remoteObject.equals(sel)){
|
||||||
|
updatePropertySheet(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5926,20 +5933,40 @@ public class SystemView extends SafeTreeViewer
|
||||||
item.setExpanded(true);
|
item.setExpanded(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void updatePropertySheet(){
|
||||||
|
updatePropertySheet(false);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when a property is updated and we need to inform the Property Sheet viewer.
|
* Called when a property is updated and we need to inform the Property Sheet viewer.
|
||||||
* There is no formal mechanism for this so we simulate a selection changed event as
|
* There is no formal mechanism for this so we simulate a selection changed event as
|
||||||
* this is the only event the property sheet listens for.
|
* this is the only event the property sheet listens for.
|
||||||
*/
|
*/
|
||||||
public void updatePropertySheet() {
|
private void updatePropertySheet(boolean force) {
|
||||||
ISelection selection = getSelection();
|
ISelection selection = getSelection();
|
||||||
if (selection == null) return;
|
if (selection == null) return;
|
||||||
|
|
||||||
// only fire this event if the view actually has focus
|
// only fire this event if the view actually has focus
|
||||||
if (getControl().isFocusControl())
|
if (force || getControl().isFocusControl())
|
||||||
{
|
{
|
||||||
// create an event
|
IStructuredSelection parentSelection = null;
|
||||||
SelectionChangedEvent event = new SelectionChangedEvent(this, getSelection());
|
// create events in order to update the property sheet
|
||||||
|
if (selection instanceof IStructuredSelection){
|
||||||
|
Object first = ((IStructuredSelection)selection).getFirstElement();
|
||||||
|
ISystemViewElementAdapter adapter = getViewAdapter(first);
|
||||||
|
|
||||||
|
Object parent = adapter.getParent(first);
|
||||||
|
if (parent != null){
|
||||||
|
parentSelection = new StructuredSelection(parent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SelectionChangedEvent dummyEvent = new SelectionChangedEvent(this, parentSelection);
|
||||||
|
SelectionChangedEvent event = new SelectionChangedEvent(this, selection);
|
||||||
|
|
||||||
|
// first change the selection, then change it back (otherwise the property sheet ignores the event)
|
||||||
|
fireSelectionChanged(dummyEvent);
|
||||||
|
|
||||||
// fire the event
|
// fire the event
|
||||||
fireSelectionChanged(event);
|
fireSelectionChanged(event);
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
* Martin Oberhuber (Wind River) - [289533] NPE on "Show in Table"
|
* Martin Oberhuber (Wind River) - [289533] NPE on "Show in Table"
|
||||||
* Noriaki Takatsu (IBM) - [288894] CANCEL has to be pressed 3 times in Userid/Password prompt window in Remote System Details view
|
* Noriaki Takatsu (IBM) - [288894] CANCEL has to be pressed 3 times in Userid/Password prompt window in Remote System Details view
|
||||||
* David McKnight (IBM) - [329170] Show in table does not work after showing empty folder in table
|
* David McKnight (IBM) - [329170] Show in table does not work after showing empty folder in table
|
||||||
|
* David McKnight (IBM) - [308783] Value in Properties view remains "Pending..."
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.ui.view;
|
package org.eclipse.rse.ui.view;
|
||||||
|
@ -972,6 +973,14 @@ public class SystemTableView
|
||||||
{
|
{
|
||||||
updateItem(w, child);
|
updateItem(w, child);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ISelection selection = getSelection();
|
||||||
|
if (selection instanceof IStructuredSelection){
|
||||||
|
Object first = ((IStructuredSelection)selection).getFirstElement();
|
||||||
|
if (first.equals(child)){
|
||||||
|
updatePropertySheet(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -1080,6 +1089,36 @@ public class SystemTableView
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updatePropertySheet(boolean force) {
|
||||||
|
ISelection selection = getSelection();
|
||||||
|
if (selection == null) return;
|
||||||
|
|
||||||
|
// only fire this event if the view actually has focus
|
||||||
|
if (force || getControl().isFocusControl())
|
||||||
|
{
|
||||||
|
IStructuredSelection parentSelection = null;
|
||||||
|
// create events in order to update the property sheet
|
||||||
|
if (selection instanceof IStructuredSelection){
|
||||||
|
Object first = ((IStructuredSelection)selection).getFirstElement();
|
||||||
|
ISystemViewElementAdapter adapter = getViewAdapter(first);
|
||||||
|
|
||||||
|
Object parent = adapter.getParent(first);
|
||||||
|
if (parent != null){
|
||||||
|
parentSelection = new StructuredSelection(parent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SelectionChangedEvent dummyEvent = new SelectionChangedEvent(this, parentSelection);
|
||||||
|
SelectionChangedEvent event = new SelectionChangedEvent(this, selection);
|
||||||
|
|
||||||
|
// first change the selection, then change it back (otherwise the property sheet ignores the event)
|
||||||
|
fireSelectionChanged(dummyEvent);
|
||||||
|
|
||||||
|
// fire the event
|
||||||
|
fireSelectionChanged(event);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the method in your class that will be called when a remote resource
|
* This is the method in your class that will be called when a remote resource
|
||||||
* changes. You will be called after the resource is changed.
|
* changes. You will be called after the resource is changed.
|
||||||
|
|
Loading…
Add table
Reference in a new issue