Search in sources :

Example 86 with AERunnable

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

the class SWTSkinObjectExpandItem method setExpanded.

public void setExpanded(final boolean expand) {
    Utils.execSWTThread(new AERunnable() {

        @Override
        public void runSupport() {
            expandItem.setExpanded(expand);
            setExpandedVariable(expand);
            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 87 with AERunnable

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

the class SWTSkinObjectSlider method setPercent.

private void setPercent(double newPercent, boolean triggerListeners) {
    if (areDoublesEqual(percent, newPercent)) {
        return;
    }
    newPercent = validatePercent(newPercent, triggerListeners);
    if (areDoublesEqual(percent, newPercent)) {
        return;
    }
    this.percent = newPercent;
    Utils.execSWTThread(new AERunnable() {

        @Override
        public void runSupport() {
            if (canvas != null && !canvas.isDisposed()) {
                canvas.redraw();
                canvas.update();
            }
        }
    });
    if (triggerListeners) {
        Object[] listenersArray = listeners.toArray();
        for (int i = 0; i < listenersArray.length; i++) {
            SWTSkinListenerSliderSelection l = (SWTSkinListenerSliderSelection) listenersArray[i];
            l.selectionChanged(this.percent);
        }
    }
}
Also used : AERunnable(com.biglybt.core.util.AERunnable)

Example 88 with AERunnable

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

the class SWTSkinObjectText1 method setTextID.

@Override
public void setTextID(final String key, final String[] params) {
    if (key == null) {
        setText("");
    } else if (key.equals(sKey)) {
        return;
    }
    this.sText = MessageText.getString(key);
    this.sKey = key;
    bIsTextDefault = false;
    Utils.execSWTThread(new AERunnable() {

        @Override
        public void runSupport() {
            if (label != null && !label.isDisposed()) {
                Messages.setLanguageText(label, key, params);
                Utils.relayout(label);
            }
        }
    });
}
Also used : AERunnable(com.biglybt.core.util.AERunnable)

Example 89 with AERunnable

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

the class SWTSkinObjectText1 method setText.

/**
 * @param searchText
 */
@Override
public void setText(String text) {
    if (text == null) {
        text = "";
    }
    if (text.equals(sText)) {
        return;
    }
    this.sText = text;
    this.sKey = null;
    bIsTextDefault = false;
    Utils.execSWTThread(new AERunnable() {

        @Override
        public void runSupport() {
            if (label != null && !label.isDisposed()) {
                label.setText(sText);
                Utils.relayout(label);
            }
        }
    });
}
Also used : AERunnable(com.biglybt.core.util.AERunnable)

Example 90 with AERunnable

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

the class SWTSkinObjectToggle method setToggled.

public void setToggled(boolean b) {
    isToggled = b;
    Utils.execSWTThread(new AERunnable() {

        @Override
        public void runSupport() {
            if (button != null && !button.isDisposed()) {
                button.setSelection(isToggled);
            }
        }
    });
}
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