public static void openLicenceCancelledWindow(final Licence licence) { final VuzeMessageBox box = new VuzeMessageBox( MessageText.getString("dlg.auth.cancelled"), MessageText.getString("dlg.auth.cancelled.line1"), new String[] { MessageText.getString("Button.close"), }, 0); box.addResourceBundle( FeatureManagerUI.class, SkinPropertiesImpl.PATH_SKIN_DEFS, "skin3_dlg_register"); box.setIconResource("image.vp"); box.setTextIconResource("image.warn.big"); box.setListener( new VuzeMessageBoxListener() { public void shellReady(Shell shell, SWTSkinObjectContainer soExtra) { SWTSkin skin = soExtra.getSkin(); SWTSkinObject so = skin.createSkinObject("dlg.register.cancelled", "dlg.register.cancelled", soExtra); } }); box.open(null); }
private static void openFullLicenceSuccessWindow() { final VuzeMessageBox box = new VuzeMessageBox( MessageText.getString("dlg.auth.title"), MessageText.getString("dlg.auth.success.line1"), new String[] { MessageText.getString("Button.getstarted"), }, 0); box.setSubTitle(MessageText.getString("dlg.auth.success.subtitle")); box.addResourceBundle( FeatureManagerUI.class, SkinPropertiesImpl.PATH_SKIN_DEFS, "skin3_dlg_register"); box.setIconResource("image.vp"); box.setListener( new VuzeMessageBoxListener() { public void shellReady(Shell shell, SWTSkinObjectContainer soExtra) { SWTSkin skin = soExtra.getSkin(); skin.createSkinObject("dlg.register.success", "dlg.register.success", soExtra); } }); box.open( new UserPrompterResultListener() { public void prompterClosed(int result) { if (result == 0) { SBC_PlusFTUX.setSourceRef("dlg-plus-installed"); MultipleDocumentInterface mdi = UIFunctionsManager.getUIFunctions().getMDI(); mdi.showEntryByID(MultipleDocumentInterface.SIDEBAR_SECTION_PLUS); } } }); }
private void refreshPWLabel() { if (passwordMatch == null || passwordMatch.isDisposed()) return; byte[] password = COConfigurationManager.getByteParameter("Password", "".getBytes()); COConfigurationManager.setParameter("Password enabled", false); if (password.length == 0) { passwordMatch.setText(MessageText.getString(LBLKEY_PREFIX + "passwordmatchnone")); } else { byte[] confirm = COConfigurationManager.getByteParameter("Password Confirm", "".getBytes()); if (confirm.length == 0) { passwordMatch.setText(MessageText.getString(LBLKEY_PREFIX + "passwordmatchno")); } else { boolean same = true; for (int i = 0; i < password.length; i++) { if (password[i] != confirm[i]) same = false; } if (same) { passwordMatch.setText(MessageText.getString(LBLKEY_PREFIX + "passwordmatchyes")); COConfigurationManager.setParameter("Password enabled", true); } else { passwordMatch.setText(MessageText.getString(LBLKEY_PREFIX + "passwordmatchno")); } } } }
public void failed(String licence_key, PluginException error) { if (alreadyFailing) { return; } alreadyFailing = true; UIFunctionsManager.getUIFunctions() .promptUser( MessageText.getString("dlg.auth.install.failed.title"), MessageText.getString( "dlg.auth.install.failed.text", new String[] {licence_key, Debug.getNestedExceptionMessage(error)}), new String[] {MessageText.getString("Button.ok")}, 0, null, null, false, 0, new UserPrompterResultListener() { public void prompterClosed(int result) { alreadyFailing = false; } }); Logger.log(new LogAlert(true, "Error while installing " + licence_key, error)); box.close(0); licence.removeInstallationListener(this); }
public CarbonUIEnhancer() { if (fgAboutActionName == null) { fgAboutActionName = MessageText.getString("MainWindow.menu.help.about").replaceAll("&", ""); } if (false == isAZ3) { if (fgWizardActionName == null) { fgWizardActionName = MessageText.getString("MainWindow.menu.file.configure").replaceAll("&", ""); } if (fgNatTestActionName == null) { fgNatTestActionName = MessageText.getString("MainWindow.menu.tools.nattest").replaceAll("&", ""); } if (fgSpeedTestActionName == null) { fgSpeedTestActionName = MessageText.getString("MainWindow.menu.tools.speedtest").replaceAll("&", ""); } } if (fgRestartActionName == null) { fgRestartActionName = MessageText.getString("MainWindow.menu.file.restart").replaceAll("&", ""); } earlyStartup(); registerTorrentFile(); }
public void cellHover(TableCell cell) { super.cellHover(cell); long lConnectedPeers = 0; DownloadManager dm = (DownloadManager) cell.getDataSource(); if (dm != null) { lConnectedPeers = dm.getNbPeers(); } String sToolTip = lConnectedPeers + " " + MessageText.getString("GeneralView.label.connected") + "\n"; if (lTotalPeers != -1) { sToolTip += lTotalPeers + " " + MessageText.getString("GeneralView.label.in_swarm"); } else { TRTrackerScraperResponse response = dm.getTrackerScrapeResponse(); sToolTip += "?? " + MessageText.getString("GeneralView.label.in_swarm"); if (response != null) sToolTip += "(" + response.getStatusString() + ")"; } int activationCount = dm == null ? 0 : dm.getActivationCount(); if (activationCount > 0) { sToolTip += "\n" + MessageText.getString( "PeerColumn.activationCount", new String[] {"" + activationCount}); } cell.setToolTip(sToolTip); }
public static void openTrialAskWindow() { VuzeMessageBox box = new VuzeMessageBox( MessageText.getString("dlg.try.trial.title"), MessageText.getString("dlg.try.trial.text"), new String[] { MessageText.getString("Button.turnon"), MessageText.getString("Button.cancel") }, 0); box.setButtonVals( new Integer[] { SWT.OK, SWT.CANCEL, }); box.addResourceBundle( FeatureManagerUI.class, SkinPropertiesImpl.PATH_SKIN_DEFS, "skin3_dlg_register"); box.setIconResource("image.burn.dlg.header"); box.setListener( new VuzeMessageBoxListener() { public void shellReady(Shell shell, SWTSkinObjectContainer soExtra) { SWTSkin skin = soExtra.getSkin(); String id = "dlg.register.trialask"; SWTSkinObject so = skin.createSkinObject(id, id, soExtra); SWTSkinObjectText soLink = (SWTSkinObjectText) skin.getSkinObject("link", so); if (soLink != null) { soLink.addUrlClickedListener( new SWTSkinObjectText_UrlClickedListener() { public boolean urlClicked(URLInfo urlInfo) { String url = ConstantsVuze.getDefaultContentNetwork() .getExternalSiteRelativeURL("plus_tos.start", true); Utils.launch(url); return true; } }); } } }); box.open( new UserPrompterResultListener() { public void prompterClosed(int result) { if (result == SWT.OK) { SimpleTimer.addEvent( "createTrial", SystemTime.getCurrentTime(), new TimerEventPerformer() { public void perform(TimerEvent event) { createTrial(); } }); } } }); }
public void init(Shell parentShell) { shell = ShellFactory.createShell(parentShell, SWT.BORDER | SWT.TITLE | SWT.CLOSE | SWT.RESIZE); Utils.setShellIcon(shell); if (Constants.isOSX) monospace = new Font(shell.getDisplay(), "Courier", 12, SWT.NORMAL); else monospace = new Font(shell.getDisplay(), "Courier New", 8, SWT.NORMAL); shell.setText( MessageText.getString("window.welcome.title", new String[] {Constants.AZUREUS_VERSION})); display = shell.getDisplay(); GridLayout layout = new GridLayout(); shell.setLayout(layout); GridData data; cWhatsNew = new Composite(shell, SWT.BORDER); data = new GridData(GridData.FILL_BOTH); cWhatsNew.setLayoutData(data); cWhatsNew.setLayout(new FillLayout()); Button bClose = new Button(shell, SWT.PUSH); bClose.setText(MessageText.getString("Button.close")); data = new GridData(); data.widthHint = 70; data.horizontalAlignment = Constants.isOSX ? SWT.CENTER : SWT.RIGHT; bClose.setLayoutData(data); Listener closeListener = new Listener() { public void handleEvent(Event event) { close(); } }; bClose.addListener(SWT.Selection, closeListener); shell.addListener(SWT.Close, closeListener); shell.setDefaultButton(bClose); shell.addListener( SWT.Traverse, new Listener() { public void handleEvent(Event e) { if (e.character == SWT.ESC) { close(); } } }); shell.setSize(750, 500); Utils.centreWindow(shell); shell.layout(); shell.open(); pullWhatsNew(cWhatsNew); }
public String getStatus() { if (isLivenessDetectable()) { if (isAlive()) { return (MessageText.getString("device.status.online")); } else { return (MessageText.getString("device.od.error.notfound")); } } return (null); }
protected void getTTDisplayProperties(List<String[]> dp) { addDP(dp, "devices.xcode.working_dir", getWorkingDirectory(false).getAbsolutePath()); addDP(dp, "devices.xcode.prof_def", getDefaultTranscodeProfile()); addDP(dp, "devices.xcode.profs", getTranscodeProfiles()); int tran_req = getTranscodeRequirement(); String tran_req_str; if (tran_req == TranscodeTarget.TRANSCODE_ALWAYS) { tran_req_str = "device.xcode.always"; } else if (tran_req == TranscodeTarget.TRANSCODE_NEVER) { tran_req_str = "device.xcode.never"; } else { tran_req_str = "device.xcode.whenreq"; } addDP(dp, "device.xcode", MessageText.getString(tran_req_str)); }
public void setTextID(final String id) { if (skinObject == null) { return; } if (skinObject instanceof SWTSkinObjectButton) { ((SWTSkinObjectButton) skinObject).setText(MessageText.getString(id)); return; } Utils.execSWTThreadLater( 0, new AERunnable() { public void runSupport() { if (skinObject instanceof SWTSkinObjectText) { SWTSkinObjectText skinTextObject = (SWTSkinObjectText) skinObject; skinTextObject.setTextID(id); } else if (skinObject instanceof SWTSkinObjectContainer) { SWTSkinObject[] children = ((SWTSkinObjectContainer) skinObject).getChildren(); if (children.length > 0 && children[0] instanceof SWTSkinObjectText) { SWTSkinObjectText skinTextObject = (SWTSkinObjectText) children[0]; skinTextObject.setTextID(id); } } Utils.relayout(skinObject.getControl()); } }); }
public static void openLicenceValidatingWindow() { if (!enabled || validatingBox != null) { return; } validatingBox = new VuzeMessageBox(MessageText.getString("dlg.auth.validating.subtitle"), null, null, 0); validatingBox.addResourceBundle( FeatureManagerUI.class, SkinPropertiesImpl.PATH_SKIN_DEFS, "skin3_dlg_register"); validatingBox.setIconResource("image.vp"); validatingBox.setListener( new VuzeMessageBoxListener() { public void shellReady(Shell shell, SWTSkinObjectContainer soExtra) { SWTSkin skin = soExtra.getSkin(); skin.createSkinObject("dlg.register.validating", "dlg.register.validating", soExtra); } }); validatingBox.open( new UserPrompterResultListener() { public void prompterClosed(int result) { validatingBox = null; } }); }
public void performAction(int action_id, Object args, final actionListener listener) { if (action_id == ACTION_FULL_UPDATE) { FullUpdateWindow.handleUpdate((String) args, listener); } else if (action_id == ACTION_UPDATE_RESTART_REQUEST) { String MSG_PREFIX = "UpdateMonitor.messagebox."; String title = MessageText.getString(MSG_PREFIX + "restart.title"); String text = MessageText.getString(MSG_PREFIX + "restart.text"); bringToFront(); boolean no_timeout = args instanceof Boolean && ((Boolean) args).booleanValue(); int timeout = 180000; if (no_timeout || !PluginInitializer.getDefaultInterface().getPluginManager().isSilentRestartEnabled()) { timeout = -1; } promptUser( title, text, new String[] { MessageText.getString("UpdateWindow.restart"), MessageText.getString("UpdateWindow.restartLater") }, 0, null, null, false, timeout, new UserPrompterResultListener() { public void prompterClosed(int result) { listener.actionComplete(result == 0); } }); } else { Debug.out("Unknown action " + action_id); } }
public void open() { if (!FeatureManagerUI.enabled) { return; } boolean isTrial = FeatureUtils.isTrialLicence(licence); box = new VuzeMessageBox(MessageText.getString("dlg.auth.title"), "", null, 0); box.setSubTitle( MessageText.getString( isTrial ? "dlg.auth.install.subtitle.trial" : "dlg.auth.install.subtitle.plus")); box.addResourceBundle( FeatureManagerUI.class, SkinPropertiesImpl.PATH_SKIN_DEFS, "skin3_dlg_register"); box.setIconResource(isTrial ? "image.burn.dlg.header" : "image.vp"); box.setListener( new VuzeMessageBoxListener() { 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() { public void prompterClosed(int result) { licence.removeInstallationListener(FeatureManagerInstallWindow.this); } }); }
protected String getListTitleText() { if (list_title_text == null) { list_title_text = MessageText.getString("installPluginsWizard.list.loaded"); } return (list_title_text); }
private void pullWhatsNew(Composite cWhatsNew) { labelLoading = new Label(cWhatsNew, SWT.CENTER); labelLoading.setText(MessageText.getString("installPluginsWizard.details.loading")); shell.layout(true, true); shell.update(); getWhatsNew(1); }
public void open() { box = new VuzeMessageBox("", "", null, 0); box.setSubTitle(MessageText.getString("dlg.player.install.subtitle")); box.addResourceBundle( PlayerInstallWindow.class, SkinPropertiesImpl.PATH_SKIN_DEFS, "skin3_dlg_register"); box.setIconResource("image.player.dlg.header"); this.progressText = MessageText.getString("dlg.player.install.description"); box.setListener( new VuzeMessageBoxListener() { 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() { public void prompterClosed(int result) { installer.setListener(null); installer.cancel(); } }); }
public static void openLicenceActivationDeniedWindow(final Licence licence) { final VuzeMessageBox box = new VuzeMessageBox( MessageText.getString("dlg.auth.denied"), MessageText.getString("dlg.auth.denied.line1"), new String[] { MessageText.getString("Button.close"), }, 0); box.addResourceBundle( FeatureManagerUI.class, SkinPropertiesImpl.PATH_SKIN_DEFS, "skin3_dlg_register"); box.setIconResource("image.vp"); box.setTextIconResource("image.warn.big"); box.setListener( new VuzeMessageBoxListener() { public void shellReady(Shell shell, SWTSkinObjectContainer soExtra) { SWTSkin skin = soExtra.getSkin(); SWTSkinObject so = skin.createSkinObject("dlg.register.denied", "dlg.register.denied", soExtra); SWTSkinObjectText soLink = (SWTSkinObjectText) skin.getSkinObject("link", so); if (soLink != null) { soLink.addUrlClickedListener( new SWTSkinObjectText_UrlClickedListener() { public boolean urlClicked(URLInfo urlInfo) { String url = ConstantsVuze.getDefaultContentNetwork() .getExternalSiteRelativeURL( "licence_denied.start?key=" + UrlUtils.encode(licence.getKey()), true); Utils.launch(url); return true; } }); } } }); box.open(null); }
protected void report(String resource_key, String additional_text) { if (progress_listeners.size() > 0) { String prefix = MessageText.getString(resource_key); for (int i = 0; i < progress_listeners.size(); i++) { ((TOTorrentProgressListener) progress_listeners.get(i)) .reportCurrentTask(prefix + (additional_text == null ? "" : additional_text)); } } }
private void initialize(Composite composite) { panel = new Composite(composite, SWT.NULL); panel.setLayout(new GridLayout(2, false)); legend_panel_sc = new ScrolledComposite(panel, SWT.V_SCROLL); legend_panel_sc.setExpandHorizontal(true); legend_panel_sc.setExpandVertical(true); GridLayout layout = new GridLayout(); layout.horizontalSpacing = 0; layout.verticalSpacing = 0; layout.marginHeight = 0; layout.marginWidth = 0; legend_panel_sc.setLayout(layout); GridData gridData = new GridData(GridData.FILL_VERTICAL); legend_panel_sc.setLayoutData(gridData); legend_panel = new Group(legend_panel_sc, SWT.NULL); legend_panel.setText(MessageText.getString("label.tags")); legend_panel.setLayout(new GridLayout()); legend_panel_sc.setContent(legend_panel); legend_panel_sc.addControlListener( new ControlAdapter() { public void controlResized(ControlEvent e) { legend_panel_sc.setMinSize(legend_panel.computeSize(SWT.DEFAULT, SWT.DEFAULT)); } }); speed_panel = new Composite(panel, SWT.NULL); speed_panel.setLayout(new GridLayout()); gridData = new GridData(GridData.FILL_BOTH); speed_panel.setLayoutData(gridData); build(); TagManager tm = TagManagerFactory.getTagManager(); tm.addTagManagerListener(this, false); for (TagType tt : tm.getTagTypes()) { tt.addTagTypeListener(this, false); } panel.addListener( SWT.Activate, new Listener() { public void handleEvent(Event event) { refresh(true); } }); }
// @see // org.gudy.azureus2.plugins.ui.tables.TableCellRefreshListener#refresh(org.gudy.azureus2.plugins.ui.tables.TableCell) public void refresh(TableCell cell) { TableColumnCore column = (TableColumnCore) cell.getDataSource(); int colPos = column.getPosition(); // colPos can have gaps in numbers if (!cell.setSortValue(colPos) && cell.isValid()) { return; } String key = column.getTitleLanguageKey(); String s = MessageText.getString(key, column.getName()); // s = column.getPosition() + "] " + s; cell.setText(s); cell.setToolTip(""); }
public void refresh(TableCell cell) { DownloadManager dm = (DownloadManager) cell.getDataSource(); long value = (dm == null) ? 0 : dm.getEffectiveUploadRateLimitBytesPerSecond(); if (!cell.setSortValue(value) && cell.isValid()) return; if (value == -1) { cell.setText(MessageText.getString("MyTorrents.items.UpSpeedLimit.disabled")); } else if (value == 0) { cell.setText(Constants.INFINITY_STRING); } else { cell.setText(DisplayFormatters.formatByteCountToKiBEtcPerSec(value)); } }
protected String getStatus() { if (init_fail != null) { return (MessageText.getString("MyTorrentsView.menu.setSpeed.disabled") + ": " + init_fail); } else if (!active) { return (MessageText.getString("pairing.status.initialising") + "..."); } else if (SRP_SALT == null) { return (MessageText.getString("pairing.srp.pw.req")); } else if (last_punchers_registered == 0) { return (MessageText.getString("pairing.srp.registering")); } else { return (MessageText.getString("tps.status.available")); } }
/** Creates just an empty panel with a message indicating there are no reports to display */ private void createEmptyPanel() { Composite emptyPanel = new Composite(scrollChild, SWT.BORDER); GridData gData = new GridData(SWT.FILL, SWT.FILL, true, true); gData.heightHint = 100; emptyPanel.setLayoutData(gData); emptyPanel.setLayout(new GridLayout()); Label nothingToDisplay = new Label(emptyPanel, SWT.NONE); nothingToDisplay.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); nothingToDisplay.setText(MessageText.getString("Progress.reporting.no.reports.to.display")); /* * Mark this as being opened and is showing the empty panel */ isShowingEmpty = true; }
public static void loadBundle(boolean forceReload) { Locale old_locale = getCurrentLocale(); String savedLocaleString = COConfigurationManager.getStringParameter("locale"); Locale savedLocale; String[] savedLocaleStrings = savedLocaleString.split("_", 3); if (savedLocaleStrings.length > 0 && savedLocaleStrings[0].length() == 2) { if (savedLocaleStrings.length == 3) { savedLocale = new Locale(savedLocaleStrings[0], savedLocaleStrings[1], savedLocaleStrings[2]); } else if (savedLocaleStrings.length == 2 && savedLocaleStrings[1].length() == 2) { savedLocale = new Locale(savedLocaleStrings[0], savedLocaleStrings[1]); } else { savedLocale = new Locale(savedLocaleStrings[0]); } } else { if (savedLocaleStrings.length == 3 && savedLocaleStrings[0].length() == 0 && savedLocaleStrings[2].length() > 0) { savedLocale = new Locale(savedLocaleStrings[0], savedLocaleStrings[1], savedLocaleStrings[2]); } else { savedLocale = Locale.getDefault(); } } MessageText.changeLocale(savedLocale, forceReload); COConfigurationManager.setParameter( "locale.set.complete.count", COConfigurationManager.getIntParameter("locale.set.complete.count") + 1); Locale new_locale = getCurrentLocale(); if (!old_locale.equals(new_locale) || forceReload) { for (int i = 0; i < listeners.size(); i++) { try { ((MessageTextListener) listeners.get(i)).localeChanged(old_locale, new_locale); } catch (Throwable e) { Debug.printStackTrace(e); } } } }
public void reportActivity(String licence_key, String install, String activity) { if (FAKE_DELAY) { try { Thread.sleep(80); } catch (InterruptedException e) { } } if (soProgressText != null) { String[] split = install.split("/", 2); this.progressText = MessageText.getString( "dlg.auth.install.progress", new String[] {split.length == 2 ? split[1] : split[0]}); soProgressText.setText(this.progressText); } }
public static void openStreamPlusWindow(final String referal) { String msgidPrefix; String buttonID; long plusExpiryTimeStamp = FeatureManagerUI.getPlusExpiryTimeStamp(); if (plusExpiryTimeStamp < 0 || plusExpiryTimeStamp >= SystemTime.getCurrentTime()) { msgidPrefix = "dlg.stream.plus."; buttonID = "Button.upgrade"; } else { buttonID = "Button.renew"; msgidPrefix = "dlg.stream.plus.renew."; if (!MessageText.keyExistsForDefaultLocale(msgidPrefix + "text")) { msgidPrefix = "dlg.stream.plus."; } } final String f_msgidPrefix = msgidPrefix; final VuzeMessageBox box = new VuzeMessageBox( MessageText.getString(msgidPrefix + "title"), MessageText.getString(msgidPrefix + "text"), new String[] { MessageText.getString(buttonID), MessageText.getString("Button.cancel"), }, 0); box.setButtonVals(new Integer[] {BUTTON_UPGRADE, SWT.CANCEL}); box.setSubTitle(MessageText.getString(msgidPrefix + "subtitle")); box.addResourceBundle( FeatureManagerUI.class, SkinPropertiesImpl.PATH_SKIN_DEFS, "skin3_dlg_streamplus"); box.setIconResource("image.header.streamplus"); box.setListener( new VuzeMessageBoxListener() { public void shellReady(Shell shell, SWTSkinObjectContainer soExtra) { SWTSkin skin = soExtra.getSkin(); skin.createSkinObject("dlg.stream.plus", "dlg.stream.plus", soExtra); SWTSkinObject soSubText = skin.getSkinObject("trial-info", soExtra); if (soSubText instanceof SWTSkinObjectText) { ((SWTSkinObjectText) soSubText).setTextID(f_msgidPrefix + "subtext"); } } }); box.open( new UserPrompterResultListener() { public void prompterClosed(int result) { if (result == BUTTON_UPGRADE) { SBC_PlusFTUX.setSourceRef("dlg-stream" + (referal == null ? "" : "-" + referal)); MultipleDocumentInterface mdi = UIFunctionsManager.getUIFunctions().getMDI(); mdi.showEntryByID(MultipleDocumentInterface.SIDEBAR_SECTION_PLUS); } } }); }
public void show() { wizard.setTitle(MessageText.getString("installPluginsWizard.installMode.title")); wizard.setErrorMessage(""); Composite rootPanel = wizard.getPanel(); GridLayout layout = new GridLayout(); layout.numColumns = 1; rootPanel.setLayout(layout); Composite panel = new Composite(rootPanel, SWT.NULL); GridData gridData = new GridData(GridData.VERTICAL_ALIGN_CENTER | GridData.FILL_HORIZONTAL); panel.setLayoutData(gridData); layout = new GridLayout(); layout.numColumns = 1; panel.setLayout(layout); // default is PER_USER installation (changed 2013/02/14 by parg) wizard.shared = false; Button bSharedMode = new Button(panel, SWT.RADIO); Messages.setLanguageText(bSharedMode, "installPluginsWizard.installMode.shared"); bSharedMode.setData("mode", new Integer(MODE_SHARED)); bSharedMode.setSelection(wizard.shared); GridData data = new GridData(GridData.FILL_VERTICAL); data.verticalAlignment = GridData.VERTICAL_ALIGN_END; bSharedMode.setLayoutData(data); Button bUserMode = new Button(panel, SWT.RADIO); Messages.setLanguageText(bUserMode, "installPluginsWizard.installMode.user"); bUserMode.setData("mode", new Integer(MODE_USER)); bUserMode.setSelection(!wizard.shared); data = new GridData(GridData.FILL_VERTICAL); data.verticalAlignment = GridData.VERTICAL_ALIGN_BEGINNING; bUserMode.setLayoutData(data); Listener modeListener = new Listener() { public void handleEvent(Event e) { wizard.shared = ((Integer) e.widget.getData("mode")).intValue() == MODE_SHARED; } }; bUserMode.addListener(SWT.Selection, modeListener); bSharedMode.addListener(SWT.Selection, modeListener); }
/** * Sometime a accelerator key has 2 different returned values: one for Classic UI and another for * the Vuze UI This method will attempt to locate the given key (with the prefix v3. ) if * applicable, if found then it will return the key with the prepended prefix. Otherwise it will * return the key as given * * @param acceleratorKey * @return */ public static String resolveAcceleratorKey(String acceleratorKey) { if (null == acceleratorKey) { return null; } if (true == "az3".equalsIgnoreCase(COConfigurationManager.getStringParameter("ui"))) { String v3Key = null; if (false == acceleratorKey.startsWith("v3.")) { v3Key = "v3." + acceleratorKey; } else { v3Key = acceleratorKey; } if (true == MessageText.keyExists(v3Key + ".keybinding")) { return v3Key; } } return acceleratorKey; }
/** * Sometime a localization key has 2 different returned values: one for Classic UI and another for * the Vuze UI This method will attempt to locate the given key (with the prefix v3. ) if * applicable, if found then it will return the key with the prepended prefix. Otherwise it will * return the key as given * * @param localizationKey * @return */ public static String resolveLocalizationKey(String localizationKey) { if (null == localizationKey) { return null; } if (true == "az3".equalsIgnoreCase(COConfigurationManager.getStringParameter("ui"))) { String v3Key = null; if (false == localizationKey.startsWith("v3.")) { v3Key = "v3." + localizationKey; } else { v3Key = localizationKey; } if (true == MessageText.keyExists(v3Key)) { return v3Key; } } return localizationKey; }