/** * Returns the <code>ImageDescriptor</code> for the path in the given column with the current presentation * @param elementPath * @param presentationContext * @param columnId * @param columnIndex * @return image descriptor or <code>null</code> * @throws CoreException * * @since 3.6 */ protected ImageDescriptor getImageDescriptor(TreePath elementPath, IPresentationContext presentationContext, String columnId, int columnIndex) throws CoreException { return getImageDescriptor(elementPath, presentationContext, columnId); }
/** * Returns the label for the path in the given column with the current presentation. * @param elementPath * @param presentationContext * @param columnId * @param columnIndex * @return label * * @since 3.6 */ protected String getLabel(TreePath elementPath, IPresentationContext presentationContext, String columnId, int columnIndex) throws CoreException { return getLabel(elementPath, presentationContext, columnId); }
columnId = columnIds[i]; update.setLabel(getLabel(elementPath, presentationContext, columnId, i), i); update.setImageDescriptor(getImageDescriptor(elementPath, presentationContext, columnId, i), i); update.setBackground(getBackground(elementPath, presentationContext, columnId), i); update.setForeground(getForeground(elementPath, presentationContext, columnId), i); update.setFontData(getFontData(elementPath, presentationContext, columnId), i); if (update instanceof ICheckUpdate && Boolean.TRUE.equals(presentationContext.getProperty(ICheckUpdate.PROP_CHECK))) getChecked(elementPath, presentationContext), getGrayed(elementPath, presentationContext));
@Override public void run() { ILabelUpdate update = getNextUpdate(); while (update != null) { ISchedulingRule rule = getRule(update); if (!update.isCanceled()) { try { if (rule != null) { Job.getJobManager().beginRule(rule, null); } retrieveLabel(update); } catch (CoreException e) { update.setStatus(e.getStatus()); } finally { if (rule != null) { Job.getJobManager().endRule(rule); } } } update.done(); update = getNextUpdate(); } }
@Override public synchronized void update(ILabelUpdate[] updates) { if (fLabelJob == null) { fLabelJob = newLabelJob(updates); } if (!((ILabelJob)fLabelJob).queue(updates)) { fLabelJob = newLabelJob(updates); ((ILabelJob)fLabelJob).queue(updates); } // TODO: rule fLabelJob.schedule(); }
/** * Returns a new <code>Job</code> to update the specified labels. This method * is used to determine if a UI job is needed or not, in the event the request for an update * job has come from a non-UI thread. * @param updates an array of pending label updates * @return a new <code>Job</code> to update labels with. */ private Job newLabelJob(ILabelUpdate[] updates) { if (requiresUIJob(updates)) { return new UILabelJob(); } else { return new LabelJob(); } }