public AddFromHistoryDialog(Shell parent, ResourceBundle bundle) { super(parent, bundle); String iconName= Utilities.getString(fBundle, "dateIcon", "obj16/day_obj.png"); //$NON-NLS-2$ //$NON-NLS-1$ ImageDescriptor id= CompareUIPlugin.getImageDescriptor(iconName); if (id != null) fDateImage= id.createImage(); iconName= Utilities.getString(fBundle, "timeIcon", "obj16/resource_obj.png"); //$NON-NLS-1$ //$NON-NLS-2$ id= CompareUIPlugin.getImageDescriptor(iconName); if (id != null) fTimeImage= id.createImage(); }
private static Image getHunkOverlayImage(Image baseImage, LocalResourceManager imageCache, String path, boolean onLeft) { ImageDescriptor desc = new DiffImageDescriptor(baseImage, CompareUIPlugin.getImageDescriptor(path), ICompareUIConstants.COMPARE_IMAGE_WIDTH, onLeft); Image image = imageCache.createImage(desc); return image; }
public static Image getHunkErrorImage(Image baseImage, LocalResourceManager imageCache, boolean onLeft) { ImageDescriptor desc = new DiffImage(baseImage, CompareUIPlugin.getImageDescriptor(ICompareUIConstants.ERROR_OVERLAY), ICompareUIConstants.COMPARE_IMAGE_WIDTH, onLeft); Image image = imageCache.createImage(desc); return image; }
public AddFromHistoryDialog(Shell parent, ResourceBundle bundle) { super(parent, bundle); String iconName= Utilities.getString(fBundle, "dateIcon", "obj16/day_obj.gif"); //$NON-NLS-2$ //$NON-NLS-1$ ImageDescriptor id= CompareUIPlugin.getImageDescriptor(iconName); if (id != null) fDateImage= id.createImage(); iconName= Utilities.getString(fBundle, "timeIcon", "obj16/resource_obj.gif"); //$NON-NLS-1$ //$NON-NLS-2$ id= CompareUIPlugin.getImageDescriptor(iconName); if (id != null) fTimeImage= id.createImage(); }
/** * Returns the title image which will be used in the compare editor's title bar. * Returns the title image which will be used when presenting the compare result. * This implementation returns a generic compare icon. * Subclasses can override. * * @return the title image, or <code>null</code> if none */ public Image getTitleImage() { if (fgTitleImage == null) { fgTitleImage= CompareUIPlugin.getImageDescriptor(COMPARE_EDITOR_IMAGE_NAME).createImage(); CompareUI.disposeOnShutdown(fgTitleImage); } return fgTitleImage; }
/** * Returns the title image which will be used in the compare editor's title bar. * Returns the title image which will be used when presenting the compare result. * This implementation returns a generic compare icon. * Subclasses can override. * * @return the title image, or <code>null</code> if none */ public Image getTitleImage() { if (fgTitleImage == null) { fgTitleImage= CompareUIPlugin.getImageDescriptor(COMPARE_EDITOR_IMAGE_NAME).createImage(); CompareUI.disposeOnShutdown(fgTitleImage); } return fgTitleImage; }
/** * Returns an image for identifying the edition side of a compare viewer. * This implementation extracts the value for the key "editionLabel" from the resource bundle * and passes it as the format argument to <code>MessageFormat.format</code>. * The single format argument for <code>MessageFormat.format</code> ("{0}" in the format string) * is the formatted modification date of the given input element. * <p> * Subclasses may override to create their own label. * </p> * * @param selectedEdition the selected edition for which a label must be returned * @param item if a path has been specified in <code>selectEdition</code> a sub element of the given selectedEdition; otherwise the same as selectedEdition * @return a label the edition side of a compare viewer * @since 2.0 */ protected Image getEditionImage(ITypedElement selectedEdition, ITypedElement item) { if (selectedEdition instanceof ResourceNode) return selectedEdition.getImage(); if (selectedEdition instanceof HistoryItem) { if (fTimeImage == null) { String iconName= Utilities.getString(fBundle, "timeIcon", "obj16/resource_obj.gif"); //$NON-NLS-1$ //$NON-NLS-2$ ImageDescriptor id= CompareUIPlugin.getImageDescriptor(iconName); if (id != null) fTimeImage= id.createImage(); } return fTimeImage; } return null; }
ImageDescriptor id= CompareUIPlugin.getImageDescriptor(dPath); // we set the disabled image first (see PR 1GDDE87) if (id != null) a.setDisabledImageDescriptor(id); id= CompareUIPlugin.getImageDescriptor(ePath); if (id != null) { a.setImageDescriptor(id);
/** * Returns an image for identifying the edition side of a compare viewer. * This implementation extracts the value for the key "editionLabel" from the resource bundle * and passes it as the format argument to <code>MessageFormat.format</code>. * The single format argument for <code>MessageFormat.format</code> ("{0}" in the format string) * is the formatted modification date of the given input element. * <p> * Subclasses may override to create their own label. * </p> * * @param selectedEdition the selected edition for which a label must be returned * @param item if a path has been specified in <code>selectEdition</code> a sub element of the given selectedEdition; otherwise the same as selectedEdition * @return a label the edition side of a compare viewer * @since 2.0 */ protected Image getEditionImage(ITypedElement selectedEdition, ITypedElement item) { if (selectedEdition instanceof ResourceNode) return selectedEdition.getImage(); if (selectedEdition instanceof HistoryItem) { if (fTimeImage == null) { String iconName= Utilities.getString(fBundle, "timeIcon", "obj16/resource_obj.png"); //$NON-NLS-1$ //$NON-NLS-2$ ImageDescriptor id= CompareUIPlugin.getImageDescriptor(iconName); if (id != null) fTimeImage= id.createImage(); } return fTimeImage; } return null; }
ImageDescriptor id= CompareUIPlugin.getImageDescriptor(dPath); // we set the disabled image first (see PR 1GDDE87) if (id != null) a.setDisabledImageDescriptor(id); id= CompareUIPlugin.getImageDescriptor(ePath); if (id != null) { a.setImageDescriptor(id);
public PatchWizard(IStorage patch, IResource target, CompareConfiguration configuration) { Assert.isNotNull(configuration); this.fConfiguration = configuration; setDefaultPageImageDescriptor(CompareUIPlugin.getImageDescriptor("wizban/applypatch_wizban.png")); //$NON-NLS-1$ setWindowTitle(PatchMessages.PatchWizard_title); initializeDialogSettings(); fPatcher= new WorkspacePatcher(target); if (patch != null) { try { fPatcher.parse(patch); this.patch = patch; patchReadIn = true; } catch (IOException e) { MessageDialog.openError(null, PatchMessages.InputPatchPage_PatchErrorDialog_title, PatchMessages.InputPatchPage_ParseError_message); } catch (CoreException e) { ErrorDialog.openError(getShell(), PatchMessages.InputPatchPage_PatchErrorDialog_title, PatchMessages.InputPatchPage_PatchFileNotFound_message, e.getStatus()); } } }
public PatchWizard(IStorage patch, IResource target, CompareConfiguration configuration) { Assert.isNotNull(configuration); this.fConfiguration = configuration; setDefaultPageImageDescriptor(CompareUIPlugin.getImageDescriptor("wizban/applypatch_wizban.png")); //$NON-NLS-1$ setWindowTitle(PatchMessages.PatchWizard_title); initializeDialogSettings(); fPatcher= new WorkspacePatcher(target); if (patch != null) { try { fPatcher.parse(patch); this.patch = patch; patchReadIn = true; } catch (IOException e) { MessageDialog.openError(null, PatchMessages.InputPatchPage_PatchErrorDialog_title, PatchMessages.InputPatchPage_ParseError_message); } catch (CoreException e) { ErrorDialog.openError(getShell(), PatchMessages.InputPatchPage_PatchErrorDialog_title, PatchMessages.InputPatchPage_PatchFileNotFound_message, e.getStatus()); } } }
public Image getImage(Object element) { Image image = wrappedProvider.getImage(element); if (element instanceof PatchDiffNode){ PatchDiffNode node = (PatchDiffNode) element; if (!node.isEnabled() && image != null) { LocalResourceManager imageCache = PatchCompareEditorInput.getImageCache(getPatcher().getConfiguration()); return imageCache.createImage(createOverlay(image, CompareUIPlugin.getImageDescriptor(ICompareUIConstants.REMOVED_OVERLAY), IDecoration.TOP_LEFT)); } } if (element instanceof HunkDiffNode) { HunkDiffNode node = (HunkDiffNode) element; if (node.isManuallyMerged()) { LocalResourceManager imageCache = PatchCompareEditorInput.getImageCache(getPatcher().getConfiguration()); return imageCache.createImage(PatchCompareEditorInput.createOverlay(image, CompareUIPlugin.getImageDescriptor(ICompareUIConstants.IS_MERGED_OVERLAY), IDecoration.TOP_LEFT)); } } return image; } }
@Override public Image getImage() { LocalResourceManager imageCache = PatchCompareEditorInput.getImageCache(fHunkResult.getDiffResult().getConfiguration()); ImageDescriptor imageDesc = CompareUIPlugin.getImageDescriptor(ICompareUIConstants.HUNK_OBJ); Image image = imageCache.createImage(imageDesc); if (!fHunkResult.isOK()) { return getHunkErrorImage(image, imageCache, true); } else if (fHunkResult.getFuzz() > 0) { return getHunkOverlayImage(image, imageCache, ICompareUIConstants.WARNING_OVERLAY, true); } return image; }
@Override public Image getImage(Object element) { Image image = wrappedProvider.getImage(element); if (element instanceof PatchDiffNode){ PatchDiffNode node = (PatchDiffNode) element; if (!node.isEnabled() && image != null) { LocalResourceManager imageCache = PatchCompareEditorInput.getImageCache(getPatcher().getConfiguration()); return imageCache.createImage(createOverlay(image, CompareUIPlugin.getImageDescriptor(ICompareUIConstants.REMOVED_OVERLAY), IDecoration.TOP_LEFT)); } } if (element instanceof HunkDiffNode) { HunkDiffNode node = (HunkDiffNode) element; if (node.isManuallyMerged()) { LocalResourceManager imageCache = PatchCompareEditorInput.getImageCache(getPatcher().getConfiguration()); return imageCache.createImage(PatchCompareEditorInput.createOverlay(image, CompareUIPlugin.getImageDescriptor(ICompareUIConstants.IS_MERGED_OVERLAY), IDecoration.TOP_LEFT)); } } return image; } }
fIncludeAction.setEnabled(true); fIgnoreWhiteSpace = new Action(PatchMessages.PreviewPatchPage2_IgnoreWSAction, CompareUIPlugin.getImageDescriptor(ICompareUIConstants.IGNORE_WHITESPACE_ENABLED)){ public void run(){ try { fIgnoreWhiteSpace.setChecked(false); fIgnoreWhiteSpace.setToolTipText(PatchMessages.PreviewPatchPage2_IgnoreWSTooltip); fIgnoreWhiteSpace.setDisabledImageDescriptor(CompareUIPlugin.getImageDescriptor(ICompareUIConstants.IGNORE_WHITESPACE_DISABLED));
fIncludeAction.setEnabled(true); fIgnoreWhiteSpace = new Action(PatchMessages.PreviewPatchPage2_IgnoreWSAction, CompareUIPlugin.getImageDescriptor(ICompareUIConstants.IGNORE_WHITESPACE_ENABLED)){ @Override public void run(){ fIgnoreWhiteSpace.setChecked(false); fIgnoreWhiteSpace.setToolTipText(PatchMessages.PreviewPatchPage2_IgnoreWSTooltip); fIgnoreWhiteSpace.setDisabledImageDescriptor(CompareUIPlugin.getImageDescriptor(ICompareUIConstants.IGNORE_WHITESPACE_DISABLED));
if (fDateImage == null) { String iconName= Utilities.getString(fBundle, "dateIcon", "obj16/day_obj.png"); //$NON-NLS-2$ //$NON-NLS-1$ ImageDescriptor id= CompareUIPlugin.getImageDescriptor(iconName); if (id != null) fDateImage= id.createImage();
if (fDateImage == null) { String iconName= Utilities.getString(fBundle, "dateIcon", "obj16/day_obj.gif"); //$NON-NLS-2$ //$NON-NLS-1$ ImageDescriptor id= CompareUIPlugin.getImageDescriptor(iconName); if (id != null) fDateImage= id.createImage();
labelOptimized.setImage(CompareUIPlugin.getImageDescriptor( OPTIMIZED_INFO_IMAGE_NAME).createImage()); labelOptimized.setVisible(false); // hide by default