Search in sources :

Example 66 with UIFunctions

use of com.biglybt.ui.UIFunctions in project BiglyBT by BiglySoftware.

the class SBC_TagsOverview method focusChanged.

@Override
public void focusChanged(TableRowCore focus) {
    updateSelectedContent();
    UIFunctions uiFunctions = UIFunctionsManager.getUIFunctions();
    if (uiFunctions != null) {
        uiFunctions.refreshIconBar();
    }
}
Also used : UIFunctions(com.biglybt.ui.UIFunctions)

Example 67 with UIFunctions

use of com.biglybt.ui.UIFunctions in project BiglyBT by BiglySoftware.

the class SBC_TagsOverview method defaultSelected.

@Override
public void defaultSelected(TableRowCore[] rows, int stateMask) {
    if (rows.length == 1) {
        Object obj = rows[0].getDataSource();
        if (obj instanceof Tag) {
            Tag tag = (Tag) obj;
            UIFunctions uiFunctions = UIFunctionsManager.getUIFunctions();
            if (uiFunctions != null) {
                if (!COConfigurationManager.getBooleanParameter("Library.TagInSideBar")) {
                    COConfigurationManager.setParameter("Library.TagInSideBar", true);
                }
                if (!tag.isVisible()) {
                    tag.setVisible(true);
                }
                String id = "Tag." + tag.getTagType().getTagType() + "." + tag.getTagID();
                uiFunctions.getMDI().showEntryByID(id, tag);
            }
        }
    }
}
Also used : UIFunctions(com.biglybt.ui.UIFunctions) SWTSkinObject(com.biglybt.ui.swt.skin.SWTSkinObject)

Example 68 with UIFunctions

use of com.biglybt.ui.UIFunctions in project BiglyBT by BiglySoftware.

the class SB_Transfers method refreshTagSideBar.

// tag stuff
private void refreshTagSideBar(Tag tag) {
    UIFunctions uiFunctions = UIFunctionsManager.getUIFunctions();
    MultipleDocumentInterface mdi = uiFunctions != null ? uiFunctions.getMDI() : null;
    if (mdi == null) {
        return;
    }
    MdiEntry entry = mdi.getEntry("Tag." + tag.getTagType().getTagType() + "." + tag.getTagID());
    if (entry == null) {
        if (tag.isVisible()) {
            setupTag(tag);
        }
        return;
    }
    if (!tag.isVisible()) {
        removeTag(tag);
        return;
    }
    String old_title = entry.getTitle();
    String tag_title = tag.getTagName(true);
    if (!old_title.equals(tag_title)) {
        entry.setTitle(tag_title);
    }
    Integer num = (Integer) entry.getUserData(TAG_INDICATOR_KEY);
    int tag_count = tag.getTaggedCount();
    if (num == null || num != tag_count) {
        entry.setUserData(TAG_INDICATOR_KEY, tag_count);
        requestRedraw(entry);
    }
    ViewTitleInfoManager.refreshTitleInfo(entry.getViewTitleInfo());
    Object[] tag_data = (Object[]) entry.getUserData(TAG_DATA_KEY);
    if (tag_data != null) {
        boolean[] auto_tag = tag.isTagAuto();
        boolean[] old_auto_tag = (boolean[]) tag_data[1];
        if (!Arrays.equals(auto_tag, old_auto_tag)) {
            tag_data[1] = auto_tag;
            if (auto_tag[0] && auto_tag[1]) {
                entry.removeListener((MdiEntryDropListener) tag_data[0]);
            } else {
                entry.addListener((MdiEntryDropListener) tag_data[0]);
            }
        }
    }
}
Also used : UIFunctions(com.biglybt.ui.UIFunctions)

Aggregations

UIFunctions (com.biglybt.ui.UIFunctions)68 DownloadManager (com.biglybt.core.download.DownloadManager)16 MenuItemListener (com.biglybt.pif.ui.menus.MenuItemListener)9 GridLayout (org.eclipse.swt.layout.GridLayout)9 PluginInterface (com.biglybt.pif.PluginInterface)8 MenuItem (com.biglybt.pif.ui.menus.MenuItem)8 File (java.io.File)8 SelectionEvent (org.eclipse.swt.events.SelectionEvent)8 GridData (org.eclipse.swt.layout.GridData)8 CoreRunningListener (com.biglybt.core.CoreRunningListener)7 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)7 Menu (org.eclipse.swt.widgets.Menu)7 Core (com.biglybt.core.Core)6 LogEvent (com.biglybt.core.logging.LogEvent)6 UIFunctionsUserPrompter (com.biglybt.ui.UIFunctionsUserPrompter)6 Composite (org.eclipse.swt.widgets.Composite)6 MenuItem (org.eclipse.swt.widgets.MenuItem)6 DiskManagerFileInfo (com.biglybt.core.disk.DiskManagerFileInfo)5 GlobalManager (com.biglybt.core.global.GlobalManager)5 LogAlert (com.biglybt.core.logging.LogAlert)5