Search in sources :

Example 1 with PluginUISWTSkinObject

use of com.biglybt.ui.swt.pif.PluginUISWTSkinObject in project BiglyBT by BiglySoftware.

the class SideBar method getEntryFromSkinObject.

// @see MultipleDocumentInterfaceSWT#getEntryFromSkinObject(com.biglybt.ui.swt.pif.PluginUISWTSkinObject)
@Override
public MdiEntrySWT getEntryFromSkinObject(PluginUISWTSkinObject pluginSkinObject) {
    if (pluginSkinObject instanceof SWTSkinObject) {
        Control control = ((SWTSkinObject) pluginSkinObject).getControl();
        while (control != null && !control.isDisposed()) {
            Object entry = control.getData("BaseMDIEntry");
            if (entry instanceof BaseMdiEntry) {
                BaseMdiEntry mdiEntry = (BaseMdiEntry) entry;
                return mdiEntry;
            }
            control = control.getParent();
        }
    }
    return null;
}
Also used : PluginUISWTSkinObject(com.biglybt.ui.swt.pif.PluginUISWTSkinObject) BaseMdiEntry(com.biglybt.ui.swt.mdi.BaseMdiEntry) PluginUISWTSkinObject(com.biglybt.ui.swt.pif.PluginUISWTSkinObject)

Example 2 with PluginUISWTSkinObject

use of com.biglybt.ui.swt.pif.PluginUISWTSkinObject in project BiglyBT by BiglySoftware.

the class BaseMdiEntry method setPluginSkinObject.

/* (non-Javadoc)
	 * @see com.biglybt.ui.swt.pifimpl.UISWTViewImpl2#setPluginSkinObject(com.biglybt.ui.swt.pif.PluginUISWTSkinObject, org.eclipse.swt.widgets.Composite)
	 */
@Override
public void setPluginSkinObject(PluginUISWTSkinObject skinObject) {
    super.setPluginSkinObject(skinObject);
    Object initialDataSource = (datasource == null || ((datasource instanceof Object[]) && ((Object[]) datasource).length == 0)) ? getInitialDataSource() : datasource;
    if (initialDataSource != null) {
        if (skinObject instanceof SWTSkinObject) {
            ((SWTSkinObject) skinObject).triggerListeners(SWTSkinObjectListener.EVENT_DATASOURCE_CHANGED, initialDataSource);
        }
        triggerEvent(UISWTViewEvent.TYPE_DATASOURCE_CHANGED, initialDataSource);
    }
}
Also used : SWTSkinObject(com.biglybt.ui.swt.skin.SWTSkinObject) PluginUISWTSkinObject(com.biglybt.ui.swt.pif.PluginUISWTSkinObject) SWTSkinObject(com.biglybt.ui.swt.skin.SWTSkinObject) PluginUISWTSkinObject(com.biglybt.ui.swt.pif.PluginUISWTSkinObject)

Example 3 with PluginUISWTSkinObject

use of com.biglybt.ui.swt.pif.PluginUISWTSkinObject in project BiglyBT by BiglySoftware.

the class TabbedMDI method getEntryFromSkinObject.

// @see MultipleDocumentInterfaceSWT#getEntryFromSkinObject(com.biglybt.ui.swt.pif.PluginUISWTSkinObject)
@Override
public MdiEntrySWT getEntryFromSkinObject(PluginUISWTSkinObject pluginSkinObject) {
    if (pluginSkinObject instanceof SWTSkinObject) {
        Control control = ((SWTSkinObject) pluginSkinObject).getControl();
        while (control != null && !control.isDisposed()) {
            Object entry = control.getData("BaseMDIEntry");
            if (entry instanceof BaseMdiEntry) {
                BaseMdiEntry mdiEntry = (BaseMdiEntry) entry;
                return mdiEntry;
            }
            control = control.getParent();
        }
    }
    return null;
}
Also used : PluginUISWTSkinObject(com.biglybt.ui.swt.pif.PluginUISWTSkinObject) PluginUISWTSkinObject(com.biglybt.ui.swt.pif.PluginUISWTSkinObject)

Aggregations

PluginUISWTSkinObject (com.biglybt.ui.swt.pif.PluginUISWTSkinObject)3 BaseMdiEntry (com.biglybt.ui.swt.mdi.BaseMdiEntry)1 SWTSkinObject (com.biglybt.ui.swt.skin.SWTSkinObject)1