private void resetAllFields() { fSelectedCommand = null; fComIDT.setText(PDEUIMessages.CommandDetails_noComSelected); fParamLabel.setText(PDEUIMessages.CommandDetails_noParameters); if (fComPrev != null) fComPrev.setText(""); //$NON-NLS-1$ fExecLink.setVisible(false); fCopyLink.setVisible(false); fParameterToValue.clear(); fObjectParamList.clear(); fValueParamList.clear(); createNoParamComp(); }
/** * Hide or reveal all the action/complete/skip buttons * @param isVisible */ public void setButtonsVisible(boolean isVisible) { if (startButton != null) { startButton.setVisible(isVisible); } if (skipButton != null) { skipButton.setVisible(isVisible); } if (completeButton != null) { completeButton.setVisible(isVisible); } }
public void showDetailsFor(Object object) { if (object instanceof ParameterizedCommand) object = (fPreSel = (ParameterizedCommand) object).getCommand(); if (!(object instanceof Command)) { resetAllFields(); return; } fSelectedCommand = (Command) object; fComIDT.setText(fSelectedCommand.getId()); fParameterToValue.clear(); fObjectParamList.clear(); fValueParamList.clear(); fExecLink.setVisible(fSelectedCommand.isEnabled()); fCopyLink.setVisible(true); try { populateParams(fSelectedCommand, object); } catch (NotDefinedException e) { createNoParamComp(); } updatePreviewText(); }
private void updateLinks(String href) { Control [] children = linkContainer.getChildren(); for (int i=0; i<children.length; i++) { ImageHyperlink link = (ImageHyperlink)children[i]; RowData data = (RowData)link.getLayoutData(); data.exclude = link.getHref().equals(href); link.setVisible(!data.exclude); } linkContainer.layout(); helpPart.reflow(); }
private void createFilterText(Composite parent) { Composite c = fCCP.createComposite(parent, GridData.FILL_HORIZONTAL, 3, false, 0); fFilterText = fToolkit.createText(c, "", SWT.BORDER); //$NON-NLS-1$ fFilterText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); fFilterText.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { if (e.keyCode == SWT.ARROW_DOWN) fTreeViewer.getControl().setFocus(); } }); final ImageHyperlink clearButton = fToolkit.createImageHyperlink(c, SWT.NONE); final Image hoverImg = PDEPluginImages.DESC_CLEAR.createImage(); clearButton.setImage(hoverImg); clearButton.setToolTipText(PDEUIMessages.CommandList_clearTooltip); clearButton.addDisposeListener(e -> hoverImg.dispose()); clearButton.addHyperlinkListener(new HyperlinkAdapter() { @Override public void linkActivated(HyperlinkEvent e) { fFilterText.setText(""); //$NON-NLS-1$ } }); clearButton.setVisible(false); fFilterText.addModifyListener(e -> { fTreeViewer.refresh(); clearButton.setVisible(fFilterText.getText().length() > 0); }); }
prevLink.setVisible(resultOffset > 0); nextLink.setVisible(hits.size() > resultOffset + HITS_PER_PAGE); } else { if (prevLink != null) {
private void createLinks(Composite parent) { Composite comp = fCCP.createComposite(parent, GridData.FILL_HORIZONTAL | GridData.HORIZONTAL_ALIGN_END, 1, false, 0); fExecLink = fToolkit.createImageHyperlink(comp, SWT.NONE); final Image execImage = PDEPluginImages.DESC_RUN_EXC.createImage(); fExecLink.setImage(execImage); fExecLink.setText(PDEUIMessages.CommandDetails_executeText); fExecLink.setToolTipText(PDEUIMessages.CommandDetails_execute); fExecLink.addHyperlinkListener(new ExecCommand()); fExecLink.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); fExecLink.setVisible(false); fExecLink.addDisposeListener(e -> execImage.dispose()); fCopyLink = fToolkit.createImageHyperlink(comp, SWT.NONE); final Image clipImage = PDEPluginImages.DESC_CLIPBOARD.createImage(); fCopyLink.setImage(clipImage); fCopyLink.setText(PDEUIMessages.CommandDetails_copyToClipboard); fCopyLink.setToolTipText(PDEUIMessages.CommandDetails_copytooltip); fCopyLink.addHyperlinkListener(new CopyToClipboard()); fCopyLink.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); fCopyLink.setVisible(false); fCopyLink.addDisposeListener(e -> clipImage.dispose()); }