/**
  * Return the synchronization page configuration associated with the view to which this content
  * provider applies. A <code>null</code> is returned if no configuration is available.
  *
  * @return the synchronization page configuration or <code>null</code>
  */
 protected ISynchronizePageConfiguration getConfiguration() {
   ICommonContentExtensionSite extensionSite = getExtensionSite();
   if (extensionSite != null)
     return (ISynchronizePageConfiguration)
         extensionSite
             .getExtensionStateModel()
             .getProperty(ITeamContentProviderManager.P_SYNCHRONIZATION_PAGE_CONFIGURATION);
   return null;
 }
 /**
  * Return the resource mapping scope associated with the view to which this content provider
  * applies. A <code>null</code> is returned if no scope is available.
  *
  * @return the resource mapping scope or <code>null</code>
  */
 protected ISynchronizationScope getScope() {
   ICommonContentExtensionSite extensionSite = getExtensionSite();
   if (extensionSite != null)
     return (ISynchronizationScope)
         extensionSite
             .getExtensionStateModel()
             .getProperty(ITeamContentProviderManager.P_SYNCHRONIZATION_SCOPE);
   return null;
 }
 /* (non-Javadoc)
  * @see org.eclipse.jface.viewers.IContentProvider#dispose()
  */
 public void dispose() {
   ICommonContentExtensionSite extensionSite = getExtensionSite();
   if (extensionSite != null) {
     extensionSite.getExtensionStateModel().removePropertyChangeListener(this);
   }
   ISynchronizationContext context = getContext();
   if (context != null) context.getDiffTree().removeDiffChangeListener(this);
   ISynchronizePageConfiguration configuration = getConfiguration();
   if (configuration != null) configuration.removePropertyChangeListener(this);
 }
  public CDOCheckoutStateManager getStateManager() {
    if (stateManager == null) {
      String viewerID = config.getService().getViewerId();
      CDOCheckoutContentProvider contentProvider = CDOCheckoutContentProvider.getInstance(viewerID);
      if (contentProvider != null) {
        stateManager = contentProvider.getStateManager();
      }
    }

    return stateManager;
  }
 /* (non-Javadoc)
  * @see org.eclipse.ui.navigator.ICommonContentProvider#init(org.eclipse.ui.navigator.ICommonContentExtensionSite)
  */
 public void init(ICommonContentExtensionSite site) {
   // Set the site
   this.site = site;
   // Configure the content provider based on the site and state model
   site.getExtensionStateModel().addPropertyChangeListener(this);
   ISynchronizePageConfiguration configuration = getConfiguration();
   if (configuration != null) configuration.addPropertyChangeListener(this);
   ITreeContentProvider provider = getDelegateContentProvider();
   if (provider instanceof ICommonContentProvider) {
     ((ICommonContentProvider) provider).init(site);
   }
   ISynchronizationContext context = getContext();
   if (context != null) context.getDiffTree().addDiffChangeListener(this);
 }
예제 #6
0
  public static void refreshContent(
      ICommonContentExtensionSite site, final Object elementOrTreePath) {
    final NavigatorContentService s = (NavigatorContentService) site.getService();

    sync(
        new Runnable() {
          public void run() {
            try {
              final CommonViewer viewer = (CommonViewer) s.getViewer();
              viewer.refresh(true);
              viewer.setExpandedState(elementOrTreePath, true);
            } catch (Exception e) {
            }
          }
        });
  }