/** * Initializes this action using the given bundle and prefix. * * @param bundle the resource bundle * @param prefix a prefix to be prepended to the various resource keys, or <code>null</code> if none * @since 2.1 */ protected void initialize(ResourceBundle bundle, String prefix) { String labelKey= "label"; //$NON-NLS-1$ String tooltipKey= "tooltip"; //$NON-NLS-1$ String imageKey= "image"; //$NON-NLS-1$ String descriptionKey= "description"; //$NON-NLS-1$ if (prefix != null && prefix.length() > 0) { labelKey= prefix + labelKey; tooltipKey= prefix + tooltipKey; imageKey= prefix + imageKey; descriptionKey= prefix + descriptionKey; } setText(getString(bundle, labelKey, labelKey)); setToolTipText(getString(bundle, tooltipKey, null)); setDescription(getString(bundle, descriptionKey, null)); String file= getString(bundle, imageKey, null); if (file != null && file.trim().length() > 0) setImageDescriptor(ImageDescriptor.createFromFile(getClass(), file)); } }
/** * Initializes this action using the given bundle and prefix. * * @param bundle the resource bundle * @param prefix a prefix to be prepended to the various resource keys, or <code>null</code> if none * @since 2.1 */ protected void initialize(ResourceBundle bundle, String prefix) { String labelKey= "label"; //$NON-NLS-1$ String tooltipKey= "tooltip"; //$NON-NLS-1$ String imageKey= "image"; //$NON-NLS-1$ String descriptionKey= "description"; //$NON-NLS-1$ if (prefix != null && prefix.length() > 0) { labelKey= prefix + labelKey; tooltipKey= prefix + tooltipKey; imageKey= prefix + imageKey; descriptionKey= prefix + descriptionKey; } setText(getString(bundle, labelKey, labelKey)); setToolTipText(getString(bundle, tooltipKey, null)); setDescription(getString(bundle, descriptionKey, null)); String file= getString(bundle, imageKey, null); if (file != null && file.trim().length() > 0) setImageDescriptor(ImageDescriptor.createFromFile(getClass(), file)); } }
/** * Initializes this action using the given bundle and prefix. * * @param bundle the resource bundle * @param prefix a prefix to be prepended to the various resource keys, or <code>null</code> if none * @since 2.1 */ protected void initialize(ResourceBundle bundle, String prefix) { String labelKey= "label"; //$NON-NLS-1$ String tooltipKey= "tooltip"; //$NON-NLS-1$ String imageKey= "image"; //$NON-NLS-1$ String descriptionKey= "description"; //$NON-NLS-1$ if (prefix != null && prefix.length() > 0) { labelKey= prefix + labelKey; tooltipKey= prefix + tooltipKey; imageKey= prefix + imageKey; descriptionKey= prefix + descriptionKey; } setText(getString(bundle, labelKey, labelKey)); setToolTipText(getString(bundle, tooltipKey, null)); setDescription(getString(bundle, descriptionKey, null)); String file= getString(bundle, imageKey, null); if (file != null && file.trim().length() > 0) setImageDescriptor(ImageDescriptor.createFromFile(getClass(), file)); } }
/** * */ private void createQuickOutlineAction() { // Quick Outline Action ResourceAction action = new TextOperationAction(getBundleForConstructedKeys(), "QuickOutline.", this, //$NON-NLS-1$ PDEProjectionViewer.QUICK_OUTLINE, true); action.setActionDefinitionId(PDEActionConstants.COMMAND_ID_QUICK_OUTLINE); action.setText(PDEUIMessages.PDESourcePage_actionTextQuickOutline); action.setId(PDEActionConstants.COMMAND_ID_QUICK_OUTLINE); action.setImageDescriptor(PDEPluginImages.DESC_OVERVIEW_OBJ); setAction(PDEActionConstants.COMMAND_ID_QUICK_OUTLINE, action); }