org.eclipse.jface.action.IStatusLineManager Java Examples

The following examples show how to use org.eclipse.jface.action.IStatusLineManager. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CommonTextEditorActionContributor.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void contributeToStatusLine(IStatusLineManager statusLineManager) {
	commandsMenuContributionItem = new CommandsMenuContributionItem();
	statusLineManager.add(commandsMenuContributionItem);
	super.contributeToStatusLine(statusLineManager);

	inputPositionStatsContributionItem = new StatusLineContributionItem(ITextEditorActionConstants.STATUS_CATEGORY_INPUT_POSITION, true, 24);
	IContributionItem[] contributionItems = statusLineManager.getItems();
	for (IContributionItem contributionItem : contributionItems) {
		String id = contributionItem.getId();

		if (ITextEditorActionConstants.STATUS_CATEGORY_INPUT_POSITION.equals(id)) {
			statusLineManager.remove(contributionItem);
			statusLineManager.add(inputPositionStatsContributionItem);
		}
	}
}
 
Example #2
Source File: FindHelper.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
private static IWorkbenchPage getActivePage(IStatusLineManager statusLineManager)
{

	IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();

	if (window == null)
	{
		if (statusLineManager != null)
		{
			statusLineManager.setErrorMessage(Messages.FindHelper_Error_workbench_window_null);
		}
		return null;
	}
	IWorkbenchPage activePage = window.getActivePage();
	if (activePage == null)
	{
		if (statusLineManager != null)
		{
			statusLineManager.setErrorMessage(Messages.FindHelper_Error_active_page_null);
		}
	}

	return activePage;
}
 
Example #3
Source File: StatusLineMessageTimerManager.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
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;
}
 
Example #4
Source File: ActiveDocument.java    From eclipse-encoding-plugin with Eclipse Public License 1.0 6 votes vote down vote up
private void setMessage(String imageIconKey, String message, Object... args) {
	IStatusLineManager statusLineManager = null;
	if (editor == null) {
		WorkbenchWindow window = (WorkbenchWindow) PlatformUI.getWorkbench().getActiveWorkbenchWindow();
		statusLineManager = window.getActionBars().getStatusLineManager();
	} else {
		statusLineManager = editor.getEditorSite().getActionBars().getStatusLineManager();
	}
	if (statusLineManager != null) {
		if (message == null) {
			statusLineManager.setMessage(null);
		} else {
			statusLineManager.setMessage(Activator.getImage(imageIconKey), format(message, args));
		}
	}
}
 
Example #5
Source File: UIHelper.java    From tlaplus with MIT License 6 votes vote down vote up
/**
 * Tries to set the given message on the workbench's status line. This is a
 * best effort method which fails to set the status line if there is no
 * active editor present from where the statuslinemanager can be looked up.
 * 
 * @param msg
 *            The message to be shown on the status line
 */
public static void setStatusLineMessage(final String msg) {
	IStatusLineManager statusLineManager = null;
	ISelectionProvider selectionService = null;

	// First try to get the StatusLineManager from the IViewPart and only
	// resort back to the editor if a view isn't active right now.
	final IWorkbenchPart workbenchPart = getActiveWindow().getActivePage().getActivePart();
	if (workbenchPart instanceof IViewPart) {
		final IViewPart viewPart = (IViewPart) workbenchPart;
		statusLineManager = viewPart.getViewSite().getActionBars().getStatusLineManager();
		selectionService = viewPart.getViewSite().getSelectionProvider();
	} else if (getActiveEditor() != null) {
		final IEditorSite editorSite = getActiveEditor().getEditorSite();
		statusLineManager = editorSite.getActionBars().getStatusLineManager();
		selectionService = editorSite.getSelectionProvider();
	}

	if (statusLineManager != null && selectionService != null) {
		statusLineManager.setMessage(msg);
		selectionService.addSelectionChangedListener(new StatusLineMessageEraser(statusLineManager,
				selectionService));
	}
}
 
Example #6
Source File: TLAMultiPageEditorActionBarContributor.java    From tlaplus with MIT License 6 votes vote down vote up
public void contributeToStatusLine(IStatusLineManager statusLineManager)
{
    if (this.activeEditor instanceof ITextEditor)
    {
        if (statusLineManager.find(cursorPositionStatusField.getId()) == null)
        {
            // add the cursor position if not already there
            statusLineManager.add(cursorPositionStatusField);
        }
    } else
    {
        // remove cursor position if the active editor is not a text editor
        statusLineManager.remove(cursorPositionStatusField);
    }
    // must update to show changes in UI
    statusLineManager.update(true);
}
 
Example #7
Source File: SecurityEditor.java    From neoscada with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setStatusLineManager ( ISelection selection )
{
    IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ?
            contentOutlineStatusLineManager : getActionBars ().getStatusLineManager ();

    if ( statusLineManager != null )
    {
        if ( selection instanceof IStructuredSelection )
        {
            Collection<?> collection = ( (IStructuredSelection)selection ).toList ();
            switch ( collection.size () )
            {
                case 0:
                {
                    statusLineManager.setMessage ( getString ( "_UI_NoObjectSelected" ) ); //$NON-NLS-1$
                    break;
                }
                case 1:
                {
                    String text = new AdapterFactoryItemDelegator ( adapterFactory ).getText ( collection.iterator ().next () );
                    statusLineManager.setMessage ( getString ( "_UI_SingleObjectSelected", text ) ); //$NON-NLS-1$
                    break;
                }
                default:
                {
                    statusLineManager.setMessage ( getString ( "_UI_MultiObjectSelected", Integer.toString ( collection.size () ) ) ); //$NON-NLS-1$
                    break;
                }
            }
        }
        else
        {
            statusLineManager.setMessage ( "" ); //$NON-NLS-1$
        }
    }
}
 
Example #8
Source File: ConfigurationEditor.java    From neoscada with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setStatusLineManager ( ISelection selection )
{
    IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ?
            contentOutlineStatusLineManager : getActionBars ().getStatusLineManager ();

    if ( statusLineManager != null )
    {
        if ( selection instanceof IStructuredSelection )
        {
            Collection<?> collection = ( (IStructuredSelection)selection ).toList ();
            switch ( collection.size () )
            {
                case 0:
                {
                    statusLineManager.setMessage ( getString ( "_UI_NoObjectSelected" ) ); //$NON-NLS-1$
                    break;
                }
                case 1:
                {
                    String text = new AdapterFactoryItemDelegator ( adapterFactory ).getText ( collection.iterator ().next () );
                    statusLineManager.setMessage ( getString ( "_UI_SingleObjectSelected", text ) ); //$NON-NLS-1$
                    break;
                }
                default:
                {
                    statusLineManager.setMessage ( getString ( "_UI_MultiObjectSelected", Integer.toString ( collection.size () ) ) ); //$NON-NLS-1$
                    break;
                }
            }
        }
        else
        {
            statusLineManager.setMessage ( "" ); //$NON-NLS-1$
        }
    }
}
 
Example #9
Source File: ItemEditor.java    From neoscada with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setStatusLineManager ( ISelection selection )
{
    IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ?
            contentOutlineStatusLineManager : getActionBars ().getStatusLineManager ();

    if ( statusLineManager != null )
    {
        if ( selection instanceof IStructuredSelection )
        {
            Collection<?> collection = ( (IStructuredSelection)selection ).toList ();
            switch ( collection.size () )
            {
                case 0:
                {
                    statusLineManager.setMessage ( getString ( "_UI_NoObjectSelected" ) ); //$NON-NLS-1$
                    break;
                }
                case 1:
                {
                    String text = new AdapterFactoryItemDelegator ( adapterFactory ).getText ( collection.iterator ().next () );
                    statusLineManager.setMessage ( getString ( "_UI_SingleObjectSelected", text ) ); //$NON-NLS-1$
                    break;
                }
                default:
                {
                    statusLineManager.setMessage ( getString ( "_UI_MultiObjectSelected", Integer.toString ( collection.size () ) ) ); //$NON-NLS-1$
                    break;
                }
            }
        }
        else
        {
            statusLineManager.setMessage ( "" ); //$NON-NLS-1$
        }
    }
}
 
Example #10
Source File: EmacsPlusUtils.java    From e4macs with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Returns the status line manager of the workbench part.
 * 
 * @param part an IEditorPart or IViewPart
 * 
 * @return the status line manager of the part
 */
public synchronized static IStatusLineManager getStatusLineManager(IWorkbenchPart part){
	IStatusLineManager result = null;
	if (part instanceof IEditorPart) {
		return ((IEditorPart)part).getEditorSite().getActionBars().getStatusLineManager();
	} else if (part instanceof IViewPart) {
		return ((IViewPart)part).getViewSite().getActionBars().getStatusLineManager();
	} 
	return result;
}
 
Example #11
Source File: ComponentEditor.java    From neoscada with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setStatusLineManager ( ISelection selection )
{
    IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ? contentOutlineStatusLineManager : getActionBars ().getStatusLineManager ();

    if ( statusLineManager != null )
    {
        if ( selection instanceof IStructuredSelection )
        {
            Collection<?> collection = ( (IStructuredSelection)selection ).toList ();
            switch ( collection.size () )
            {
                case 0:
                {
                    statusLineManager.setMessage ( getString ( "_UI_NoObjectSelected" ) ); //$NON-NLS-1$
                    break;
                }
                case 1:
                {
                    String text = new AdapterFactoryItemDelegator ( adapterFactory ).getText ( collection.iterator ().next () );
                    statusLineManager.setMessage ( getString ( "_UI_SingleObjectSelected", text ) ); //$NON-NLS-1$
                    break;
                }
                default:
                {
                    statusLineManager.setMessage ( getString ( "_UI_MultiObjectSelected", Integer.toString ( collection.size () ) ) ); //$NON-NLS-1$
                    break;
                }
            }
        }
        else
        {
            statusLineManager.setMessage ( "" ); //$NON-NLS-1$
        }
    }
}
 
Example #12
Source File: GlobalizeEditor.java    From neoscada with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setStatusLineManager ( ISelection selection )
{
    IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ? contentOutlineStatusLineManager : getActionBars ().getStatusLineManager ();

    if ( statusLineManager != null )
    {
        if ( selection instanceof IStructuredSelection )
        {
            Collection<?> collection = ( (IStructuredSelection)selection ).toList ();
            switch ( collection.size () )
            {
                case 0:
                {
                    statusLineManager.setMessage ( getString ( "_UI_NoObjectSelected" ) ); //$NON-NLS-1$
                    break;
                }
                case 1:
                {
                    String text = new AdapterFactoryItemDelegator ( adapterFactory ).getText ( collection.iterator ().next () );
                    statusLineManager.setMessage ( getString ( "_UI_SingleObjectSelected", text ) ); //$NON-NLS-1$
                    break;
                }
                default:
                {
                    statusLineManager.setMessage ( getString ( "_UI_MultiObjectSelected", Integer.toString ( collection.size () ) ) ); //$NON-NLS-1$
                    break;
                }
            }
        }
        else
        {
            statusLineManager.setMessage ( "" ); //$NON-NLS-1$
        }
    }
}
 
Example #13
Source File: WorkbenchUtils.java    From xds-ide with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Remove any message set by us from the right statusline.
 */
public static void clearStatusLine() {
    IStatusLineManager statusLine = getStatusLine();
    if (statusLine != null) {
        statusLine.setErrorMessage(null);
        statusLine.setMessage(null);
        statusLine = null;
    }
}
 
Example #14
Source File: OfflineActionTarget.java    From Pydev with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Creates an instance of an incremental find target.
 * @param viewer the text viewer to operate on
 * @param manager the status line manager for output
 */
public OfflineActionTarget(ITextViewer viewer, IStatusLineManager manager, PyEdit edit) {
    Assert.isNotNull(viewer);
    Assert.isNotNull(manager);
    fTextViewer = viewer;
    fStatusLine = manager;
    fEdit = edit;
}
 
Example #15
Source File: OsgiEditor.java    From neoscada with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setStatusLineManager ( ISelection selection )
{
    IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ? contentOutlineStatusLineManager : getActionBars ().getStatusLineManager ();

    if ( statusLineManager != null )
    {
        if ( selection instanceof IStructuredSelection )
        {
            Collection<?> collection = ( (IStructuredSelection)selection ).toList ();
            switch ( collection.size () )
            {
                case 0:
                {
                    statusLineManager.setMessage ( getString ( "_UI_NoObjectSelected" ) ); //$NON-NLS-1$
                    break;
                }
                case 1:
                {
                    String text = new AdapterFactoryItemDelegator ( adapterFactory ).getText ( collection.iterator ().next () );
                    statusLineManager.setMessage ( getString ( "_UI_SingleObjectSelected", text ) ); //$NON-NLS-1$
                    break;
                }
                default:
                {
                    statusLineManager.setMessage ( getString ( "_UI_MultiObjectSelected", Integer.toString ( collection.size () ) ) ); //$NON-NLS-1$
                    break;
                }
            }
        }
        else
        {
            statusLineManager.setMessage ( "" ); //$NON-NLS-1$
        }
    }
}
 
Example #16
Source File: AnnotationEditorActionContributor.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
/**
 * Contributes the status item to the status line.
 *
 * @param statusLineManager the status line manager
 */
@Override
public void contributeToStatusLine(IStatusLineManager statusLineManager) {
  super.contributeToStatusLine(statusLineManager);

  mStatusLineModeItem = new StatusLineContributionItem(ID);

  mStatusLineModeItem.setVisible(true);

  statusLineManager.add(mStatusLineModeItem);
}
 
Example #17
Source File: AnnotationStyleViewPage.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
@Override
public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager,
        IStatusLineManager statusLineManager) {
  super.makeContributions(menuManager, toolBarManager, statusLineManager);
  
  // TODO: Figure out how to use open properties dialog action here correctly
  // see http://wiki.eclipse.org/FAQ_How_do_I_open_a_Property_dialog%3F
  
  IAction action = new Action() {
    @Override
    public void run() {
      super.run();
      
      ISelection sel = new StructuredSelection(new AnnotationTypeNode(editor, null));
      PropertyPage page = new EditorAnnotationPropertyPage();
      page.setElement(new AnnotationTypeNode(editor, null));
      page.setTitle("Styles");
      PreferenceManager mgr = new PreferenceManager();
      IPreferenceNode node = new PreferenceNode("1", page);
      mgr.addToRoot(node);
      PropertyDialog dialog = new PropertyDialog(getSite().getShell(), mgr, sel);
      dialog.create();
      dialog.setMessage(page.getTitle());
      dialog.open();
    }
  };
  
  action.setImageDescriptor(CasEditorPlugin
          .getTaeImageDescriptor(Images.MODEL_PROCESSOR_FOLDER));
  
  toolBarManager.add(action);
}
 
Example #18
Source File: SetupEditor.java    From neoscada with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setStatusLineManager ( ISelection selection )
{
    IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ? contentOutlineStatusLineManager : getActionBars ().getStatusLineManager ();

    if ( statusLineManager != null )
    {
        if ( selection instanceof IStructuredSelection )
        {
            Collection<?> collection = ( (IStructuredSelection)selection ).toList ();
            switch ( collection.size () )
            {
                case 0:
                {
                    statusLineManager.setMessage ( getString ( "_UI_NoObjectSelected" ) ); //$NON-NLS-1$
                    break;
                }
                case 1:
                {
                    String text = new AdapterFactoryItemDelegator ( adapterFactory ).getText ( collection.iterator ().next () );
                    statusLineManager.setMessage ( getString ( "_UI_SingleObjectSelected", text ) ); //$NON-NLS-1$
                    break;
                }
                default:
                {
                    statusLineManager.setMessage ( getString ( "_UI_MultiObjectSelected", Integer.toString ( collection.size () ) ) ); //$NON-NLS-1$
                    break;
                }
            }
        }
        else
        {
            statusLineManager.setMessage ( "" ); //$NON-NLS-1$
        }
    }
}
 
Example #19
Source File: EmacsPlusUtils.java    From e4macs with Eclipse Public License 1.0 5 votes vote down vote up
private static void setMessage(IWorkbenchPart editor, String key){
	if (!KbdMacroSupport.getInstance().suppressMessages()) {
		IStatusLineManager ism = getStatusLineManager(editor); 
		if (ism != null) {
			ism.setMessage(EmacsPlusActivator.getResourceString(key));
			forceUpdate(ism);
		}
	}
}
 
Example #20
Source File: GenconfEditor.java    From M2Doc with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * 
 * @generated
 */
public void setStatusLineManager(ISelection selection) {
    IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer
            ? contentOutlineStatusLineManager
            : getActionBars().getStatusLineManager();

    if (statusLineManager != null) {
        if (selection instanceof IStructuredSelection) {
            Collection<?> collection = ((IStructuredSelection) selection).toList();
            switch (collection.size()) {
                case 0: {
                    statusLineManager.setMessage(getString("_UI_NoObjectSelected"));
                    break;
                }
                case 1: {
                    String text = new AdapterFactoryItemDelegator(adapterFactory)
                            .getText(collection.iterator().next());
                    statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text));
                    break;
                }
                default: {
                    statusLineManager
                            .setMessage(getString("_UI_MultiObjectSelected", Integer.toString(collection.size())));
                    break;
                }
            }
        } else {
            statusLineManager.setMessage("");
        }
    }
}
 
Example #21
Source File: BeansEditor.java    From hybris-commerce-eclipse-plugin with Apache License 2.0 5 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setStatusLineManager(ISelection selection) {
	IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ?
		contentOutlineStatusLineManager : getActionBars().getStatusLineManager();

	if (statusLineManager != null) {
		if (selection instanceof IStructuredSelection) {
			Collection<?> collection = ((IStructuredSelection)selection).toList();
			switch (collection.size()) {
				case 0: {
					statusLineManager.setMessage(getString("_UI_NoObjectSelected"));
					break;
				}
				case 1: {
					String text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next());
					statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text));
					break;
				}
				default: {
					statusLineManager.setMessage(getString("_UI_MultiObjectSelected", Integer.toString(collection.size())));
					break;
				}
			}
		}
		else {
			statusLineManager.setMessage("");
		}
	}
}
 
Example #22
Source File: XLIFFEditorImplWithNatTable.java    From tmxeditor8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 返回与此编辑器相关的进度监视器。
 * @return 与此编辑器相关的进度监视器
 */
protected IProgressMonitor getProgressMonitor() {
	IProgressMonitor pm = null;
	IStatusLineManager manager = getStatusLineManager();
	if (manager != null)
		pm = manager.getProgressMonitor();
	return pm != null ? pm : new NullProgressMonitor();
}
 
Example #23
Source File: PyEdit.java    From Pydev with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * @return an outline view
 */
@Override
@SuppressWarnings("rawtypes")
public Object getAdapter(Class adapter) {
    if (OfflineActionTarget.class.equals(adapter)) {
        if (fOfflineActionTarget == null) {
            IStatusLineManager manager = getStatusLineManager();
            if (manager != null) {
                fOfflineActionTarget = (getSourceViewer() == null ? null
                        : new OfflineActionTarget(
                                getSourceViewer(), manager, this));
            }
        }
        return fOfflineActionTarget;
    }

    if (IProject.class.equals(adapter)) {
        return this.getProject();
    }

    if (ICodeScannerKeywords.class.equals(adapter)) {
        return new PyEditBasedCodeScannerKeywords(this);
    }

    if (IContentOutlinePage.class.equals(adapter)) {
        return getOutlinePage();
    } else {

        Object adaptable = this.onGetAdapter.call(adapter);
        if (adaptable != null) {
            return adaptable;
        }

        return super.getAdapter(adapter);
    }
}
 
Example #24
Source File: TimeChartView.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void createPartControl(Composite parent) {
    super.createPartControl(parent);
    fViewer = new TimeGraphViewer(parent, SWT.NONE);
    fPresentationProvider = new TimeChartAnalysisProvider();
    fViewer.setTimeGraphProvider(fPresentationProvider);
    fViewer.addTimeListener(this);
    fViewer.addRangeListener(this);
    fViewer.addSelectionListener(this);
    fViewer.setMinimumItemWidth(1);
    fViewer.getTimeGraphControl().setBlendSubPixelEvents(true);

    IStatusLineManager statusLineManager = getViewSite().getActionBars().getStatusLineManager();
    fViewer.getTimeGraphControl().setStatusLineManager(statusLineManager);

    for (ITmfTrace trace : TmfTraceManager.getInstance().getOpenedTraces()) {
        IFile bookmarksFile = TmfTraceManager.getInstance().getTraceEditorFile(trace);
        TimeChartAnalysisEntry timeAnalysisEntry = new TimeChartAnalysisEntry(trace, fDisplayWidth * 2);
        fTimeAnalysisEntries.add(timeAnalysisEntry);
        fDecorationProviders.put(trace, new TimeChartDecorationProvider(bookmarksFile));
        startProcessTraceThread(timeAnalysisEntry);
    }
    fViewer.setInput(fTimeAnalysisEntries.toArray(new TimeChartAnalysisEntry[0]));

    ColorSettingsManager.addColorSettingsListener(this);
    ResourcesPlugin.getWorkspace().addResourceChangeListener(this, IResourceChangeEvent.POST_CHANGE);

    updateTimeFormat();
}
 
Example #25
Source File: TimeGraphControl.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * Assign the status line manager
 *
 * @param statusLineManager
 *            The status line manager, or null to disable status line messages
 */
public void setStatusLineManager(IStatusLineManager statusLineManager) {
    if (fStatusLineManager != null && statusLineManager == null) {
        fStatusLineManager.setMessage(""); //$NON-NLS-1$
    }
    fStatusLineManager = statusLineManager;
}
 
Example #26
Source File: TmfEventsEditor.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
private void createAndInitializeTable() {
    if (fTrace != null) {
        fEventsTable = createEventsTable(fParent, fTrace.getCacheSize());
        fEventsTable.registerContextMenus(getSite());
        fEventsTable.addSelectionChangedListener(this);
        fEventsTable.setTrace(fTrace, true);
        fEventsTable.refreshBookmarks(fFile);
        loadState();

        /* ensure start time is set */
        final ITmfContext context = fTrace.seekEvent(0);
        fTrace.getNext(context);
        context.dispose();

        broadcast(new TmfTraceOpenedSignal(this, fTrace, fFile));
        if (fTraceSelected) {
            broadcast(new TmfTraceSelectedSignal(this, fTrace));
        }

        /* update part name only after trace manager notified */
        setPartName(TmfTraceManager.getInstance().getTraceUniqueName(fTrace));

        /* go to marker after trace opened */
        if (fPendingGotoMarker != null) {
            fEventsTable.gotoMarker(fPendingGotoMarker);
            fPendingGotoMarker = null;
        }
    } else {
        fEventsTable = new TmfEventsTable(fParent, 0);
        fEventsTable.addSelectionChangedListener(this);
    }
    IStatusLineManager statusLineManager = getEditorSite().getActionBars().getStatusLineManager();
    fEventsTable.setStatusLineManager(statusLineManager);
}
 
Example #27
Source File: TmfXYChartViewer.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * Set the status bar manager
 *
 * @param statusLineManager
 *            Status bar manager
 */
public void setStatusLineManager(IStatusLineManager statusLineManager) {
    if (fStatusLineManager != null && statusLineManager == null) {
        fStatusLineManager.setMessage(null);
    }
    fStatusLineManager = statusLineManager;
}
 
Example #28
Source File: ImageViewerEditor.java    From eclipse-extras with Eclipse Public License 1.0 5 votes vote down vote up
private IProgressMonitor getProgressMonitor() {
  IProgressMonitor monitor = null;
  IStatusLineManager manager = getEditorSite().getActionBars().getStatusLineManager();
  if( manager != null ) {
    monitor = manager.getProgressMonitor();
  }
  return monitor != null ? monitor : new NullProgressMonitor();
}
 
Example #29
Source File: FindHelper.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
/**
 * The active editor's project is used as the search scope
 */
public static void findInWorkspace(final String searchText, final boolean caseSensitive, final boolean wholeWord,
		final boolean isRegEx, IStatusLineManager statusLineManager)
{
	if (getActivePage(statusLineManager) == null)
	{
		return;
	}

	performFind(searchText, caseSensitive, isRegEx, FileTextSearchScope.newSearchScope(
			new IResource[] { ResourcesPlugin.getWorkspace().getRoot() }, new String[] { "*" }, true)); //$NON-NLS-1$
}
 
Example #30
Source File: FindOccurrencesInFileAction.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
private static void showMessage(Shell shell, IActionBars actionBars, String msg) {
	if (actionBars != null) {
		IStatusLineManager statusLine= actionBars.getStatusLineManager();
		if (statusLine != null)
			statusLine.setMessage(msg);
	}
	shell.getDisplay().beep();
}