@Override public void widgetSelected(SelectionEvent e) { if (!currentText) { imageType.setEnabled(false); textType.setEnabled(true); if (label != null && !label.isDisposed()) { label.setVisible(false); label.dispose(); } text = new Text(grpValue, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI); text.setEditable(false); text.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1)); text.setText(value); tranformText(textType, text); currentText = true; } } });
public TokenSelectorNoDescrPage(Composite parent, int style) { super(parent, style); listDescr.dispose(); }
private void scalebyLabel(Composite comp) { Label label = new Label(comp,SWT.NONE); label.setText(scaleText); Point p = label.computeSize(SWT.DEFAULT,SWT.DEFAULT); double fx = (p.x-1)/44.55; double fy = p.y-1; //rem: divide first to overcome rounding errors in case of fx==SmallBaseX and fy==SmallBaseY factorX = (fx/smallBaseX); //+0.08; factorY = (fy/smallBaseY); //+0.08; label.dispose(); }
public void release() { if (label != null) label.dispose(); if (image != null) image.dispose(); }
private void scalebyLabel(Composite comp) { Label label = new Label(comp,SWT.NONE); label.setText(scaleText); Point p = label.computeSize(SWT.DEFAULT,SWT.DEFAULT); double fx = (p.x-1)/44.55; double fy = p.y-1; //rem: divide first to overcome rounding errors in case of fx==SmallBaseX and fy==SmallBaseY factorX = (fx/smallBaseX); //+0.08; factorY = (fy/smallBaseY); //+0.08; label.dispose(); }
/** * Disable size enter. */ private void disableSizeEnter() { if (isArraySizeDisplayed) { sizeLabel.dispose(); sizeText.dispose(); isArraySizeDisplayed = false; } }
public void showError(String message) { internalDispose(); if(howToBegin != null) { howToBegin.dispose(); howToBegin = null; } createErrorPage(message); }
/** * Dispose of the label. We need to do this whether the label was used or not. */ @Override public void finishProgress(final FileEpisode episode) { if (!display.isDisposed()) { display.asyncExec(() -> { if ((label != null) && (!label.isDisposed())) { label.dispose(); } ui.finishMove(item, episode); }); } } }
private void initialize(final Composite composite) { // need to initalize composite now, since getComposite can // be called at any time cConfig = new Composite(composite, SWT.NONE); GridLayout configLayout = new GridLayout(); configLayout.marginHeight = 0; configLayout.marginWidth = 0; cConfig.setLayout(configLayout); GridData gridData = new GridData(GridData.FILL_BOTH); cConfig.setLayoutData(gridData); final Label label = new Label(cConfig, SWT.CENTER); Messages.setLanguageText(label, "view.waiting.core"); gridData = new GridData(GridData.FILL_BOTH); label.setLayoutData(gridData); // Need to delay initialation until core is done so we can guarantee // all config sections are loaded (ie. plugin ones). // TODO: Maybe add them on the fly? CoreFactory.addCoreRunningListener(core -> Utils.execSWTThread(() -> { _initialize(composite); label.dispose(); composite.layout(true, true); })); }
/** * Deletes the language line at the given index. * * @param langComposite the language composite * @param index the index */ private void deleteLangLine( Composite langComposite, int index ) { LangLine langLine = langLineList.remove( index ); if ( langLine != null ) { langLine.langLabel.dispose(); langLine.languageCombo.dispose(); langLine.minusLabel.dispose(); langLine.countryCombo.dispose(); langLine.addButton.dispose(); langLine.deleteButton.dispose(); if ( !langComposite.isDisposed() ) { shell.layout( true, true ); } } }
/** * Enables or disables showing of the caption line. See also {@link #setMessage(String)}. * * @param show <code>true</code> if the status line is visible * @since 3.2 */ public void setStatusLineVisible(boolean show) { if (!isActive() || show == (fMessageText != null)) return; // nothing to do if (show) { createMessageText(); } else { fMessageText.dispose(); fMessageText= null; } fProposalShell.layout(); }
public static void inputInit(ActionContext actionContext){ Shell shell = actionContext.getObject("shell"); Label messageLabel = actionContext.getObject("messageLabel"); Text text = actionContext.getObject("text"); String title = actionContext.getString("title"); String message = actionContext.getString("message"); if(title != null){ shell.setText(title); } if(message != null){ messageLabel.setText(message); }else{ messageLabel.dispose(); } String value = actionContext.getString("value"); if(value != null){ text.setText(value); } }
/** * Enables or disables showing of the caption line. See also {@link #setMessage(String)}. * * @param show <code>true</code> if the status line is visible * @since 3.2 */ public void setStatusLineVisible(boolean show) { if (!isActive() || show == (fMessageText != null && !fMessageText.isDisposed())) return; // nothing to do if (show) { createMessageText(); } else { fMessageText.dispose(); fMessageText= null; } fProposalShell.layout(); }
/** * Delete the Rdn line on the given index. * * @param rdnComposite the Rdn composite * @param index the index */ private void deleteRdnLine( Composite rdnComposite, int index ) { RdnLine rdnLine = rdnLineList.remove( index ); if ( rdnLine != null ) { rdnLine.rdnTypeCombo.dispose(); rdnLine.rdnEqualsLabel.dispose(); rdnLine.rdnValueText.dispose(); rdnLine.rdnAddButton.dispose(); rdnLine.rdnDeleteButton.dispose(); if ( !rdnComposite.isDisposed() ) { shell.layout( true, true ); } } }
/** * Disposes the source viewer and all associated widgetry. */ protected void disposeSourceViewer() { if(fActivation != null) { fService.deactivateHandler(fActivation); } if (fSourceViewer != null) { fSourceViewer.getDocument().removeDocumentListener(fDocumentListener); fSourceViewer.getTextWidget().dispose(); fSourceViewer.dispose(); fSourceViewer= null; } if (fEvaluateLabel != null) { fEvaluateLabel.dispose(); fEvaluateLabel= null; } fDocumentListener= null; fCompletionProcessor= null; }
public void dispose() { if (checkDoneLabel != null) checkDoneLabel.dispose(); if (bodyText != null) bodyText.dispose(); if (buttonComposite != null) buttonComposite.dispose(); if (completionComposite != null) completionComposite.dispose(); if (bodyComp != null) bodyComp.dispose(); if (bodyWrapperComposite != null) bodyWrapperComposite.dispose(); if (mainItemComposite != null) mainItemComposite.dispose(); if (titleComposite != null) titleComposite.dispose(); if (regularFont != null) regularFont.dispose(); ArrayList<AbstractItemExtensionElement[]> itemExts = item.getItemExtensions(); if (itemExts != null) { for (int g = 0; g < itemExts.size(); g++) { AbstractItemExtensionElement[] eea = itemExts.get(g); for (int x = 0; x < eea.length; x++) { eea[x].dispose(); } } } }