private void changeParameNote() { if (detailListener == null) return; // Wert auf leer zur�cksetzen if (txtParamNote.getText() != null && txtParamNote.getText().length() == 0) return; if (txtName.getText() != null && txtName.getText().length() == 0) { // MainWindow.message(getShell(), // sos.scheduler.editor.app.Messages.getString("tooltip.detail.param.missing_param_name_for_note"), SWT.ICON_WARNING MainWindow.message(getShell(), JOE_M_0024.label(), SWT.ICON_WARNING | SWT.OK | SWT.CANCEL); return; } if (tableParams.getSelectionCount() == 0 || (tableParams.getSelectionCount() > 0 && !txtParamNote .getText() .equalsIgnoreCase( detailListener.getParamNote( tableParams.getSelection()[0].getText(0), comboLanguage.getText())))) { detailListener.setParam( txtName.getText(), txtValue.getText(), txtParamNote.getText(), paramText.getText(), comboLanguage.getText()); isEditableParam = true; butApplyParam.setEnabled(isEditableParam); isEditable = true; butApply.setEnabled(isEditable); if (gui != null) gui.updateParamNote(); } }
private void addParam() { if (txtName.getText().length() > 0) { detailListener.setParam( txtName.getText(), txtValue.getText(), txtParamNote.getText(), paramText.getText(), comboLanguage.getText()); txtParamNote.setText(detailListener.getParamNote(txtName.getText(), comboLanguage.getText())); tableParams.removeAll(); detailListener.fillParams(tableParams); butApply.setEnabled(isEditable); txtName.setText(""); txtValue.setText(""); isEditableParam = false; butApplyParam.setEnabled(isEditableParam); txtName.setFocus(); isEditableParam = false; butApplyParam.setEnabled(isEditableParam); isEditable = true; butApply.setEnabled(isEditable); butRemove.setEnabled(false); txtParamNote.setText(""); if (gui != null) gui.updateParam(); paramText.setText(""); txtParamNote.setEnabled(false); } }
private void saveDialogSettings() { IDialogSettings settings; IDialogSettings section; settings = SystemBrowserPlugin.getDefault().getDialogSettings(); section = settings.addNewSection("PoolFilterDialog"); section.put("target", targetCombo.getText()); section.put("poolId", poolIdText.getText().trim()); section.put("tab", tabFolder.getSelectionIndex()); section.put("signalNumberFrom", signalNumberFromText.getText().trim()); section.put("signalNumberTo", signalNumberToText.getText().trim()); section.put("signalOwnerId", signalOwnerIdText.getText().trim()); section.put("signalOwnerName", signalOwnerNameText.getText().trim()); section.put("signalSenderId", signalSenderIdText.getText().trim()); section.put("signalSenderName", signalSenderNameText.getText().trim()); section.put("signalAddresseeId", signalAddresseeIdText.getText().trim()); section.put("signalAddresseeName", signalAddresseeNameText.getText().trim()); section.put("signalSizeFrom", signalSizeFromText.getText().trim()); section.put("signalSizeTo", signalSizeToText.getText().trim()); section.put("signalBufferSizeFrom", signalBufferSizeFromText.getText().trim()); section.put("signalBufferSizeTo", signalBufferSizeToText.getText().trim()); section.put("signalAddressFrom", signalAddressFromText.getText().trim()); section.put("signalAddressTo", signalAddressToText.getText().trim()); section.put("signalStatus", signalStatusCombo.getText()); section.put("signalNumberExclude", signalNumberCheckbox.getSelection()); section.put("signalOwnerIdExclude", signalOwnerIdCheckbox.getSelection()); section.put("signalOwnerNameExclude", signalOwnerNameCheckbox.getSelection()); section.put("signalSenderIdExclude", signalSenderIdCheckbox.getSelection()); section.put("signalSenderNameExclude", signalSenderNameCheckbox.getSelection()); section.put("signalAddresseeIdExclude", signalAddresseeIdCheckbox.getSelection()); section.put("signalAddresseeNameExclude", signalAddresseeNameCheckbox.getSelection()); section.put("signalSizeExclude", signalSizeCheckbox.getSelection()); section.put("signalBufferSizeExclude", signalBufferSizeCheckbox.getSelection()); section.put("signalAddressExclude", signalAddressCheckbox.getSelection()); section.put("signalStatusExclude", signalStatusCheckbox.getSelection()); section.put("stackOwnerId", stackOwnerIdText.getText().trim()); section.put("stackOwnerName", stackOwnerNameText.getText().trim()); section.put("stackSizeFrom", stackSizeFromText.getText().trim()); section.put("stackSizeTo", stackSizeToText.getText().trim()); section.put("stackBufferSizeFrom", stackBufferSizeFromText.getText().trim()); section.put("stackBufferSizeTo", stackBufferSizeToText.getText().trim()); section.put("stackAddressFrom", stackAddressFromText.getText().trim()); section.put("stackAddressTo", stackAddressToText.getText().trim()); section.put("stackUsedFrom", stackUsedFromText.getText().trim()); section.put("stackUsedTo", stackUsedToText.getText().trim()); section.put("stackUnusedFrom", stackUnusedFromText.getText().trim()); section.put("stackUnusedTo", stackUnusedToText.getText().trim()); section.put("stackOwnerIdExclude", stackOwnerIdCheckbox.getSelection()); section.put("stackOwnerNameExclude", stackOwnerNameCheckbox.getSelection()); section.put("stackSizeExclude", stackSizeCheckbox.getSelection()); section.put("stackBufferSizeExclude", stackBufferSizeCheckbox.getSelection()); section.put("stackAddressExclude", stackAddressCheckbox.getSelection()); section.put("stackUsedExclude", stackUsedCheckbox.getSelection()); section.put("stackUnusedExclude", stackUnusedCheckbox.getSelection()); }
/** Stores it current configuration in the dialog store. */ private void writeConfiguration() { IDialogSettings s = getDialogSettings(); s.put(STORE_CASE_SENSITIVE, fIsCaseSensitive); s.put(STORE_IS_REG_EX_SEARCH, fIsRegExSearch); s.put(STORE_SEARCH_DERIVED, fSearchDerived); int historySize = Math.min(fPreviousSearchPatterns.size(), HISTORY_SIZE); s.put(STORE_HISTORY_SIZE, historySize); for (int i = 0; i < historySize; i++) { IDialogSettings histSettings = s.addNewSection(STORE_HISTORY + i); SearchPatternData data = fPreviousSearchPatterns.get(i); data.store(histSettings); } IDialogSettings extensionsSettings = s.addNewSection(STORE_EXTENSIONS); extensionsSettings.put(Integer.toString(0), fExtensions.getText()); Set<String> extensions = new HashSet<String>(HISTORY_SIZE); extensions.add(fExtensions.getText()); int length = Math.min(fExtensions.getItemCount(), HISTORY_SIZE - 1); int j = 1; for (int i = 0; i < length; i++) { String extension = fExtensions.getItem(i); if (extensions.add(extension)) { extensionsSettings.put(Integer.toString(j++), extension); } } }
protected void nameChanged() { if (!pageReady) { new UIJob(I18n.get("job")) { @Override public IStatus runInUIThread(IProgressMonitor monitor) { nameChanged(); return Status.OK_STATUS; } }.schedule(); return; } getConfig().setGroupName(nameCombo.getText()); parent.getFiledPage().initialize(nameCombo.getText()); GroupData group = getConfig().getModule().getConfigGroup(getConfig().getSectionName(), nameCombo.getText()); if (group != null) { labelText.setText(group.getLabel()); sortOrderSpinner.setSelection(group.getSortOrder()); defaultCheckbox.setSelection(group.isVisibleDefault()); websiteCheckbox.setSelection(group.isVisibleWebsite()); shopCheckbox.setSelection(group.isVisibleStore()); } else { labelText.setText(""); sortOrderSpinner.setSelection(0); defaultCheckbox.setSelection(false); websiteCheckbox.setSelection(false); shopCheckbox.setSelection(false); } dialogChanged(); }
public void performApply(ILaunchConfigurationWorkingCopy configuration) { configuration.setAttribute( IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, gdbCommand.getText().trim()); configuration.setAttribute( IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, gdbCommand.getText().trim()); // DSF savedJtagDevice = jtagDevice.getText(); configuration.setAttribute(IGDBJtagConstants.ATTR_JTAG_DEVICE, savedJtagDevice); configuration.setAttribute(IGDBJtagConstants.ATTR_USE_REMOTE_TARGET, useRemote.getSelection()); if (savedJtagDevice.length() > 0) { try { IGDBJtagDevice device = findJtagDeviceByName(jtagDevice.getText()).getDevice(); if (device instanceof IGDBJtagConnection) { String conn = connection.getText().trim(); URI uri = new URI("gdb", conn, ""); // $NON-NLS-1$ //$NON-NLS-2$ configuration.setAttribute(IGDBJtagConstants.ATTR_CONNECTION, uri.toString()); } else { String ip = ipAddress.getText().trim(); configuration.setAttribute(IGDBJtagConstants.ATTR_IP_ADDRESS, ip); int port = Integer.valueOf(portNumber.getText().trim()).intValue(); configuration.setAttribute(IGDBJtagConstants.ATTR_PORT_NUMBER, port); } } catch (URISyntaxException e) { Activator.log(e); } catch (NumberFormatException e) { Activator.log(e); } } configuration.setAttribute( IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_UPDATE_THREADLIST_ON_SUSPEND, fUpdateThreadlistOnSuspend.getSelection()); }
@Override public void widgetSelected(SelectionEvent e) { final StringBuilder sb = new StringBuilder(); if (attribute.getSelectionIndex() != -1) { sb.append(attribute.getText()); attribute.deselectAll(); } if (operation.getSelectionIndex() != -1) { if (sb.length() > 0) { sb.append(" "); // $NON-NLS-1$ } sb.append(operation.getText()); operation.deselectAll(); } if (value.getSelectionIndex() != -1) { if (sb.length() > 0) { sb.append(" "); // $NON-NLS-1$ } sb.append(value.getText()); value.deselectAll(); } if (sb.length() > 0) { changed(); text.insert(sb.toString()); text.setFocus(); } }
@Override public void widgetSelected(SelectionEvent e) { if (attribute.isFocusControl() && attribute.getSelectionIndex() != -1) { String selectedAttribute = attribute.getText(); text.insert(selectedAttribute); attribute.clearSelection(); changed(); text.setFocus(); return; } if (operation.isFocusControl() && operation.getSelectionIndex() != -1) { String selectedOperation = operation.getText(); text.insert(selectedOperation); operation.clearSelection(); changed(); text.setFocus(); return; } if (value.isFocusControl() && value.getSelectionIndex() != -1) { String selectedValue = value.getText(); text.insert(selectedValue); value.clearSelection(); changed(); text.setFocus(); return; } }
protected void projectChanged() { projectText = projectCombo.getText(); IJavaProject selectedProject = null; for (int i = 0; i < gwtProjects.length; i++) { IJavaProject gwtProject = gwtProjects[i]; if (projectText.equals(gwtProject.getProject().getName())) { selectedProject = gwtProject; break; } } if (selectedProject != null) { try { moduleCombo.removeAll(); List modulesList = Util.findModules(selectedProject); for (Iterator i = modulesList.iterator(); i.hasNext(); ) { IFile file = (IFile) i.next(); IPath projectRelativePath = file.getProjectRelativePath(); String fileName = file.getName(); String moduleName = fileName.substring(0, fileName.length() - Constants.GWT_XML_EXT.length() - 1); moduleCombo.add(projectRelativePath.toString()); moduleCombo.setData(moduleName, file); } int i = modulesList.indexOf(selectedModule); if (i == -1) i = 0; moduleCombo.select(i); moduleText = moduleCombo.getText(); } catch (CoreException e) { Activator.logException(e); } } doStatusUpdate(); }
/** * Disables the debugging if debug endpoint's type is changed to 'Internal', and if private port * is modified then assigns the new debugging port by setting the modified endpoint as a debugging * endpoint. * * @param oldType : old type of the endpoint. * @return retVal : false if any error occurs. * @throws WindowsAzureInvalidProjectOperationException */ private boolean handleChangeForDebugEndpt(WindowsAzureEndpointType oldType) throws WindowsAzureInvalidProjectOperationException { boolean retVal = true; if (oldType.equals(WindowsAzureEndpointType.Input) && comboType.getText().equalsIgnoreCase(WindowsAzureEndpointType.Internal.toString())) { StringBuffer msg = new StringBuffer(Messages.dlgEPDel); msg.append(Messages.dlgEPChangeType); msg.append(Messages.dlgEPDel2); boolean choice = MessageDialog.openQuestion(new Shell(), Messages.dlgTypeTitle, msg.toString()); if (choice) { waEndpt.setEndPointType(WindowsAzureEndpointType.valueOf(comboType.getText())); windowsAzureRole.setDebuggingEndpoint(null); } else { retVal = false; } } else if (!waEndpt.getPrivatePort().equalsIgnoreCase(txtPrivatePort.getText())) { boolean isSuspended = windowsAzureRole.getStartSuspended(); windowsAzureRole.setDebuggingEndpoint(null); waEndpt.setPrivatePort(txtPrivatePort.getText()); windowsAzureRole.setDebuggingEndpoint(waEndpt); windowsAzureRole.setStartSuspended(isSuspended); } return retVal; }
/** change ui locale */ private void changeUILocale() { Object objLanguage = comboLanguage.getData(comboLanguage.getText()); if (objLanguage == null) { changeUILocale(comboLanguage.getItem(0)); } else { changeUILocale(comboLanguage.getText()); } }
protected void okPressed() { if ("".equals(sourceItemCombo.getText()) || SELECT_SENTENCE.equals(sourceItemCombo.getText())) { MessageDialog.openInformation(this.getShell(), "提示", "请选择触发项"); sourceItemCombo.setFocus(); return; } sourceItem = (MenuItem) sourceItemCombo.getData(sourceItemCombo.getText()); super.okPressed(); }
/** * Validates public and private ports. And also makes changes corresponding to the debug endpoint. * * @param oldEndptName : old name of the endpoint. * @return retVal : false if any error occurs. * @throws WindowsAzureInvalidProjectOperationException */ private boolean validatePorts(String oldEndptName) throws WindowsAzureInvalidProjectOperationException { boolean retVal = true; WindowsAzureEndpointType oldType = waEndpt.getEndPointType(); WindowsAzureEndpoint debugEndpt = windowsAzureRole.getDebuggingEndpoint(); WindowsAzureEndpoint stickyEndpt = windowsAzureRole.getSessionAffinityInputEndpoint(); WindowsAzureEndpoint stickyIntEndpt = windowsAzureRole.getSessionAffinityInternalEndpoint(); String stcEndptName = ""; String dbgEndptName = ""; String stcIntEndptName = ""; if (debugEndpt != null) { // get the debugging endpoint name dbgEndptName = debugEndpt.getName(); } if (stickyEndpt != null) { stcEndptName = stickyEndpt.getName(); stcIntEndptName = stickyIntEndpt.getName(); } // validate ports boolean isValidendpoint = windowsAzureRole.isValidEndpoint( oldEndptName, WindowsAzureEndpointType.valueOf(comboType.getText()), txtPrivatePort.getText(), txtPublicPort.getText()); if (isValidendpoint) { if (oldEndptName.equalsIgnoreCase(dbgEndptName)) { retVal = handleChangeForDebugEndpt(oldType); } if (oldEndptName.equalsIgnoreCase(stcEndptName)) { retVal = handleChangeForStickyEndpt(oldType); } if (oldEndptName.equalsIgnoreCase(stcIntEndptName)) { retVal = handleChangeForStickyEndpt(oldType); } if (retVal) { // set the new values in the endpoint object. waEndpt.setEndPointType(WindowsAzureEndpointType.valueOf(comboType.getText())); waEndpt.setName(txtName.getText()); if (comboType.getText().equalsIgnoreCase(WindowsAzureEndpointType.Input.toString()) || comboType .getText() .equalsIgnoreCase(WindowsAzureEndpointType.InstanceInput.toString())) { waEndpt.setPort(txtPublicPort.getText()); } waEndpt.setPrivatePort(txtPrivatePort.getText()); } } else { errorTitle = Messages.dlgInvldPort; errorMessage = Messages.dlgPortInUse; MessageUtil.displayErrorDialog(this.getShell(), errorTitle, errorMessage); retVal = false; } return retVal; }
private void dialogChanged() { getContainerObject(); setPageComplete(false); if (!validateLanguage(comboLanguage.getText())) return; if (!validateProject(comboProject.getText())) return; if (!validateFeature(comboFeature.getText())) return; if (!validatePackage(comboPackage.getText())) return; if (!validateModulename(textModulename.getText())) return; if (!validateClass(comboClass.getText())) return; setPageComplete(true); }
/** * Evaluates the page * * <p>This checks whether the current settings on the page make any sense. If everything is fine, * the settings are being put into the appropriate data container {@link ImportWizardModel} and * the current page is marked as complete by invoking {@link #setPageComplete(boolean)}. Otherwise * an error message is set, which will make sure the user is informed about the reason for the * error. */ private void evaluatePage() { setPageComplete(false); setErrorMessage(null); tablePreview.setVisible(false); if (comboLocation.getText().equals("")) { // $NON-NLS-1$ return; } try { if (!customLinebreak) { detectLinebreak(); comboLinebreak.select(selectedLinebreak); } if (!customDelimiter) { detectDelimiter(); comboDelimiter.select(selectedDelimiter); } readPreview(); } catch (IOException | IllegalArgumentException e) { setErrorMessage(e.getMessage()); return; } catch (TextParsingException e) { setErrorMessage(Resources.getMessage("ImportWizardPageCSV.16")); // $NON-NLS-1$ return; } catch (RuntimeException e) { if (e.getCause() != null) { setErrorMessage(e.getCause().getMessage()); } else { setErrorMessage(e.getMessage()); } return; } /* Put data into container */ ImportWizardModel data = wizardImport.getData(); data.setWizardColumns(wizardColumns); data.setPreviewData(previewData); data.setFirstRowContainsHeader(btnContainsHeader.getSelection()); data.setFileLocation(comboLocation.getText()); data.setCsvDelimiter(delimiters[selectedDelimiter]); data.setCsvQuote(quotes[selectedQuote]); data.setCsvEscape(escapes[selectedEscape]); data.setCharset( Charsets.getCharsetForName(Charsets.getNamesOfAvailableCharsets()[selectedCharset])); data.setCsvLinebreak( CSVSyntax.getLinebreakForLabel(CSVSyntax.getAvailableLinebreaks()[selectedLinebreak])); /* Mark page as completed */ setPageComplete(true); }
private void applySetting() { listener.applySetting( tName.getText(), tDefault.getText(), tID.getText(), cRequired.getSelection(), cReference.getText(), cType.getText()); listener.fillSettings(tSettings); setSettingStatus(tSettings.getSelectionCount() > 0); bRemove.setEnabled(tSettings.getSelectionCount() > 0); }
public DjangoSettings getSettings() { DjangoSettings s = new DjangoSettings(); // make it suitable to be written s.djangoVersion = djVersionCombo.getText(); s.databaseEngine = escapeSlashes(engineCombo.getText()); s.databaseName = escapeSlashes(nameText.getText()); s.databaseHost = escapeSlashes(hostText.getText()); s.databasePort = escapeSlashes(portText.getText()); s.databaseUser = escapeSlashes(userText.getText()); s.databasePassword = escapeSlashes(passText.getText()); return s; }
public void saveAction() { if ((comboKontrola_.getText() != "" && comboKontrola_.getText().length() > 0)) { Hashtable<String, String> data = new Hashtable<String, String>(); String temp = comboKontrola_.getText(); int t = temp.indexOf("-"); data.put("control_id", comboKontrola_.getText().substring(0, t)); data.put("risk_id", m_RiskId); // if(textPrimjena_.getText().equals("")){ // data.put("application",""); // } // else{ data.put("application", textPrimjena_.getText()); // } if (action == 2) { try { System.out.println("Hashtable" + data); dB.insertDataInDB("as_control_risk", data, "update", "SuggestMeasures", m_ControlRiskId); } catch (Exception e1) { e1.printStackTrace(); } } else { data.put("vulnerability_id", m_VulnerabilityId); data.put("threat_id", m_ThreatId); System.out.println("Hashtable" + data); try { dB.insertDataInDB("as_control_risk", data, "insert", "SuggestMeasures", ""); } catch (Exception e1) { e1.printStackTrace(); } } Notifier.notify( ResourceManager.getPluginImage("hr.ante.isms", "src/icons/tick.png"), "Spremanje uspješno", "Podaci su spremljeni", NotifierTheme.GREEN_THEME); fillForm(); } else Notifier.notify( ResourceManager.getPluginImage("hr.ante.isms", "src/icons/error.ico"), "Nemože se spremiti", "Niste unijeli sve potrebno podatke", NotifierTheme.RED_THEME); refreshTable(); }
/** Fills the class combo with class names of the same package at other features. */ private void initComboClassName() { String c = comboClass.getText(); Object obj = selection.getFirstElement(); if (obj instanceof IFile) { String fileExtension = ((IFile) obj).getFileExtension(); if (composer.extensions().contains(fileExtension)) { String fileName = ((IFile) obj).getName(); c = fileName.substring(0, fileName.lastIndexOf('.')); } } comboClass.removeAll(); LinkedList<String> inclusions = new LinkedList<String>(); LinkedList<String> exclusions = new LinkedList<String>(); if (featureProject.getComposer().hasFeatureFolder()) { try { for (IResource res : featureProject.getSourceFolder().members()) { if (res instanceof IFolder) { IFolder folder = (IFolder) res; if (folder.getName().equals(comboFeature.getText())) { exclusions = getClasses(folder); } else { for (String className : getClasses(folder)) { boolean added = false; if (!inclusions.contains(className)) { int i = 0; for (String name : inclusions) { if (className.compareToIgnoreCase(name) < 0) { inclusions.add(i, className); added = true; break; } i++; } if (!added) { inclusions.add(className); } } } } } } } catch (CoreException e) { UIPlugin.getDefault().logError(e); } } for (String className : inclusions) { if (!exclusions.contains(className)) { comboClass.add(className); } } comboClass.setText(c); }
@Override public boolean isPageComplete() { if (taskCombo.getText().equals(SELECT) || doiCombo.getText().equals(SELECT) || mentalModelCombo.getText().equals(SELECT) || integrateCombo.getText().equals(SELECT)) { // setErrorMessage("Must complete answers"); return false; } else { // setErrorMessage(null); return true; } }
IContainer getContainerObject() { if (composer != null) { IFolder folder = composer.createFolderForFeatures() ? sourceFolder.getFolder(comboFeature.getText()) : sourceFolder; for (String packageName : comboPackage.getText().split("[.]")) { folder = folder.getFolder(packageName); } container = folder; } return container; }
private void doGetFields() { try { List<String> cubeDimensions = null; if (comboCube.getText() != null && comboCube.getText() != "") { if (addConnectionLine.getText() != null) { DatabaseMeta dbMeta = transMeta.findDatabase(addConnectionLine.getText()); if (dbMeta != null) { PaloCellOutputData data = new PaloCellOutputData(dbMeta); data.helper.connect(); cubeDimensions = data.helper.getCubeDimensions(comboCube.getText()); data.helper.disconnect(); } } tableViewFields.table.removeAll(); for (int i = 0; i < cubeDimensions.size(); i++) { final TableItem item = new TableItem(tableViewFields.table, SWT.NONE); item.setText(1, cubeDimensions.get(i)); // item.setText(3, "String"); } final TableItem item = new TableItem(tableViewFields.table, SWT.NONE); item.setText(1, "Cube Measure"); item.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GREEN)); tableViewFields.removeEmptyRows(); tableViewFields.setRowNums(); tableViewFields.optWidth(true); tableViewFields.setReadonly(true); } else { new ErrorDialog( shell, BaseMessages.getString(PKG, "System.Dialog.GetFieldsFailed.Title"), BaseMessages.getString(PKG, "System.Dialog.GetFieldsFailed.Message"), new Exception( BaseMessages.getString(PKG, "PaloCellOutputDialog.SelectCubeFirstError"))); } this.fillPreviousFieldTableViewColumn(); } catch (KettleException ke) { new ErrorDialog( shell, BaseMessages.getString(PKG, "System.Dialog.GetFieldsFailed.Title"), BaseMessages.getString(PKG, "System.Dialog.GetFieldsFailed.Message"), ke); } }
/** * 通过过滤条件获得相应的消息 * * @throws Exception */ @SuppressWarnings("unchecked") public void retrieveData() throws Exception { List input = (List) tv.getInput(); if (input != null) { input.clear(); } MessageService ms = AppContext.getInstance().getMessageService(); List<Message> list_messages = null; if (executeMethod.getText().equals("查询所有")) { list_messages = ms.getAllMessages(); } else { list_messages = ms.getMessages( executeSender.getText(), executeReceiver.getText(), beginDateText.getDate(), endDateText.getDate()); } if (list_messages != null && !list_messages.isEmpty()) { for (Message msg : list_messages) { DeptMessageTableViewLabelProvider dp = new DeptMessageTableViewLabelProvider(msg); input.add(dp); } } else { MessageUtil.ShowHintMessage(getShell(), "没有查询到数据!"); } tv.setInput(input); }
boolean doFetch() { try { final RefSpec spec = new RefSpec().setSource(refText.getText()).setDestination(Constants.FETCH_HEAD); final String uri = uriCombo.getText(); final boolean doCheckout = checkout.getSelection(); final boolean doCreateTag = createTag.getSelection(); final boolean doCreateBranch = createBranch.getSelection(); final boolean doActivateAdditionalRefs = (checkout.getSelection() || dontCheckout.getSelection()) && activateAdditionalRefs.getSelection(); final String textForTag = tagText.getText(); final String textForBranch = branchText.getText(); getWizard() .getContainer() .run( true, true, new IRunnableWithProgress() { public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { int totalWork = 1; if (doCheckout) totalWork++; if (doCreateTag || doCreateBranch) totalWork++; monitor.beginTask(UIText.FetchGerritChangePage_GetChangeTaskName, totalWork); try { RevCommit commit = fetchChange(uri, spec, monitor); if (doCreateTag) { createTag(spec, textForTag, commit, monitor); } if (doCreateBranch) { createBranch(textForBranch, commit, monitor); } if (doCheckout || doCreateTag) { checkout(commit, monitor); } if (doActivateAdditionalRefs) { activateAdditionalRefs(); } storeLastUsedUri(uri); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new InvocationTargetException(e); } finally { monitor.done(); } } }); } catch (InvocationTargetException e) { Activator.handleError(e.getCause().getMessage(), e.getCause(), true); return false; } catch (InterruptedException e) { // just return } return true; }
public ILaunchConfiguration getSelectedLaunchConfiguration() { if (!fLaunchConfigButton.getSelection()) return null; String configName = fLaunchConfigCombo.getText(); try { ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager(); ILaunchConfigurationType type = manager.getLaunchConfigurationType(EclipseLaunchShortcut.CONFIGURATION_TYPE); ILaunchConfigurationType type2 = manager.getLaunchConfigurationType(IPDELauncherConstants.OSGI_CONFIGURATION_TYPE); ILaunchConfiguration[] configs = manager.getLaunchConfigurations(type); ILaunchConfiguration[] configs2 = manager.getLaunchConfigurations(type2); ILaunchConfiguration[] configurations = new ILaunchConfiguration[configs.length + configs2.length]; System.arraycopy(configs, 0, configurations, 0, configs.length); System.arraycopy(configs2, 0, configurations, configs.length, configs2.length); for (int i = 0; i < configurations.length; i++) { if (configurations[i].getName().equals(configName) && !DebugUITools.isPrivate(configurations[i])) return configurations[i]; } } catch (CoreException e) { PDEPlugin.logException(e); } return null; }
/** * Return the HTML for the selected html doc type * * @return defaults to HTML.TRANSITIONAL_XHTML10 */ public HTML getSelectedHTMLDocType() { if (_bodyCheckbox.getSelection()) { return getHTMLForDisplayString(_htmlCombo.getText()); } return HTML.TRANSITIONAL_XHTML10; }
@Override public void widgetDefaultSelected(SelectionEvent e) { if (e.getSource().equals(cmbDirectoryLocation)) { final String newDirectory = cmbDirectoryLocation.getText(); if (newDirectory != null && newDirectory.length() > 0) { newDirectory.trim(); addToHistory(); resetHistory(); String[] oldDirs = cmbDirectoryLocation.getItems(); boolean foundEntry = false; for (int i = 0; i < oldDirs.length; i++) { if (newDirectory.equals(oldDirs[i])) { foundEntry = true; break; } } if (!foundEntry) { if (cmbDirectoryLocation.getItemCount() > 0) cmbDirectoryLocation.add(newDirectory, 0); else cmbDirectoryLocation.add(newDirectory); } resetPlaying(true); spawnLoadJob(newDirectory); currentDir = newDirectory; } } }
/** called everytime a combo's or textfield's input changes */ private void dialogChanged() { if (tagTypeCombo.getSelectionIndex() > -1) { generationCombo.setEnabled(true); if (generationCombo.getSelectionIndex() > -1) { tagNrSpinner.setEnabled(true); if (tagNrSpinner.getSelection() > 0) { if (tagTypeCombo.getText().equals(TagType.CustomEPC96.toString())) { tagPrefixText.setEnabled(true); if (tagPrefixText.getText().length() < 24) { String errorString = hexValidator.isValid(tagPrefixText.getText()); if (errorString == null) { setErrorMessage(null); setPageComplete(true); } else { setErrorMessage(errorString); setPageComplete(false); } } } else { setPageComplete(true); } } } } }
private void refresh(boolean fromText) { String loc = comboDataBase.getText(); int index = -1; for (int i = 0; i < recent.size(); ++i) if (recent.get(i).getValue1().equals(loc)) { index = i; break; } int lang; if (index >= 0 && fromText) { lang = recent.get(index).getValue2(); comboLanguage.select(lang); } else { lang = comboLanguage.getSelectionIndex(); if (lang < 0) return; } text.setText(_text[lang]); labelDataBase.setText(_database[lang]); buttonBrowse.setText(_browse[lang]); labelLanguage.setText(_language[lang]); buttonOk.setText(_ok[lang]); buttonCancel.setText(_cancel[lang]); getDialogPanel().layout(true, true); resize(); }
/** * Get the metamodel type. Possible returns values are entirely data-driven by the metadata, so no * constants exist, just returning a String. * * @return the metamodel type */ public String getMetamodelType() { String metamodelType = metamodelCombo.getText(); if (metamodelType.equals(CHOOSE_A_METAMODEL)) { metamodelType = null; } return metamodelType; }