當前位置: 首頁>>代碼示例>>Java>>正文


Java IViewSite類代碼示例

本文整理匯總了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;
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:26,代碼來源:AbstractAlarmsEventsView.java

示例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;
    }
}
 
開發者ID:Microsoft,項目名稱:team-explorer-everywhere,代碼行數:27,代碼來源:SynchronizeActionGroup.java

示例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();
}
 
開發者ID:OpenSoftwareSolutions,項目名稱:PDFReporter-Studio,代碼行數:20,代碼來源:ASPropertyWidget.java

示例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();
}
 
開發者ID:OpenSoftwareSolutions,項目名稱:PDFReporter-Studio,代碼行數:22,代碼來源:ADataInput.java

示例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);
		}
	}
}
 
開發者ID:AlexWengh,項目名稱:HMM,代碼行數:20,代碼來源:ConsolePageParticipant.java

示例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;
}
 
開發者ID:apicloudcom,項目名稱:APICloud-Studio,代碼行數:23,代碼來源:StatusLineMessageTimerManager.java

示例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();
}
 
開發者ID:baloise,項目名稱:eZooKeeper,代碼行數:8,代碼來源:ZooKeeperExplorerView.java

示例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();
}
 
開發者ID:baloise,項目名稱:eZooKeeper,代碼行數:8,代碼來源:JmxExplorerView.java

示例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 );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:16,代碼來源:InformationViewPart.java

示例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 );
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:32,代碼來源:ChartView.java

示例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 () );
        }
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:15,代碼來源:EventPoolView.java

示例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 );
            }
        }
    } );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:40,代碼來源:MonitorsViewTable.java

示例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 );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:16,代碼來源:MonitorsViewTable.java

示例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);
}
 
開發者ID:eclipse,項目名稱:scanning,代碼行數:37,代碼來源:PlottingController.java

示例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);
		}
	}
}
 
開發者ID:eclipse,項目名稱:scanning,代碼行數:15,代碼來源:ScanView.java


注:本文中的org.eclipse.ui.IViewSite類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。