当前位置: 首页>>代码示例>>Java>>正文


Java IPerspectiveDescriptor.getLabel方法代码示例

本文整理汇总了Java中org.eclipse.ui.IPerspectiveDescriptor.getLabel方法的典型用法代码示例。如果您正苦于以下问题:Java IPerspectiveDescriptor.getLabel方法的具体用法?Java IPerspectiveDescriptor.getLabel怎么用?Java IPerspectiveDescriptor.getLabel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.ui.IPerspectiveDescriptor的用法示例。


在下文中一共展示了IPerspectiveDescriptor.getLabel方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: OpenPerspectiveAction

import org.eclipse.ui.IPerspectiveDescriptor; //导入方法依赖的package包/类
/**
 * Create a new action for opening a perspective
 * 
 * @param perspectiveDescriptor
 *            the perspective to be opened
 */
OpenPerspectiveAction(IPerspectiveDescriptor perspectiveDescriptor, String name, String icon){
	super(perspectiveDescriptor.getLabel());
	
	setId(perspectiveDescriptor.getId());
	if (!StringTool.isNothing(icon)) {
		setImageDescriptor(perspectiveDescriptor.getImageDescriptor());
	} else {
		
		setImageDescriptor(perspectiveDescriptor.getImageDescriptor());
	}
	
	setToolTipText((StringTool.isNothing(name) ? perspectiveDescriptor.getLabel() : name)
		+ Messages.ApplicationActionBarAdvisor_10);
	
	this.perspectiveDescriptor = perspectiveDescriptor;
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:23,代码来源:ApplicationActionBarAdvisor.java

示例2: computeTitle

import org.eclipse.ui.IPerspectiveDescriptor; //导入方法依赖的package包/类
private String computeTitle()
{
  IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
  IWorkbenchPage currentPage = configurer.getWindow().getActivePage();
  IEditorPart activeEditor = null;
  if (currentPage != null)
  {
    activeEditor = lastActiveEditor;
  }

  String title = null;
  IProduct product = Platform.getProduct();
  if (product != null)
  {
    title = product.getName();
  }
  if (title == null)
  {
    title = ""; //$NON-NLS-1$
  }

  if (currentPage != null)
  {
    if (activeEditor != null)
    {
      lastEditorTitle = activeEditor.getTitleToolTip();
      title =
          NLS.bind(IDEWorkbenchMessages.WorkbenchWindow_shellTitle,
              lastEditorTitle, title);
    }
    IPerspectiveDescriptor persp = currentPage.getPerspective();
    String label = ""; //$NON-NLS-1$
    if (persp != null)
    {
      label = persp.getLabel();
    }
    IAdaptable input = currentPage.getInput();
    if (input != null && !input.equals(wbAdvisor.getDefaultPageInput()))
    {
      label = currentPage.getLabel();
    }
    if (label != null && !label.equals(""))
    { //$NON-NLS-1$
      title =
          NLS.bind(IDEWorkbenchMessages.WorkbenchWindow_shellTitle, label,
              title);
    }
  }

  String workspaceLocation = wbAdvisor.getWorkspaceLocation();
  if (workspaceLocation != null)
  {
    title =
        NLS.bind(IDEWorkbenchMessages.WorkbenchWindow_shellTitle, title,
            workspaceLocation);
  }

  // Bug 284447: Prepend workspace name to the title
  String workspaceName =
      IDEWorkbenchPlugin.getDefault().getPreferenceStore().getString(
          IDEInternalPreferences.WORKSPACE_NAME);
  if (workspaceName != null && workspaceName.length() > 0)
  {
    title =
        NLS.bind(IDEWorkbenchMessages.WorkbenchWindow_shellTitle,
            workspaceName, title);
  }

  return title;
}
 
开发者ID:debrief,项目名称:limpet,代码行数:71,代码来源:ApplicationWorkbenchWindowAdvisor.java

示例3: computeTitle

import org.eclipse.ui.IPerspectiveDescriptor; //导入方法依赖的package包/类
private String computeTitle() {

		final IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
		final IWorkbenchPage currentPage = configurer.getWindow().getActivePage();
		IWorkbenchPart activePart = null;

		if (currentPage != null) {
			activePart = currentPage.getActivePart();
		}

//		String title = null;
//		final IProduct product = Platform.getProduct();
//		if (product != null) {
//			title = product.getName() + " - " + ApplicationVersion.APP_VERSION; //$NON-NLS-1$
//		}
//		if (title == null) {
//			title = UI.EMPTY_STRING;
//		}

		String title = _appTitle;

		if (currentPage != null) {

			final String shellTitle = Messages.App_Window_Title;

			if (activePart != null) {
				_lastPartTitle = activePart.getTitleToolTip();
				if (_lastPartTitle != null) {
					if (_lastPartTitle.length() > 0) {
						title = NLS.bind(shellTitle, _lastPartTitle, title);
					}
				}
			}

			String label = UI.EMPTY_STRING;

			final IPerspectiveDescriptor persp = currentPage.getPerspective();
			if (persp != null) {
				label = persp.getLabel();
			}

			final IAdaptable input = currentPage.getInput();
			if ((input != null) && !input.equals(_wbAdvisor.getDefaultPageInput())) {
				label = currentPage.getLabel();
			}

			if ((label != null) && !label.equals(UI.EMPTY_STRING)) {
				title = NLS.bind(shellTitle, label, title);
			}
		}

		return title;
	}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:54,代码来源:ApplicationWorkbenchWindowAdvisor.java


注:本文中的org.eclipse.ui.IPerspectiveDescriptor.getLabel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。