Search in sources :

Example 81 with AERunnable

use of com.biglybt.core.util.AERunnable in project BiglyBT by BiglySoftware.

the class SWTSkinObjectExpandItem method itemExpanded.

@Override
public void itemExpanded(ExpandEvent e) {
    if (e.item == expandItem) {
        setExpandedVariable(true);
        Utils.execSWTThreadLater(0, new AERunnable() {

            @Override
            public void runSupport() {
                SWTSkinObjectExpandBar soExpandBar = (SWTSkinObjectExpandBar) parent;
                soExpandBar.handleResize(expandItem);
            }
        });
    }
}
Also used : AERunnable(com.biglybt.core.util.AERunnable)

Example 82 with AERunnable

use of com.biglybt.core.util.AERunnable in project BiglyBT by BiglySoftware.

the class SWTSkinObjectText2 method switchSuffix.

@Override
public String switchSuffix(String suffix, int level, boolean walkUp, boolean walkDown) {
    boolean forceSwitch = suffix == null;
    String oldSuffix = getSuffix();
    suffix = super.switchSuffix(suffix, level, walkUp, walkDown);
    if (suffix == null) {
        return null;
    }
    if (!forceSwitch && suffix.equals(oldSuffix)) {
        return suffix;
    }
    String sPrefix = sConfigID + ".text";
    if (sText == null || bIsTextDefault) {
        String text = properties.getStringValue(sPrefix + suffix);
        if (text != null) {
            sText = text;
            this.sDisplayText = isAllcaps && sText != null ? sText.toUpperCase() : sText;
        }
    }
    final String fSuffix = suffix;
    Utils.execSWTThread(new AERunnable() {

        @Override
        public void runSupport() {
            if (canvas == null || canvas.isDisposed()) {
                return;
            }
            updateFont(fSuffix);
        }
    });
    return suffix;
}
Also used : AERunnable(com.biglybt.core.util.AERunnable)

Example 83 with AERunnable

use of com.biglybt.core.util.AERunnable in project BiglyBT by BiglySoftware.

the class SWTSkinObjectText2 method setTextColor.

// @see SWTSkinObjectText#setTextColor(org.eclipse.swt.graphics.Color)
@Override
public void setTextColor(final Color color) {
    explicitColor = color;
    Utils.execSWTThread(new AERunnable() {

        @Override
        public void runSupport() {
            if (canvas == null || canvas.isDisposed()) {
                return;
            }
            canvas.setData("color", color);
            canvas.redraw();
        }
    });
}
Also used : AERunnable(com.biglybt.core.util.AERunnable)

Example 84 with AERunnable

use of com.biglybt.core.util.AERunnable in project BiglyBT by BiglySoftware.

the class SWTSkinObjectText2 method setTextID.

@Override
public void setTextID(String key, String[] params) {
    if (key == null) {
        setText("");
    }
    /*
		 * KN: disabling the caching of the key since this is parameterized it may be called
		 * multiple times with different parameters
		 */
    // else if (key.equals(sKey)) {
    // return;
    // }
    this.sText = MessageText.getString(key, params);
    this.sDisplayText = isAllcaps && sText != null ? sText.toUpperCase() : sText;
    this.sKey = key;
    bIsTextDefault = false;
    Utils.execSWTThreadLater(0, new AERunnable() {

        @Override
        public void runSupport() {
            if (canvas == null || canvas.isDisposed()) {
                return;
            }
            canvas.redraw();
            if (relayoutOnTextChange) {
                canvas.layout(true);
                Utils.relayout(canvas);
            }
        }
    });
}
Also used : AERunnable(com.biglybt.core.util.AERunnable)

Example 85 with AERunnable

use of com.biglybt.core.util.AERunnable in project BiglyBT by BiglySoftware.

the class SWTSkinObjectExpandItem method itemCollapsed.

@Override
public void itemCollapsed(ExpandEvent e) {
    if (e.item == expandItem) {
        setExpandedVariable(false);
        Utils.execSWTThreadLater(0, new AERunnable() {

            @Override
            public void runSupport() {
                SWTSkinObjectExpandBar soExpandBar = (SWTSkinObjectExpandBar) parent;
                soExpandBar.handleResize(expandItem);
            }
        });
    }
}
Also used : AERunnable(com.biglybt.core.util.AERunnable)

Aggregations

AERunnable (com.biglybt.core.util.AERunnable)92 GridLayout (org.eclipse.swt.layout.GridLayout)12 DownloadManager (com.biglybt.core.download.DownloadManager)11 Image (org.eclipse.swt.graphics.Image)10 ArrayList (java.util.ArrayList)9 GridData (org.eclipse.swt.layout.GridData)9 CoreRunningListener (com.biglybt.core.CoreRunningListener)7 File (java.io.File)7 PEPeer (com.biglybt.core.peer.PEPeer)6 Shell (org.eclipse.swt.widgets.Shell)6 Core (com.biglybt.core.Core)5 ImageLoader (com.biglybt.ui.swt.imageloader.ImageLoader)5 Point (org.eclipse.swt.graphics.Point)5 PEPeerManager (com.biglybt.core.peer.PEPeerManager)4 Subscription (com.biglybt.core.subs.Subscription)3 TableColumnCore (com.biglybt.ui.common.table.TableColumnCore)3 UISWTViewEvent (com.biglybt.ui.swt.pif.UISWTViewEvent)3 MessageBoxShell (com.biglybt.ui.swt.shells.MessageBoxShell)3 MouseAdapter (org.eclipse.swt.events.MouseAdapter)3 MouseEvent (org.eclipse.swt.events.MouseEvent)3