Java 类org.eclipse.ui.part.IShowInSource 实例源码

项目:PDFReporter-Studio    文件:LocalizationEditor.java   
@SuppressWarnings("rawtypes")
@Override
   public Object getAdapter(Class adapter) {
       if (IShowInSource.class == adapter) {
           return new IShowInSource() {
               public ShowInContext getShowInContext() {
                   ResourceBundleKey entry = getSelectedEntry();
                   if (entry == null) {
                       return null;
                   }
                   ResourceBundle bundle = entry.getParent().getBundle(
                           new Locale(""));
                   if (bundle == null) {
                       return null;
                   }
                   Object resource = bundle.getUnderlyingResource();
                   return new ShowInContext(resource, new StructuredSelection(
                           resource));
               }
           };
       }
       return super.getAdapter(adapter);
   }
项目:mytourbook    文件:LocalizationEditor.java   
@SuppressWarnings("unchecked")
@Override
public Object getAdapter(Class adapter) {
    if (IShowInSource.class == adapter) {
        return new IShowInSource() {
            public ShowInContext getShowInContext() {
                ResourceBundleKey entry = getSelectedEntry();
                if (entry == null)
                    return null;
                ResourceBundle bundle = entry.getParent().getBundle(new Locale(""));
                if (bundle == null)
                    return null;
                Object resource = bundle.getUnderlyingResource();
                return new ShowInContext(resource, new StructuredSelection(resource));
            }
        };
    }
    return super.getAdapter(adapter);
}
项目:mytourbook    文件:LocalizationEditor.java   
@SuppressWarnings("unchecked")
@Override
public Object getAdapter(Class adapter) {
    if (IShowInSource.class == adapter) {
        return new IShowInSource() {
            public ShowInContext getShowInContext() {
                ResourceBundleKey entry = getSelectedEntry();
                if (entry == null)
                    return null;
                ResourceBundle bundle = entry.getParent().getBundle(new Locale(""));
                if (bundle == null)
                    return null;
                Object resource = bundle.getUnderlyingResource();
                return new ShowInContext(resource, new StructuredSelection(resource));
            }
        };
    }
    return super.getAdapter(adapter);
}
项目:mytourbook    文件:LocalizationEditor.java   
@SuppressWarnings("unchecked")
@Override
public Object getAdapter(Class adapter) {
    if (IShowInSource.class == adapter) {
        return new IShowInSource() {
            public ShowInContext getShowInContext() {
                ResourceBundleKey entry = getSelectedEntry();
                if (entry == null)
                    return null;
                ResourceBundle bundle = entry.getParent().getBundle(new Locale(""));
                if (bundle == null)
                    return null;
                Object resource = bundle.getUnderlyingResource();
                return new ShowInContext(resource, new StructuredSelection(resource));
            }
        };
    }
    return super.getAdapter(adapter);
}
项目:Eclipse-Postfix-Code-Completion    文件:PackageExplorerPart.java   
@Override
public Object getAdapter(Class key) {
    if (key.equals(ISelectionProvider.class))
        return fViewer;
    if (key == IShowInSource.class) {
        return getShowInSource();
    }
    if (key == IShowInTargetList.class) {
        return new IShowInTargetList() {
            public String[] getShowInTargetIds() {
                return new String[] { JavaPlugin.ID_RES_NAV };
            }

        };
    }
    if (key == IContextProvider.class) {
        return JavaUIHelp.getHelpContextProvider(this, IJavaHelpContextIds.PACKAGES_VIEW);
    }
    return super.getAdapter(key);
}
项目:Eclipse-Postfix-Code-Completion    文件:CallHierarchyViewPart.java   
/**
 * {@inheritDoc}
 */
   @Override
public Object getAdapter(Class adapter) {
    if (adapter == IShowInSource.class) {
        return getShowInSource();
    }
    if (adapter == IContextProvider.class) {
        return JavaUIHelp.getHelpContextProvider(this, IJavaHelpContextIds.CALL_HIERARCHY_VIEW);
    }
    if (adapter == IShowInTargetList.class) {
        return new IShowInTargetList() {
            public String[] getShowInTargetIds() {
                return new String[] { JavaUI.ID_PACKAGES, JavaPlugin.ID_RES_NAV };
            }
        };
    }
    return super.getAdapter(adapter);
   }
项目:Eclipse-Postfix-Code-Completion    文件:JavaOutlinePage.java   
public Object getAdapter(Class key) {
    if (key == IShowInSource.class) {
        return getShowInSource();
    }
    if (key == IShowInTargetList.class) {
        return new IShowInTargetList() {
            public String[] getShowInTargetIds() {
                return new String[] { JavaUI.ID_PACKAGES };
            }

        };
    }
    if (key == IShowInTarget.class) {
        return getShowInTarget();
    }

    return null;
}
项目:Eclipse-Postfix-Code-Completion    文件:TypeHierarchyViewPart.java   
@Override
public Object getAdapter(Class key) {
    if (key == IShowInSource.class) {
        return getShowInSource();
    }
    if (key == IShowInTargetList.class) {
        return new IShowInTargetList() {
            public String[] getShowInTargetIds() {
                return new String[] { JavaUI.ID_PACKAGES, JavaPlugin.ID_RES_NAV  };
            }

        };
    }
    if (key == IContextProvider.class) {
        return JavaUIHelp.getHelpContextProvider(this, IJavaHelpContextIds.TYPE_HIERARCHY_VIEW);
    }
    return super.getAdapter(key);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:PackageExplorerPart.java   
@Override
public Object getAdapter(Class key) {
    if (key.equals(ISelectionProvider.class))
        return fViewer;
    if (key == IShowInSource.class) {
        return getShowInSource();
    }
    if (key == IShowInTargetList.class) {
        return new IShowInTargetList() {
            public String[] getShowInTargetIds() {
                return new String[] { JavaPlugin.ID_RES_NAV };
            }

        };
    }
    if (key == IContextProvider.class) {
        return JavaUIHelp.getHelpContextProvider(this, IJavaHelpContextIds.PACKAGES_VIEW);
    }
    return super.getAdapter(key);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:CallHierarchyViewPart.java   
/**
 * {@inheritDoc}
 */
   @Override
public Object getAdapter(Class adapter) {
    if (adapter == IShowInSource.class) {
        return getShowInSource();
    }
    if (adapter == IContextProvider.class) {
        return JavaUIHelp.getHelpContextProvider(this, IJavaHelpContextIds.CALL_HIERARCHY_VIEW);
    }
    if (adapter == IShowInTargetList.class) {
        return new IShowInTargetList() {
            public String[] getShowInTargetIds() {
                return new String[] { JavaUI.ID_PACKAGES, JavaPlugin.ID_RES_NAV };
            }
        };
    }
    return super.getAdapter(adapter);
   }
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:JavaOutlinePage.java   
public Object getAdapter(Class key) {
    if (key == IShowInSource.class) {
        return getShowInSource();
    }
    if (key == IShowInTargetList.class) {
        return new IShowInTargetList() {
            public String[] getShowInTargetIds() {
                return new String[] { JavaUI.ID_PACKAGES };
            }

        };
    }
    if (key == IShowInTarget.class) {
        return getShowInTarget();
    }

    return null;
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:TypeHierarchyViewPart.java   
@Override
public Object getAdapter(Class key) {
    if (key == IShowInSource.class) {
        return getShowInSource();
    }
    if (key == IShowInTargetList.class) {
        return new IShowInTargetList() {
            public String[] getShowInTargetIds() {
                return new String[] { JavaUI.ID_PACKAGES, JavaPlugin.ID_RES_NAV  };
            }

        };
    }
    if (key == IContextProvider.class) {
        return JavaUIHelp.getHelpContextProvider(this, IJavaHelpContextIds.TYPE_HIERARCHY_VIEW);
    }
    return super.getAdapter(key);
}
项目:mesfavoris    文件:BookmarksView.java   
@Override
public Object getAdapter(Class adapter) {
    if (adapter == IPropertySheetPage.class) {
        propertyPage = new PropertySheetPage();
        return propertyPage;
    }
    if (adapter == IShowInSource.class) {
        return new IShowInSource() {
            public ShowInContext getShowInContext() {
                return new ShowInContext(null, bookmarksTreeViewer.getSelection());
            }
        };
    }
    return super.getAdapter(adapter);
}
项目:typescript.java    文件:TypeScriptSearchResultPage.java   
public Object getAdapter(Class adapter) {
    if (IShowInTargetList.class.equals(adapter)) {
        return SHOW_IN_TARGET_LIST;
    }

    if (adapter == IShowInSource.class) {
        ISelectionProvider selectionProvider= getSite().getSelectionProvider();
        if (selectionProvider == null)
            return null;

        ISelection selection= selectionProvider.getSelection();
        if (selection instanceof IStructuredSelection) {
            IStructuredSelection structuredSelection= ((StructuredSelection)selection);
            final Set newSelection= new HashSet(structuredSelection.size());
            Iterator iter= structuredSelection.iterator();
            while (iter.hasNext()) {
                Object element= iter.next();
                if (element instanceof LineElement)
                    element= ((LineElement)element).getParent();
                newSelection.add(element);
            }

            return new IShowInSource() {
                public ShowInContext getShowInContext() {
                    return new ShowInContext(null, new StructuredSelection(new ArrayList(newSelection)));
                }
            };
        }
        return null;
    }

    return null;
}
项目:jdepend4eclipse    文件:PackageTreeView.java   
@Override
public Object getAdapter(Class adapter) {
    if (adapter.equals(ISelectionProvider.class)) {
        return treeSelectionHandler;
    }
    if (adapter == IShowInSource.class) {
        return this;
    }
    return super.getAdapter(adapter);
}
项目:Eclipse-Postfix-Code-Completion    文件:PackageExplorerPart.java   
/**
 * Returns the <code>IShowInSource</code> for this view.
 * @return the <code>IShowInSource</code>
 */
protected IShowInSource getShowInSource() {
    return new IShowInSource() {
        public ShowInContext getShowInContext() {
            return new ShowInContext(
                getTreeViewer().getInput(),
                getTreeViewer().getSelection());
        }
    };
}
项目:Eclipse-Postfix-Code-Completion    文件:CallHierarchyViewPart.java   
/**
 * @return the <code>IShowInSource</code> for this view.
 */
private IShowInSource getShowInSource() {
    return new IShowInSource() {
        public ShowInContext getShowInContext() {
            return new ShowInContext(null, fSelectionProviderMediator.getSelection());
        }
    };
}
项目:Eclipse-Postfix-Code-Completion    文件:JavaOutlinePage.java   
/**
 * Returns the <code>IShowInSource</code> for this view.
 *
 * @return the {@link IShowInSource}
 */
protected IShowInSource getShowInSource() {
    return new IShowInSource() {
        public ShowInContext getShowInContext() {
            return new ShowInContext(
                null,
                getSite().getSelectionProvider().getSelection());
        }
    };
}
项目:Eclipse-Postfix-Code-Completion    文件:TypeHierarchyViewPart.java   
/**
 * @return Returns the <code>IShowInSource</code> for this view.
 */
protected IShowInSource getShowInSource() {
    return new IShowInSource() {
        public ShowInContext getShowInContext() {
            return new ShowInContext(
                null,
            getSite().getSelectionProvider().getSelection());
        }
    };
}
项目:Eclipse-Postfix-Code-Completion    文件:JavaBrowsingPart.java   
@Override
public Object getAdapter(Class key) {
    if (key == IShowInSource.class) {
        return getShowInSource();
    }
    if (key == IContextProvider.class)
        return JavaUIHelp.getHelpContextProvider(this, getHelpContextId());

    return super.getAdapter(key);
}
项目:Eclipse-Postfix-Code-Completion    文件:JavaBrowsingPart.java   
/**
 * Returns the <code>IShowInSource</code> for this view.
 * @return returns the <code>IShowInSource</code>
 */
protected IShowInSource getShowInSource() {
    return new IShowInSource() {
        public ShowInContext getShowInContext() {
            return new ShowInContext(
                null,
            getSite().getSelectionProvider().getSelection());
        }
    };
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:PackageExplorerPart.java   
/**
 * Returns the <code>IShowInSource</code> for this view.
 * @return the <code>IShowInSource</code>
 */
protected IShowInSource getShowInSource() {
    return new IShowInSource() {
        public ShowInContext getShowInContext() {
            return new ShowInContext(
                getTreeViewer().getInput(),
                getTreeViewer().getSelection());
        }
    };
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:CallHierarchyViewPart.java   
/**
 * @return the <code>IShowInSource</code> for this view.
 */
private IShowInSource getShowInSource() {
    return new IShowInSource() {
        public ShowInContext getShowInContext() {
            return new ShowInContext(null, fSelectionProviderMediator.getSelection());
        }
    };
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:JavaOutlinePage.java   
/**
 * Returns the <code>IShowInSource</code> for this view.
 *
 * @return the {@link IShowInSource}
 */
protected IShowInSource getShowInSource() {
    return new IShowInSource() {
        public ShowInContext getShowInContext() {
            return new ShowInContext(
                null,
                getSite().getSelectionProvider().getSelection());
        }
    };
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:TypeHierarchyViewPart.java   
/**
 * @return Returns the <code>IShowInSource</code> for this view.
 */
protected IShowInSource getShowInSource() {
    return new IShowInSource() {
        public ShowInContext getShowInContext() {
            return new ShowInContext(
                null,
            getSite().getSelectionProvider().getSelection());
        }
    };
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:JavaBrowsingPart.java   
@Override
public Object getAdapter(Class key) {
    if (key == IShowInSource.class) {
        return getShowInSource();
    }
    if (key == IContextProvider.class)
        return JavaUIHelp.getHelpContextProvider(this, getHelpContextId());

    return super.getAdapter(key);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:JavaBrowsingPart.java   
/**
 * Returns the <code>IShowInSource</code> for this view.
 * @return returns the <code>IShowInSource</code>
 */
protected IShowInSource getShowInSource() {
    return new IShowInSource() {
        public ShowInContext getShowInContext() {
            return new ShowInContext(
                null,
            getSite().getSelectionProvider().getSelection());
        }
    };
}
项目:Pydev    文件:AbstractSearchIndexResultPage.java   
public Object getAdapter(Class<?> adapter) {
    if (IShowInTargetList.class.equals(adapter)) {
        return SHOW_IN_TARGET_LIST;
    }

    if (adapter == IShowInSource.class) {
        ISelectionProvider selectionProvider = getSite().getSelectionProvider();
        if (selectionProvider == null) {
            return null;
        }

        ISelection selection = selectionProvider.getSelection();
        if (selection instanceof IStructuredSelection) {
            IStructuredSelection structuredSelection = ((StructuredSelection) selection);
            final Set<Object> newSelection = new HashSet<>(structuredSelection.size());
            Iterator<?> iter = structuredSelection.iterator();
            while (iter.hasNext()) {
                Object element = iter.next();
                if (element instanceof ICustomLineElement) {
                    element = ((ICustomLineElement) element).getParent();
                }
                newSelection.add(element);
            }

            return new IShowInSource() {
                @Override
                public ShowInContext getShowInContext() {
                    return new ShowInContext(null, new StructuredSelection(new ArrayList<>(newSelection)));
                }
            };
        }
        return null;
    }

    return null;
}