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


Java IStatusLineManager.setMessage方法代碼示例

本文整理匯總了Java中org.eclipse.jface.action.IStatusLineManager.setMessage方法的典型用法代碼示例。如果您正苦於以下問題:Java IStatusLineManager.setMessage方法的具體用法?Java IStatusLineManager.setMessage怎麽用?Java IStatusLineManager.setMessage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.jface.action.IStatusLineManager的用法示例。


在下文中一共展示了IStatusLineManager.setMessage方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setStatusLineMessage

import org.eclipse.jface.action.IStatusLineManager; //導入方法依賴的package包/類
/**
 * 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));
	}
}
 
開發者ID:tlaplus,項目名稱:tlaplus,代碼行數:32,代碼來源:UIHelper.java

示例2: createMessageReceiver

import org.eclipse.jface.action.IStatusLineManager; //導入方法依賴的package包/類
private IObjectReceiver<IGuiIconDescription> createMessageReceiver(final Composite composite) {
  final IActionBars bars = getViewSite().getActionBars();
  final Label messageLabel = createLabel(composite);
  final IStatusLineManager statusLineManager = bars.getStatusLineManager();
  return new IObjectReceiver<IGuiIconDescription>() {

    @Override
    public void set(final IGuiIconDescription description) {
      final String message = description == null
          ? "" //$NON-NLS-1$
          : description.getConstant().getName();
      messageLabel.setText(message);
      statusLineManager.setMessage(message);
    }
  };
}
 
開發者ID:AndreasWBartels,項目名稱:libraries,代碼行數:17,代碼來源:GuiIconsView.java

示例3: setActiveEditor

import org.eclipse.jface.action.IStatusLineManager; //導入方法依賴的package包/類
@Override
public void setActiveEditor(IEditorPart part) {
	super.setActiveEditor(part);

	IActionBars actionBars= getActionBars();
	IStatusLineManager manager= actionBars.getStatusLineManager();
	manager.setMessage(null);
	manager.setErrorMessage(null);

	ITextEditor textEditor= null;
	if (part instanceof ITextEditor)
		textEditor= (ITextEditor)part;

	actionBars.setGlobalActionHandler(JdtActionConstants.OPEN, getAction(textEditor, JdtActionConstants.OPEN));
	actionBars.setGlobalActionHandler("org.eclipse.jdt.internal.ui.actions.OpenHyperlink", getAction(textEditor, ITextEditorActionConstants.OPEN_HYPERLINK)); //$NON-NLS-1$
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion-Juno38,代碼行數:17,代碼來源:PropertiesFileEditorActionContributor.java

示例4: setStatusLineManager

import org.eclipse.jface.action.IStatusLineManager; //導入方法依賴的package包/類
/**
 * <!-- 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("");
		}
	}
}
 
開發者ID:polarsys,項目名稱:time4sys,代碼行數:34,代碼來源:Time4sysEditor.java

示例5: setStatusLineManager

import org.eclipse.jface.action.IStatusLineManager; //導入方法依賴的package包/類
/**
 * <!-- 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$
        }
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:42,代碼來源:VisualInterfaceEditor.java

示例6: setStatusLineManager

import org.eclipse.jface.action.IStatusLineManager; //導入方法依賴的package包/類
/**
 * <!-- 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$
        }
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:41,代碼來源:DeploymentEditor.java

示例7: setStatusLineManager

import org.eclipse.jface.action.IStatusLineManager; //導入方法依賴的package包/類
/**
 * <!-- 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 ( "" );
        }
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:41,代碼來源:MemoryEditor.java

示例8: setStatusLineManager

import org.eclipse.jface.action.IStatusLineManager; //導入方法依賴的package包/類
/**
 * <!-- 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("");
        }
    }
}
 
開發者ID:ObeoNetwork,項目名稱:M2Doc,代碼行數:37,代碼來源:GenconfEditor.java

示例9: setStatusLineManager

import org.eclipse.jface.action.IStatusLineManager; //導入方法依賴的package包/類
/**
 * <!-- 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("");
    }
  }
}
 
開發者ID:eclipse,項目名稱:triquetrum,代碼行數:33,代碼來源:TriqEditor.java

示例10: setStatusLineManager

import org.eclipse.jface.action.IStatusLineManager; //導入方法依賴的package包/類
/**
 * <!-- 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("");
		}
	}
}
 
開發者ID:cplutte,項目名稱:bts,代碼行數:35,代碼來源:BtsmodelEditor.java

示例11: setStatusLineManager

import org.eclipse.jface.action.IStatusLineManager; //導入方法依賴的package包/類
/**
 * <!-- 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("");
		}
	}
}
 
開發者ID:mondo-project,項目名稱:mondo-demo-wt,代碼行數:34,代碼來源:WTSpec4MEditor.java

示例12: contributeToStatusLine

import org.eclipse.jface.action.IStatusLineManager; //導入方法依賴的package包/類
@Override
public void contributeToStatusLine(IStatusLineManager statusLineManager) {
	super.contributeToStatusLine(statusLineManager);
	if (textEditorContributor != null)
		textEditorContributor.contributeToStatusLine(statusLineManager);

	statusLineManager.setMessage(""); //$NON-NLS-1$
}
 
開發者ID:OpenSoftwareSolutions,項目名稱:PDFReporter-Studio,代碼行數:9,代碼來源:JrctxEditorContributor.java

示例13: setStatusLineManager

import org.eclipse.jface.action.IStatusLineManager; //導入方法依賴的package包/類
/**
 * <!-- 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("");
        }
    }
}
 
開發者ID:Cooperate-Project,項目名稱:CooperateModelingEnvironment,代碼行數:34,代碼來源:TextualCommonsEditor.java

示例14: setStatusLineManager

import org.eclipse.jface.action.IStatusLineManager; //導入方法依賴的package包/類
/**
 * <!-- 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("");
		}
	}
}
 
開發者ID:logicalhacking,項目名稱:SecureBPMN,代碼行數:41,代碼來源:BpmnDiEditor.java

示例15: setMessage

import org.eclipse.jface.action.IStatusLineManager; //導入方法依賴的package包/類
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);
		}
	}
}
 
開發者ID:MulgaSoft,項目名稱:e4macs,代碼行數:10,代碼來源:EmacsPlusUtils.java


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