Search in sources :

Example 6 with SWTSkinObjectText

use of com.biglybt.ui.swt.skin.SWTSkinObjectText in project BiglyBT by BiglySoftware.

the class SimplePluginInstallWindow method open.

public void open() {
    box = new VuzeMessageBox("", "", null, 0);
    box.setSubTitle(MessageText.getString(resource_prefix + ".subtitle"));
    box.addResourceBundle(SimplePluginInstallWindow.class, SkinPropertiesImpl.PATH_SKIN_DEFS, "skin3_dlg_register");
    box.setIconResource(resource_prefix + ".image");
    this.progressText = MessageText.getString(resource_prefix + ".description");
    box.setListener(new VuzeMessageBoxListener() {

        @Override
        public void shellReady(Shell shell, SWTSkinObjectContainer soExtra) {
            SWTSkin skin = soExtra.getSkin();
            skin.createSkinObject("dlg.register.install", "dlg.register.install", soExtra);
            SWTSkinObjectContainer soProgressBar = (SWTSkinObjectContainer) skin.getSkinObject("progress-bar");
            if (soProgressBar != null) {
                progressBar = new ProgressBar(soProgressBar.getComposite(), SWT.HORIZONTAL);
                progressBar.setMinimum(0);
                progressBar.setMaximum(100);
                progressBar.setLayoutData(Utils.getFilledFormData());
            }
            soInstallPct = (SWTSkinObjectText) skin.getSkinObject("install-pct");
            soProgressText = (SWTSkinObjectText) skin.getSkinObject("progress-text");
            if (soProgressText != null && progressText != null) {
                soProgressText.setText(progressText);
            }
        }
    });
    box.open(new UserPrompterResultListener() {

        @Override
        public void prompterClosed(int result) {
            installer.setListener(null);
            try {
                installer.cancel();
            } catch (Exception e) {
                Debug.out(e);
            }
        }
    });
}
Also used : Shell(org.eclipse.swt.widgets.Shell) UserPrompterResultListener(com.biglybt.ui.UserPrompterResultListener) SWTSkinObjectText(com.biglybt.ui.swt.skin.SWTSkinObjectText) SWTSkinObjectContainer(com.biglybt.ui.swt.skin.SWTSkinObjectContainer) VuzeMessageBoxListener(com.biglybt.ui.swt.views.skin.VuzeMessageBoxListener) VuzeMessageBox(com.biglybt.ui.swt.views.skin.VuzeMessageBox) SWTSkin(com.biglybt.ui.swt.skin.SWTSkin) ProgressBar(org.eclipse.swt.widgets.ProgressBar)

Example 7 with SWTSkinObjectText

use of com.biglybt.ui.swt.skin.SWTSkinObjectText in project BiglyBT by BiglySoftware.

the class ToolBarView method initSO.

private void initSO(SWTSkinObject so, ToolBarItemSO itemSO) {
    ToolBarItem item = itemSO.getBase();
    itemSO.setSO(so);
    String toolTip = item.getToolTip();
    if (toolTip != null) {
        so.setTooltipID("!" + toolTip + "!");
    } else {
        so.setTooltipID(item.getToolTipID());
    }
    so.setData("toolbaritem", item);
    SWTSkinButtonUtility btn = (SWTSkinButtonUtility) so.getData("btn");
    if (btn == null) {
        btn = new SWTSkinButtonUtility(so, "toolbar-item-image");
        so.setData("btn", btn);
    }
    btn.setImage(item.getImageID());
    btn.addSelectionListener(buttonListener);
    itemSO.setSkinButton(btn);
    SWTSkinObject soTitle = skin.getSkinObject("toolbar-item-title", so);
    if (soTitle instanceof SWTSkinObjectText) {
        ((SWTSkinObjectText) soTitle).setTextID(item.getTextID());
        itemSO.setSkinTitle((SWTSkinObjectText) soTitle);
    }
    synchronized (mapToolBarItemToSO) {
        mapToolBarItemToSO.put(item, itemSO);
    }
}
Also used : SWTSkinObject(com.biglybt.ui.swt.skin.SWTSkinObject) SWTSkinButtonUtility(com.biglybt.ui.swt.skin.SWTSkinButtonUtility) SWTSkinObjectText(com.biglybt.ui.swt.skin.SWTSkinObjectText) ToolBarItem(com.biglybt.ui.common.ToolBarItem)

Aggregations

SWTSkinObjectText (com.biglybt.ui.swt.skin.SWTSkinObjectText)7 SWTSkinObject (com.biglybt.ui.swt.skin.SWTSkinObject)4 SWTSkin (com.biglybt.ui.swt.skin.SWTSkin)3 UserPrompterResultListener (com.biglybt.ui.UserPrompterResultListener)2 SWTSkinObjectContainer (com.biglybt.ui.swt.skin.SWTSkinObjectContainer)2 VuzeMessageBox (com.biglybt.ui.swt.views.skin.VuzeMessageBox)2 VuzeMessageBoxListener (com.biglybt.ui.swt.views.skin.VuzeMessageBoxListener)2 ProgressBar (org.eclipse.swt.widgets.ProgressBar)2 Shell (org.eclipse.swt.widgets.Shell)2 Core (com.biglybt.core.Core)1 CoreRunningListener (com.biglybt.core.CoreRunningListener)1 DeviceTemplate (com.biglybt.core.devices.DeviceTemplate)1 ToolBarItem (com.biglybt.ui.common.ToolBarItem)1 UIFunctionsSWT (com.biglybt.ui.swt.UIFunctionsSWT)1 MultipleDocumentInterfaceSWT (com.biglybt.ui.swt.mdi.MultipleDocumentInterfaceSWT)1 MessageBoxShell (com.biglybt.ui.swt.shells.MessageBoxShell)1 SWTSkinButtonUtility (com.biglybt.ui.swt.skin.SWTSkinButtonUtility)1 InfoBarUtil (com.biglybt.ui.swt.views.skin.InfoBarUtil)1 SkinnedDialogClosedListener (com.biglybt.ui.swt.views.skin.SkinnedDialog.SkinnedDialogClosedListener)1 Point (org.eclipse.swt.graphics.Point)1