本文整理汇总了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);
}
示例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));
}
}
示例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);
}
}
示例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;
}
}
示例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);
}
示例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);
}
示例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);
}
}
示例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;
}
示例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);
}
示例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();
}
示例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);
}
}
示例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);
}
}
示例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]);
}
示例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);
}
示例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));
}