本文整理汇总了Java中org.eclipse.ui.IViewSite类的典型用法代码示例。如果您正苦于以下问题:Java IViewSite类的具体用法?Java IViewSite怎么用?Java IViewSite使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IViewSite类属于org.eclipse.ui包,在下文中一共展示了IViewSite类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import org.eclipse.ui.IViewSite; //导入依赖的package包/类
@Override
public void init ( final IViewSite site, final IMemento memento ) throws PartInitException
{
if ( memento != null )
{
this.connectionId = memento.getString ( CONNECTION_ID );
this.connectionUri = memento.getString ( CONNECTION_URI );
}
super.init ( site, memento );
try
{
// it is OK to fail at this stage
reInitializeConnection ( this.connectionId, this.connectionUri );
}
catch ( final Exception e )
{
logger.warn ( "init () - couldn't recreate connection", e ); //$NON-NLS-1$
// just reset all values
this.connectionId = null;
this.connectionUri = null;
this.connectionService = null;
this.connectionTracker = null;
}
}
示例2: initialize
import org.eclipse.ui.IViewSite; //导入依赖的package包/类
@Override
public void initialize(final ISynchronizePageConfiguration configuration) {
super.initialize(configuration);
site = configuration.getSite();
final IWorkbenchSite ws = site.getWorkbenchSite();
if (ws instanceof IViewSite) {
this.configuration = configuration;
final Shell shell = site.getShell();
customCompareAction = new ExternalCompareAction(shell);
undoAction = new UndoPendingChangeAction(shell);
getLatestAction = new GetLatestAction(shell);
getSpecificAction = new GetSpecificAction(shell);
checkoutAction = new CheckoutAction(shell);
undoAction = new UndoPendingChangeAction(shell);
checkinAction = new CheckinAction(shell);
historyAction = new ViewHistoryAction(shell);
} else {
this.configuration = null;
}
}
示例3: getStatusLineManager
import org.eclipse.ui.IViewSite; //导入依赖的package包/类
private IStatusLineManager getStatusLineManager() {
IWorkbench wb = PlatformUI.getWorkbench();
IWorkbenchWindow win = wb.getActiveWorkbenchWindow();
IWorkbenchPage page = win.getActivePage();
IWorkbenchPart part = page.getActivePart();
if (part == null)
return null;
IWorkbenchPartSite site = part.getSite();
IActionBars actionBars = null;
if (site instanceof IEditorSite)
actionBars = ((IEditorSite) site).getActionBars();
else if (site instanceof IViewSite)
actionBars = ((IViewSite) site).getActionBars();
if (actionBars == null)
return null;
return actionBars.getStatusLineManager();
}
示例4: getStatusLineManager
import org.eclipse.ui.IViewSite; //导入依赖的package包/类
private IStatusLineManager getStatusLineManager() {
IWorkbench wb = PlatformUI.getWorkbench();
IWorkbenchWindow win = wb.getActiveWorkbenchWindow();
IWorkbenchPage page = win.getActivePage();
if (page == null)
return null;
IWorkbenchPart part = page.getActivePart();
if (part == null)
return null;
IWorkbenchPartSite site = part.getSite();
IActionBars actionBars = null;
if (site instanceof IEditorSite)
actionBars = ((IEditorSite) site).getActionBars();
else if (site instanceof IViewSite)
actionBars = ((IViewSite) site).getActionBars();
if (actionBars == null)
return null;
return actionBars.getStatusLineManager();
}
示例5: init
import org.eclipse.ui.IViewSite; //导入依赖的package包/类
@Override
public void init(IPageBookViewPage page, IConsole console) {
IPageSite pageSite = page.getSite();
IWorkbenchPage workbenchPage = pageSite.getPage();
IViewPart viewPart = workbenchPage.findView(IConsoleConstants.ID_CONSOLE_VIEW);
IViewSite viewSite = viewPart.getViewSite();
IActionBars actionBars = viewSite.getActionBars();
IToolBarManager toolBarManager = actionBars.getToolBarManager();
IContributionItem[] items = toolBarManager.getItems();
for(int i = 0; i < items.length; ++i) {
IContributionItem item = items[i];
if(item instanceof ActionContributionItem) {
IAction action = ((ActionContributionItem) item).getAction();
String text = action.getText();
if(text.equals("Pi&n Console") || text.equals("Open Console"))
toolBarManager.remove(item);
}
}
}
示例6: getStatusLineManager
import org.eclipse.ui.IViewSite; //导入依赖的package包/类
static IStatusLineManager getStatusLineManager()
{
try
{
IWorkbenchPartSite site = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
.getActivePart().getSite();
return ((IViewSite) site).getActionBars().getStatusLineManager();
}
catch (Exception e)
{
// try to get the IStatusLineManager through an active editor
try
{
return PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()
.getEditorSite().getActionBars().getStatusLineManager();
}
catch (Exception e1)
{
}
}
return null;
}
示例7: init
import org.eclipse.ui.IViewSite; //导入依赖的package包/类
@Override
public void init(IViewSite site) throws PartInitException {
super.init(site);
ZooKeeperActivator plugin = ZooKeeperActivator.getDefault();
plugin.getZooKeeperConnectionModelManager().getModels();
}
示例8: init
import org.eclipse.ui.IViewSite; //导入依赖的package包/类
@Override
public void init(IViewSite site) throws PartInitException {
super.init(site);
JmxActivator plugin = JmxActivator.getDefault();
plugin.getJmxConnectionModelManager().getModels();
}
示例9: hookContextMenu
import org.eclipse.ui.IViewSite; //导入依赖的package包/类
private void hookContextMenu ( final IViewSite viewSite )
{
final MenuManager menuMgr = new MenuManager ( "#PopupMenu" ); //$NON-NLS-1$
menuMgr.setRemoveAllWhenShown ( true );
menuMgr.addMenuListener ( new IMenuListener () {
@Override
public void menuAboutToShow ( final IMenuManager manager )
{
fillContextMenu ( manager );
}
} );
final Menu menu = menuMgr.createContextMenu ( this.viewer.getControl () );
this.viewer.getControl ().setMenu ( menu );
viewSite.registerContextMenu ( menuMgr, this.viewer );
}
示例10: init
import org.eclipse.ui.IViewSite; //导入依赖的package包/类
@Override
public void init ( final IViewSite site, final IMemento memento ) throws PartInitException
{
super.init ( site, memento );
if ( memento == null )
{
return;
}
final IMemento child = memento.getChild ( CHILD_CONFIGURATION );
if ( child == null )
{
return;
}
final String data = child.getTextData ();
if ( data == null || data.isEmpty () )
{
return;
}
try
{
this.configuration = load ( new ByteArrayInputStream ( Base64.decodeBase64 ( data ) ) );
}
catch ( final Exception e )
{
StatusManager.getManager ().handle ( StatusHelper.convertStatus ( Activator.PLUGIN_ID, e ), StatusManager.LOG );
}
}
示例11: init
import org.eclipse.ui.IViewSite; //导入依赖的package包/类
@Override
public void init ( final IViewSite site, final IMemento memento ) throws PartInitException
{
super.init ( site, memento );
if ( memento != null )
{
final String s = memento.getString ( "columnSettings" ); //$NON-NLS-1$
if ( s != null )
{
this.initialColumnSettings = this.gson.fromJson ( s, new TypeToken<List<ColumnProperties>> () {}.getType () );
}
}
}
示例12: MonitorsViewTable
import org.eclipse.ui.IViewSite; //导入依赖的package包/类
public MonitorsViewTable ( final Composite parent, final IViewSite viewSite, final int style, final WritableSet monitors, final List<ColumnProperties> columnSettings )
{
super ( parent, style );
this.monitors = monitors;
final FillLayout layout = new FillLayout ();
setLayout ( layout );
this.tableViewer = new TableViewer ( this, SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.MULTI );
this.tableRef.set ( this.tableViewer );
createColumns ( this.tableViewer );
applyColumSettings ( columnSettings );
this.tableViewer.getTable ().setHeaderVisible ( true );
this.tableViewer.getTable ().setLinesVisible ( true );
this.tableViewer.setUseHashlookup ( true );
this.tableViewer.setSorter ( new Sorter ( Columns.LAST_FAIL_TIMESTAMP, SWT.DOWN ) );
this.tableViewer.getTable ().setSortDirection ( SWT.DOWN );
hookContextMenu ( this.tableViewer.getControl (), this.tableViewer, viewSite );
viewSite.setSelectionProvider ( this.tableViewer );
final ObservableSetContentProvider contentProvider = new ObservableSetContentProvider ();
this.tableViewer.setContentProvider ( contentProvider );
this.tableViewer.setLabelProvider ( new MonitorTableLabelProvider ( Properties.observeEach ( contentProvider.getKnownElements (), BeanProperties.values ( new String[] { "id", "monitor" } ) ), Settings.getTimeZone () ) ); //$NON-NLS-1$ //$NON-NLS-2$
this.tableViewer.setInput ( this.monitors );
contentProvider.getRealizedElements ().addSetChangeListener ( new ISetChangeListener () {
@Override
public void handleSetChange ( final SetChangeEvent event )
{
if ( !MonitorsViewTable.this.scrollLock )
{
MonitorsViewTable.this.tableViewer.getTable ().setTopIndex ( 0 );
}
}
} );
}
示例13: hookContextMenu
import org.eclipse.ui.IViewSite; //导入依赖的package包/类
protected void hookContextMenu ( final Control control, final ISelectionProvider selectionProvider, final IViewSite viewSite )
{
final MenuManager menuMgr = new MenuManager ( "#PopupMenu" ); //$NON-NLS-1$
menuMgr.setRemoveAllWhenShown ( true );
menuMgr.addMenuListener ( new IMenuListener () {
@Override
public void menuAboutToShow ( final IMenuManager manager )
{
fillContextMenu ( manager );
}
} );
final Menu menu = menuMgr.createContextMenu ( control );
control.setMenu ( menu );
viewSite.registerContextMenu ( menuMgr, selectionProvider );
}
示例14: createActions
import org.eclipse.ui.IViewSite; //导入依赖的package包/类
/**
* Actions in addition to the standard plotting actions which
* should be shown on the plot.
*
* @param site
*/
private void createActions(IViewSite site) {
IActionBars bars = site.getActionBars();
final List<IContributionManager> mans = Arrays.asList(bars.getToolBarManager(), bars.getMenuManager());
final IAction configureAxes = new Action("Configure...", Activator.getImageDescriptor("icons/home-for-sale-sign-blue.png")) {
@Override
public void run() {
try {
IModelDialog<AxisConfiguration> dialog = ServiceHolder.getInterfaceService().createModelDialog(site.getShell());
dialog.setPreamble("Please define the axes and their ranges we will map within.");
dialog.create();
dialog.setSize(550,450); // As needed
dialog.setText("Scan Area");
dialog.setModel(getAxisConfiguration());
int ok = dialog.open();
if (ok==IModelDialog.OK) {
AxisConfiguration conf = dialog.getModel();
setAxisConfiguration(conf);
}
} catch (Exception ne) {
ErrorDialog.openError(site.getShell(), "Error Showing Plot Configuration", "Please contact your support representative.", new Status(IStatus.ERROR, "org.eclipse.scanning.device.ui", ne.getMessage(), ne));
logger.error("Cannot configure plot!", ne);
}
}
};
ViewUtil.addGroups("configure", mans, configureAxes);
}
示例15: init
import org.eclipse.ui.IViewSite; //导入依赖的package包/类
@Override
public void init(IViewSite site, IMemento memento) throws PartInitException {
super.init(site, memento);
if (stash.isStashed()) {
try {
final List<IScanPathModel> models = stash.unstash(List.class);
setPath(models);
} catch (Exception e) {
logger.error("Cannot load generators to memento!", e);
}
}
}