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")); } } } }
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); } } }); }
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); }
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 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 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 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 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 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 String getStatus() { if (isLivenessDetectable()) { if (isAlive()) { return (MessageText.getString("device.status.online")); } else { return (MessageText.getString("device.od.error.notfound")); } } return (null); }
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; } }); }
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 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); } }
protected String getListTitleText() { if (list_title_text == null) { list_title_text = MessageText.getString("installPluginsWizard.list.loaded"); } return (list_title_text); }
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); } }); }
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); } }); }
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)); } }
// @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(""); }
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 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 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); }
public void show() { wizard.setTitle(MessageText.getString("importTorrentWizard.finish.title")); 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 = 3; panel.setLayout(layout); Label label = new Label(panel, SWT.WRAP); gridData = new GridData(); gridData.horizontalSpan = 3; gridData.widthHint = 380; label.setLayoutData(gridData); Messages.setLanguageText(label, "importTorrentWizard.finish.message"); }
private void update() { int state = downloader.getDownloadState(); int percentDone = downloader.getPercentDone(); IProgressReport pReport = pReporter.getProgressReport(); switch (state) { case TorrentDownloader.STATE_CANCELLED: if (false == pReport.isCanceled()) { pReporter.cancel(); } return; case TorrentDownloader.STATE_DOWNLOADING: pReporter.setPercentage(percentDone, downloader.getStatus()); break; case TorrentDownloader.STATE_ERROR: /* * If the user has canceled then a call to downloader.cancel() has already been made * so don't bother prompting for the user to retry */ if (true == pReport.isCanceled()) { return; } pReporter.setErrorMessage( MessageText.getString("fileDownloadWindow.state_error") + downloader.getError()); return; case TorrentDownloader.STATE_FINISHED: pReporter.setDone(); /* * If the listener is present then it handle finishing up; otherwise open the torrent that * was just downloaded */ if (listener == null) { TorrentOpener.openTorrent(downloader.getFile().getAbsolutePath()); } return; default: } }
protected void removeService(UPnPWANConnection wan_service, boolean replaced) { try { this_mon.enter(); String name = wan_service.getGenericService().getServiceType().indexOf("PPP") == -1 ? "WANIPConnection" : "WANPPPConnection"; String text = MessageText.getString( "upnp.alert.lostdevice", new String[] { name, wan_service.getGenericService().getDevice().getRootDevice().getLocation().getHost() }); log.log(text); if ((!replaced) && alert_device_probs_param.getValue()) { log.logAlertRepeatable(LoggerChannel.LT_WARNING, text); } for (int i = 0; i < services.size(); i++) { UPnPPluginService ps = (UPnPPluginService) services.get(i); if (ps.getService() == wan_service) { services.remove(i); break; } } } finally { this_mon.exit(); } }