001: /**
002: * LibreSource
003: * Copyright (C) 2004-2008 Artenum SARL / INRIA
004: * http://www.libresource.org - contact@artenum.com
005: *
006: * This file is part of the LibreSource software,
007: * which can be used and distributed under license conditions.
008: * The license conditions are provided in the LICENSE.TXT file
009: * at the root path of the packaging that enclose this file.
010: * More information can be found at
011: * - http://dev.libresource.org/home/license
012: *
013: * Initial authors :
014: *
015: * Guillaume Bort / INRIA
016: * Francois Charoy / Universite Nancy 2
017: * Julien Forest / Artenum
018: * Claude Godart / Universite Henry Poincare
019: * Florent Jouille / INRIA
020: * Sebastien Jourdain / INRIA / Artenum
021: * Yves Lerumeur / Artenum
022: * Pascal Molli / Universite Henry Poincare
023: * Gerald Oster / INRIA
024: * Mariarosa Penzi / Artenum
025: * Gerard Sookahet / Artenum
026: * Raphael Tani / INRIA
027: *
028: * Contributors :
029: *
030: * Stephane Bagnier / Artenum
031: * Amadou Dia / Artenum-IUP Blois
032: * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
033: */package org.libresource.so6.plugin.ui;
034:
035: /**
036: * @author Guillaume Bort
037: */
038: import org.eclipse.jface.viewers.IDecoration;
039: import org.eclipse.jface.viewers.ILightweightLabelDecorator;
040: import org.eclipse.jface.viewers.LabelProvider;
041:
042: import org.eclipse.swt.widgets.Display;
043:
044: import org.eclipse.ui.IWorkbench;
045: import org.eclipse.ui.PlatformUI;
046:
047: /**
048: * DOCUMENT ME!
049: *
050: * @author $author$
051: * @version $Revision: 1.3 $
052: */
053: public class So6DirtyResourceUILabelDecorator extends LabelProvider
054: implements ILightweightLabelDecorator {
055: /** DOCUMENT ME! */
056: public static final String ID = "org.libresource.so6.plugin.ui.So6DirtyResourceUILabelDecorator";
057:
058: /**
059: * DOCUMENT ME!
060: *
061: * @param element DOCUMENT ME!
062: * @param decoration DOCUMENT ME!
063: */
064: public void decorate(Object element, IDecoration decoration) {
065: try {
066: // trop lourd
067: } catch (Exception e) {
068: e.printStackTrace();
069: }
070: }
071:
072: /**
073: * DOCUMENT ME!
074: */
075: public static final void update() {
076: getStandardDisplay().asyncExec(new Runnable() {
077: public void run() {
078: IWorkbench workbench = PlatformUI.getWorkbench();
079: workbench.getDecoratorManager().update(
080: So6DirtyResourceUILabelDecorator.class
081: .getName());
082: }
083: });
084: }
085:
086: /**
087: * DOCUMENT ME!
088: *
089: * @return DOCUMENT ME!
090: */
091: public static Display getStandardDisplay() {
092: Display display = Display.getCurrent();
093:
094: if (display == null) {
095: display = Display.getDefault();
096: }
097:
098: return display;
099: }
100: }
|