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


Java WorkbenchMessages类代码示例

本文整理汇总了Java中org.eclipse.ui.internal.WorkbenchMessages的典型用法代码示例。如果您正苦于以下问题:Java WorkbenchMessages类的具体用法?Java WorkbenchMessages怎么用?Java WorkbenchMessages使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: CustomAboutDialog

import org.eclipse.ui.internal.WorkbenchMessages; //导入依赖的package包/类
/**
 * Create an instance of the AboutDialog for the given window.
 * 
 * @param parentShell
 *            The parent of the dialog.
 */
public CustomAboutDialog(Shell parentShell) {
	super(parentShell);
	this.parentShell = parentShell;
	setShellStyle(SWT.CLOSE | SWT.APPLICATION_MODAL | SWT.WRAP);
	product = Platform.getProduct();

	if (product != null) {
		productName = product.getName();
	}
	if (productName == null) {
		productName = WorkbenchMessages.AboutDialog_defaultProductName;
	}

	// setDialogHelpAvailable(true);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:22,代码来源:CustomAboutDialog.java

示例2: storeDialog

import org.eclipse.ui.internal.WorkbenchMessages; //导入依赖的package包/类
/**
 * Stores dialog settings.
 *
 * @param settings
 *            settings used to store dialog
 */
protected void storeDialog(IDialogSettings settings) {
	settings.put(SHOW_STATUS_LINE, toggleStatusLineAction.isChecked());

	XMLMemento memento = XMLMemento.createWriteRoot(HISTORY_SETTINGS);
	this.contentProvider.saveHistory(memento);
	StringWriter writer = new StringWriter();
	try {
		memento.save(writer);
		settings.put(HISTORY_SETTINGS, writer.getBuffer().toString());
	} catch (IOException e) {
		// Simply don't store the settings
		StatusManager
				.getManager()
				.handle(
						new Status(
								IStatus.ERROR,
								PlatformUI.PLUGIN_ID,
								IStatus.ERROR,
								WorkbenchMessages.FilteredItemsSelectionDialog_storeError,
								e));
	}
}
 
开发者ID:tlaplus,项目名称:tlaplus,代码行数:29,代码来源:FilteredItemsSelectionDialog.java

示例3: fillContextMenu

import org.eclipse.ui.internal.WorkbenchMessages; //导入依赖的package包/类
/**
    * Hook that allows to add actions to the context menu.
 * <p>
 * Subclasses may extend in order to add other actions.</p>
    *
    * @param menuManager the context menu manager
    * @since 3.5
    */
protected void fillContextMenu(IMenuManager menuManager) {
	List selectedElements= ((StructuredSelection)list.getSelection()).toList();

	Object item= null;

	for (Iterator it= selectedElements.iterator(); it.hasNext();) {
		item= it.next();
		if (item instanceof ItemsListSeparator || !isHistoryElement(item)) {
			return;
		}
	}

	if (selectedElements.size() > 0) {
		removeHistoryItemAction.setText(WorkbenchMessages.FilteredItemsSelectionDialog_removeItemsFromHistoryAction);

		menuManager.add(removeHistoryActionContributionItem);

	}
}
 
开发者ID:tlaplus,项目名称:tlaplus,代码行数:28,代码来源:FilteredItemsSelectionDialog.java

示例4: refreshDetails

import org.eclipse.ui.internal.WorkbenchMessages; //导入依赖的package包/类
/**
 * Refreshes the details field according to the current selection in the
 * items list.
 */
private void refreshDetails() {
	StructuredSelection selection = getSelectedItems();

	switch (selection.size()) {
	case 0:
		details.setInput(null);
		break;
	case 1:
		details.setInput(selection.getFirstElement());
		break;
	default:
		details
				.setInput(NLS
						.bind(
								WorkbenchMessages.FilteredItemsSelectionDialog_nItemsSelected,
								new Integer(selection.size())));
		break;
	}

}
 
开发者ID:tlaplus,项目名称:tlaplus,代码行数:25,代码来源:FilteredItemsSelectionDialog.java

示例5: updateOKStatus

import org.eclipse.ui.internal.WorkbenchMessages; //导入依赖的package包/类
/**
 * @see org.eclipse.ui.dialogs.ElementTreeSelectionDialog#updateOKStatus()
 */
@SuppressWarnings("restriction")
@Override
protected void updateOKStatus() {
    Status status;

    if (validate()) {
        status = new Status(IStatus.OK, PlatformUI.PLUGIN_ID, IStatus.OK, UICoreConstant.EMPTY_STRING, null);
    } else {
        status = new Status(IStatus.ERROR,
            PlatformUI.PLUGIN_ID,
            IStatus.ERROR,
            WorkbenchMessages.ElementTreeSelectionDialog_nothing_available,
            null);
    }

    updateStatus(status);
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:21,代码来源:MergeClassDialog.java

示例6: updateStatus

import org.eclipse.ui.internal.WorkbenchMessages; //导入依赖的package包/类
/**
 * updateStatus
 *   void
 */
protected void updateStatus() {
    Status status;

    if (validate()) {
        status = new Status(IStatus.OK, PlatformUI.PLUGIN_ID, IStatus.OK, UICoreConstant.EMPTY_STRING, null);
    } else {
        status = new Status(IStatus.ERROR,
            PlatformUI.PLUGIN_ID,
            IStatus.ERROR,
            WorkbenchMessages.ElementTreeSelectionDialog_nothing_available,
            null);
    }

    updateStatus(status);
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:20,代码来源:MergeUsecaseDialog.java

示例7: ProjectSelectionDialog

import org.eclipse.ui.internal.WorkbenchMessages; //导入依赖的package包/类
public ProjectSelectionDialog(Shell parentShell, Object input,
		IStructuredContentProvider contentProvider,
		ILabelProvider labelProvider, String message, String unifiedDiff) {
	super(parentShell);
	this.unifiedDiff = unifiedDiff;
	featureController.getFeatures(VariantSyncPlugin.getDefault()
			.getSupportProjectList());
	setTitle(WorkbenchMessages.ListSelection_title);
	inputElement = input;
	projectSelectionDiaglog = this;
	this.projectContentProvider = contentProvider;
	this.featureContentProvider = new FeatureListViewerContentProvider();
	this.projectLabelProvider = labelProvider;
	this.featureLabelProvider = new LabelProvider();
	if (message != null) {
		setMessage(message);
	} else {
		setMessage(WorkbenchMessages.ListSelection_message);
	}
}
 
开发者ID:1Tristan,项目名称:VariantSync,代码行数:21,代码来源:ProjectSelectionDialog.java

示例8: create

import org.eclipse.ui.internal.WorkbenchMessages; //导入依赖的package包/类
public IWorkbenchAction create(IWorkbenchWindow window) {
	if (window == null) {
		throw new IllegalArgumentException();
	}
	RetargetAction action = new RetargetAction(getId(),
			WorkbenchMessages.Workbench_copy);
	action.setToolTipText(WorkbenchMessages.Workbench_copyToolTip);
	window.getPartService().addPartListener(action);
	action.setActionDefinitionId(getCommandId());
	ISharedImages sharedImages = window.getWorkbench()
			.getSharedImages();
	action.setImageDescriptor(sharedImages
			.getImageDescriptor(ISharedImages.IMG_TOOL_COPY));
	action.setDisabledImageDescriptor(sharedImages
			.getImageDescriptor(ISharedImages.IMG_TOOL_COPY_DISABLED));
	return action;
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:18,代码来源:ActionFactory.java

示例9: createControl

import org.eclipse.ui.internal.WorkbenchMessages; //导入依赖的package包/类
@Override
protected void createControl(Composite parent, int styles) {
  super.createControl(parent, styles);
  final StyledText styledText = getTextWidget();

  IMenuListener menuListener = new IMenuListener() {
    @Override
    public void menuAboutToShow(IMenuManager menu) {
      Action copyAction = createAction(ITextOperationTarget.COPY, IWorkbenchCommandConstants.EDIT_COPY);
      copyAction.setText(WorkbenchMessages.Workbench_copy);
      copyAction.setToolTipText(WorkbenchMessages.Workbench_copyToolTip);
      ISharedImages sharedImages = AppUtils.getActiveWorkbenchWindow().getWorkbench().getSharedImages();
      copyAction.setImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_COPY));
      copyAction.setDisabledImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_COPY_DISABLED));
      menu.add(copyAction);
    }
  };

  MenuManager manager = new MenuManager(CONTEXT_MENU_ID, CONTEXT_MENU_ID);
  manager.setRemoveAllWhenShown(true);
  Menu contextMenu = manager.createContextMenu(styledText);
  styledText.setMenu(contextMenu);
  manager.addMenuListener(menuListener);
}
 
开发者ID:agusevas,项目名称:logan,代码行数:25,代码来源:SearchResultViewer.java

示例10: handlePluginInfoPressed

import org.eclipse.ui.internal.WorkbenchMessages; //导入依赖的package包/类
/**
 * The Plugins button was pressed. Open an about dialog on the plugins for
 * the selected feature.
 */
private void handlePluginInfoPressed() {
	final TableItem[] items = table.getSelection();
	if (items.length <= 0) {
		return;
	}

	final AboutBundleGroupData info = (AboutBundleGroupData) items[0]
	        .getData();
	final IBundleGroup bundleGroup = info.getBundleGroup();
	final Bundle[] bundles = bundleGroup == null ? new Bundle[0]
	        : bundleGroup.getBundles();

	final AboutPluginsDialog d = new AboutPluginsDialog(getShell(),
	        getProductName(), bundles,
	        WorkbenchMessages.AboutFeaturesDialog_pluginInfoTitle,
	        NLS.bind(
	                WorkbenchMessages.AboutFeaturesDialog_pluginInfoMessage,
	                bundleGroup.getIdentifier()),
	        IWorkbenchHelpContextIds.ABOUT_FEATURES_PLUGINS_DIALOG);
	d.open();
}
 
开发者ID:aktion-hip,项目名称:relations,代码行数:26,代码来源:AboutFeaturesPage.java

示例11: updateInfoArea

import org.eclipse.ui.internal.WorkbenchMessages; //导入依赖的package包/类
/**
 * Update the info area
 */
private void updateInfoArea(AboutBundleGroupData info) {
	if (info == null) {
		imageLabel.setImage(null);
		text.setText(""); //$NON-NLS-1$
		return;
	}

	final ImageDescriptor desc = info.getFeatureImage();
	Image image = (Image) cachedImages.get(desc);
	if (image == null && desc != null) {
		image = desc.createImage();
		cachedImages.put(desc, image);
	}
	imageLabel.setImage(image);

	final String aboutText = info.getAboutText();
	textManager.setItem(null);
	if (aboutText != null) {
		textManager.setItem(AboutUtils.scan(aboutText));
	}

	if (textManager.getItem() == null) {
		text.setText(WorkbenchMessages.AboutFeaturesDialog_noInformation);
	}
}
 
开发者ID:aktion-hip,项目名称:relations,代码行数:29,代码来源:AboutFeaturesPage.java

示例12: handleMoreInfoPressed

import org.eclipse.ui.internal.WorkbenchMessages; //导入依赖的package包/类
/**
 * The More Info button was pressed. Open a browser with the license for the
 * selected item or an information dialog if there is no license, or the
 * browser cannot be opened.
 */
private void handleMoreInfoPressed() {
	final TableItem[] items = table.getSelection();
	if (items.length <= 0) {
		return;
	}

	final AboutBundleGroupData info = (AboutBundleGroupData) items[0]
	        .getData();
	if (info == null
	        || !AboutUtils.openBrowser(getShell(), info.getLicenseUrl())) {
		MessageDialog.openInformation(getShell(),
		        WorkbenchMessages.AboutFeaturesDialog_noInfoTitle,
		        WorkbenchMessages.AboutFeaturesDialog_noInformation);
	}
}
 
开发者ID:aktion-hip,项目名称:relations,代码行数:21,代码来源:AboutFeaturesPage.java

示例13: AboutDialog

import org.eclipse.ui.internal.WorkbenchMessages; //导入依赖的package包/类
/**
 * @param shell
 */
public AboutDialog(Shell shell) {
	super(shell);

	product = Platform.getProduct();
	if (product != null) {
		productName = product.getName();
	}
	if (productName == null) {
		productName = WorkbenchMessages.AboutDialog_defaultProductName;
	}

	// create a descriptive object for each BundleGroup
	final IBundleGroupProvider[] providers = Platform.getBundleGroupProviders();
	final LinkedList<AboutBundleGroupData> groups = new LinkedList<AboutBundleGroupData>();
	if (providers != null) {
		for (final IBundleGroupProvider provider : providers) {
			final IBundleGroup[] bundleGroups = provider.getBundleGroups();
			for (final IBundleGroup bundleGroup : bundleGroups) {
				groups.add(new AboutBundleGroupData(bundleGroup));
			}
		}
	}
	bundleGroupInfos = groups.toArray(new AboutBundleGroupData[0]);
}
 
开发者ID:aktion-hip,项目名称:relations,代码行数:28,代码来源:AboutDialog.java

示例14: AboutFeaturesDialog

import org.eclipse.ui.internal.WorkbenchMessages; //导入依赖的package包/类
/**
 * Constructor for AboutFeaturesDialog.
 *
 * @param parentShell
 *            the parent shell
 * @param productName
 *            the product name
 * @param bundleGroupInfos
 *            the bundle info
 */
public AboutFeaturesDialog(Shell parentShell, String productName,
        AboutBundleGroupData[] bundleGroupInfos,
        AboutBundleGroupData initialSelection) {
	super(parentShell);
	final AboutFeaturesPage page = new AboutFeaturesPage();
	page.setProductName(productName);
	page.setBundleGroupInfos(bundleGroupInfos);
	page.setInitialSelection(initialSelection);
	String title;
	if (productName != null) {
		title = NLS.bind(WorkbenchMessages.AboutFeaturesDialog_shellTitle,
		        productName);
	} else {
		title = WorkbenchMessages.AboutFeaturesDialog_SimpleTitle;
	}
	initializeDialog(page, title,
	        IWorkbenchHelpContextIds.ABOUT_FEATURES_DIALOG);
}
 
开发者ID:aktion-hip,项目名称:relations,代码行数:29,代码来源:AboutFeaturesDialog.java

示例15: configureShell

import org.eclipse.ui.internal.WorkbenchMessages; //导入依赖的package包/类
@Override
protected void configureShell(Shell newShell) {
	super.configureShell(newShell);
	String productName = ""; //$NON-NLS-1$
	IProduct product = Platform.getProduct();
	if (product != null && product.getName() != null)
		productName = product.getName();
	newShell.setText(NLS.bind(
			WorkbenchMessages.InstallationDialog_ShellTitle, productName));
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:11,代码来源:HydrographInstallationDialog.java


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