Search in sources :

Example 1 with HyperlinkParameterImpl

use of com.biglybt.pifimpl.local.ui.config.HyperlinkParameterImpl in project BiglyBT by BiglySoftware.

the class ConfigSectionConnectionDNS method build.

@Override
public void build() {
    add(new LabelParameterImpl("ConfigView.section.dns.info"));
    add(new HyperlinkParameterImpl("ConfigView.label.please.visit.here", Wiki.DNS));
    add(new StringParameterImpl(Connection.SCFG_DNS_ALT_SERVERS, "ConfigView.section.dns.alts"));
    add(new BooleanParameterImpl(Connection.BCFG_DNS_ALT_SERVERS_SOCKS_ENABLE, "ConfigView.section.dns.allow_socks"));
}
Also used : LabelParameterImpl(com.biglybt.pifimpl.local.ui.config.LabelParameterImpl) HyperlinkParameterImpl(com.biglybt.pifimpl.local.ui.config.HyperlinkParameterImpl) StringParameterImpl(com.biglybt.pifimpl.local.ui.config.StringParameterImpl) BooleanParameterImpl(com.biglybt.pifimpl.local.ui.config.BooleanParameterImpl)

Example 2 with HyperlinkParameterImpl

use of com.biglybt.pifimpl.local.ui.config.HyperlinkParameterImpl in project BiglyBT by BiglySoftware.

the class ConfigSectionPlugins method build.

@Override
public void build() {
    if (!CoreFactory.isCoreRunning()) {
        add(new LabelParameterImpl("core.not.available"));
    }
    String sep = File.separator;
    File fUserPluginDir = FileUtil.getUserFile("plugins");
    String sUserPluginDir;
    try {
        sUserPluginDir = fUserPluginDir.getCanonicalPath();
    } catch (Throwable e) {
        sUserPluginDir = fUserPluginDir.toString();
    }
    if (!sUserPluginDir.endsWith(sep)) {
        sUserPluginDir += sep;
    }
    File fAppPluginDir = FileUtil.getApplicationFile("plugins");
    String sAppPluginDir;
    try {
        sAppPluginDir = fAppPluginDir.getCanonicalPath();
    } catch (Throwable e) {
        sAppPluginDir = fAppPluginDir.toString();
    }
    if (!sAppPluginDir.endsWith(sep)) {
        sAppPluginDir += sep;
    }
    add(new LabelParameterImpl("ConfigView.pluginlist.whereToPut"));
    File dirUserPlugin = FileUtil.newFile(sUserPluginDir);
    if (!(dirUserPlugin.exists() && dirUserPlugin.isDirectory())) {
        dirUserPlugin = dirUserPlugin.getParentFile();
    }
    HyperlinkParameterImpl paramUserPluginDir = new HyperlinkParameterImpl("!" + sUserPluginDir.replaceAll("&", "&&") + "!", dirUserPlugin.getAbsolutePath());
    add(paramUserPluginDir);
    paramUserPluginDir.setIndent(1, false);
    add(new LabelParameterImpl("ConfigView.pluginlist.whereToPutOr"));
    File dirAppPlugin = FileUtil.newFile(sAppPluginDir);
    if (!(dirAppPlugin.exists() && dirAppPlugin.isDirectory())) {
        dirAppPlugin = dirAppPlugin.getParentFile();
    }
    HyperlinkParameterImpl paramAppPluginDir = new HyperlinkParameterImpl("!" + sAppPluginDir.replaceAll("&", "&&") + "!", dirAppPlugin.getAbsolutePath());
    add(paramAppPluginDir);
    paramAppPluginDir.setIndent(1, false);
    if (paramContextPluginList != null) {
        add(new LabelParameterImpl("ConfigView.pluginlist.info"));
        add("PluginList", new UIParameterImpl(paramContextPluginList, null));
    } else {
    // could setup params for each plugin
    }
}
Also used : UIParameterImpl(com.biglybt.pifimpl.local.ui.config.UIParameterImpl) LabelParameterImpl(com.biglybt.pifimpl.local.ui.config.LabelParameterImpl) HyperlinkParameterImpl(com.biglybt.pifimpl.local.ui.config.HyperlinkParameterImpl) File(java.io.File)

Aggregations

HyperlinkParameterImpl (com.biglybt.pifimpl.local.ui.config.HyperlinkParameterImpl)2 LabelParameterImpl (com.biglybt.pifimpl.local.ui.config.LabelParameterImpl)2 BooleanParameterImpl (com.biglybt.pifimpl.local.ui.config.BooleanParameterImpl)1 StringParameterImpl (com.biglybt.pifimpl.local.ui.config.StringParameterImpl)1 UIParameterImpl (com.biglybt.pifimpl.local.ui.config.UIParameterImpl)1 File (java.io.File)1