List of usage examples for org.eclipse.jface.dialogs IDialogConstants MINIMUM_MESSAGE_AREA_WIDTH
int MINIMUM_MESSAGE_AREA_WIDTH
To view the source code for org.eclipse.jface.dialogs IDialogConstants MINIMUM_MESSAGE_AREA_WIDTH.
Click Source Link
From source file:com.aptana.ui.dialogs.HyperlinkMessageDialog.java
License:Open Source License
@Override protected Control createMessageArea(Composite composite) { String message = this.message; this.message = null; Composite messageArea = (Composite) super.createMessageArea(composite); messageLink = new Link(messageArea, getMessageLabelStyle() | SWT.NO_FOCUS); messageLink.setText("<a></a>" + message); //$NON-NLS-1$ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.BEGINNING).grab(true, false) .hint(convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH), SWT.DEFAULT) .applyTo(messageLink);/*from ww w . j a v a 2 s .c o m*/ messageLink.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { openLink(e); } }); return messageArea; }
From source file:com.asakusafw.shafu.internal.ui.dialogs.InputWithHistoryDialog.java
License:Apache License
@Override protected Control createDialogArea(Composite parent) { Composite pane = (Composite) super.createDialogArea(parent); GridLayout layout = (GridLayout) pane.getLayout(); layout.verticalSpacing = 0;//from w w w.ja v a 2 s .c om Label label = new Label(pane, SWT.NONE); if (fieldTitle != null) { label.setText(fieldTitle); } label.setLayoutData(GridDataFactory.swtDefaults().align(SWT.FILL, SWT.BEGINNING).grab(true, false) .hint(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH, SWT.DEFAULT).create()); this.valueField = new Combo(pane, SWT.DROP_DOWN); valueField.setItems(history.toArray(new String[history.size()])); if (defaultValue != null) { valueField.setText(defaultValue); } valueField.setLayoutData( GridDataFactory.swtDefaults().align(SWT.FILL, SWT.BEGINNING).grab(true, false).create()); valueField.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent e) { onModify(); } }); onModify(); applyDialogFont(pane); return pane; }
From source file:com.asakusafw.shafu.internal.ui.dialogs.PropertyEntryInputDialog.java
License:Apache License
private Label createLabel(Composite pane, String title, int hMargin) { Label label = new Label(pane, SWT.NONE); label.setText(title);/* w w w . j a v a 2 s . co m*/ label.setLayoutData(GridDataFactory.swtDefaults().align(SWT.FILL, SWT.BEGINNING).grab(true, false) .indent(BasicField.getDecorationWidth(), this.convertVerticalDLUsToPixels(hMargin)) .hint(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH, SWT.DEFAULT).create()); return label; }
From source file:com.ashigeru.eclipse.internal.codereading.ui.dialogs.LogEditDialog.java
License:Apache License
private void createLogFileSection(Composite pane) { assert pane != null; Label label = new Label(pane, SWT.NONE); label.setText("Log File:"); GridDataFactory.swtDefaults().span(2, 1).hint(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH, SWT.DEFAULT) .align(SWT.FILL, SWT.BEGINNING).grab(true, false).applyTo(label); this.fieldLogFile = new Text(pane, SWT.SINGLE | SWT.BORDER); if (defaultLogFile != null) { fieldLogFile.setText(defaultLogFile.getPath()); }/* w w w . j a va2 s . c om*/ GridDataFactory.swtDefaults().indent(FieldDecorationRegistry.getDefault().getMaximumDecorationWidth(), 0) .align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(fieldLogFile); this.decorationLogFile = new ControlDecoration(fieldLogFile, SWT.LEFT | SWT.TOP); decorationLogFile.setDescriptionText("Log file must be specified."); Button browse = new Button(pane, SWT.PUSH); browse.setText("Browse"); GridDataFactory.swtDefaults().align(SWT.FILL, SWT.CENTER).grab(false, false).applyTo(browse); fieldLogFile.addListener(SWT.Modify, new Listener() { @Override public void handleEvent(Event event) { onModifyLogFle(); } }); browse.addListener(SWT.Selection, new Listener() { @Override public void handleEvent(Event event) { onSelectLogFile(); } }); }
From source file:com.ashigeru.eclipse.internal.codereading.ui.dialogs.LogEditDialog.java
License:Apache License
private void createLogContentsSection(Composite pane) { assert pane != null; Label label = new Label(pane, SWT.NONE); label.setText("Contents:"); GridDataFactory.swtDefaults().align(SWT.FILL, SWT.BEGINNING).span(2, 1) .hint(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH, SWT.DEFAULT).grab(true, false).applyTo(label); this.fieldLogContents = new TextViewer(pane, SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL); fieldLogContents.setEditable(true);/*from w w w . j a v a2 s. c om*/ GridDataFactory.swtDefaults().align(SWT.FILL, SWT.FILL).span(2, 1) .hint(convertWidthInCharsToPixels(80), convertHeightInCharsToPixels(20)).grab(true, true) .applyTo(fieldLogContents.getControl()); fieldLogContents.setDocument(document); fieldLogContents.getControl().setFont(JFaceResources.getFont(JFaceResources.TEXT_FONT)); }
From source file:com.axmor.eclipse.typescript.core.ui.ErrorDialog.java
License:Open Source License
@Override protected Control createMessageArea(Composite composite) { // create composite // create image Image image = getImage();/*from ww w .ja va 2s . co m*/ if (image != null) { imageLabel = new Label(composite, SWT.NULL); image.setBackground(imageLabel.getBackground()); imageLabel.setImage(image); imageLabel.getAccessible().addAccessibleListener(new AccessibleAdapter() { @Override public void getName(AccessibleEvent event) { final String accessibleMessage = JFaceResources.getString("error"); if (accessibleMessage == null) { return; } event.result = accessibleMessage; } }); GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.BEGINNING).applyTo(imageLabel); } // create message if (message != null) { FormToolkit toolkit = new FormToolkit(Display.getDefault()); Composite toolkitComp = toolkit.createComposite(composite); toolkitComp.setLayout(new FillLayout(SWT.HORIZONTAL | SWT.VERTICAL)); FormText text = toolkit.createFormText(toolkitComp, false); text.setText(message, true, true); text.setBackground(composite.getBackground()); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.BEGINNING).grab(true, false) .hint(convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH), SWT.DEFAULT) .applyTo(toolkitComp); text.addHyperlinkListener(new HyperlinkAdapter() { public void linkActivated(HyperlinkEvent event) { try { URI uri = URI.create((String) event.data); IWebBrowser browser = PlatformUI.getWorkbench().getBrowserSupport() .createBrowser("error_editor_dialog"); browser.openURL(uri.toURL()); } catch (Exception e) { Activator.error(e); } } }); } return composite; }
From source file:com.centurylink.mdw.plugin.designer.dialogs.MdwProgressMonitorDialog.java
License:Apache License
protected Control createMessageArea(Composite composite) { Image image = getImage();/* w w w . j av a2s . c om*/ if (image != null) { imageLabel = new Label(composite, SWT.NULL); image.setBackground(imageLabel.getBackground()); imageLabel.setImage(image); GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.BEGINNING).applyTo(imageLabel); } // create message if (message != null) { messageLabel = new Label(composite, getMessageLabelStyle()); messageLabel.setText(message); FontData font = messageLabel.getFont().getFontData()[0]; font.setStyle(font.getStyle() | SWT.BOLD); messageLabel.setFont(new Font(this.getShell().getDisplay(), font)); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.BEGINNING).grab(true, false) .hint(convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH), SWT.DEFAULT) .applyTo(messageLabel); } return composite; }
From source file:com.drgarbage.bytecodevisualizer.actions.DebugFunctionalityInfoDialog.java
License:Apache License
@Override protected Control createMessageArea(Composite composite) { Composite result = (Composite) super.createMessageArea(composite); Composite area = new Composite(result, SWT.NONE); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.BEGINNING).grab(true, false) .hint(convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH), SWT.DEFAULT) .applyTo(area);/* w w w . j a va 2 s. c o m*/ GridLayout layout = new GridLayout(); layout.marginWidth = layout.marginHeight = 0; layout.numColumns = 1; area.setLayout(layout); Label lbl = null; Link link = null; lbl = new Label(area, SWT.NONE); lbl.setText( BytecodeVisualizerMessages.ToggleBreakpointAction_tooltipText_Debug_functionality_is_unavailable_in_this_context_); lbl.setLayoutData(new GridData(GridData.FILL_BOTH)); JFaceUtils.toBold(lbl); lbl = new Label(area, SWT.NONE); lbl.setText(BytecodeVisualizerMessages.DebugFunctionalityInfoDialog_lbl_Your_class_or_jar_file_needs_); lbl.setLayoutData(new GridData(GridData.FILL_BOTH)); ListPanel lp = new ListPanel(area, SWT.NONE, SWT.WRAP); lp.setNumbered(true); GridData gd = new GridData(); gd.horizontalAlignment = SWT.FILL; gd.verticalAlignment = SWT.BEGINNING; gd.horizontalIndent = IDialogConstants.HORIZONTAL_MARGIN * 2; lp.getControl().setLayoutData(gd); //lp.getControl().setBackground(infoBg); lp.addText( BytecodeVisualizerMessages.DebugFunctionalityInfoDialog_lbl_i_included_in_some_java_projects_build_path_and); String msg = MessageFormat.format( BytecodeVisualizerMessages.DebugFunctionalityInfoDialog_lbl_ii_opened_using_0_1_or_similar_feature_of_2_, new Object[] { CoreMessages.lbl_Package_Explorer, CoreMessages.lbl_Open_Declaration, CoreMessages.lbl_Java_Development_Tools_JDT_Plugin }); lp.addText(msg); msg = MessageFormat.format( BytecodeVisualizerMessages.DebugFunctionalityInfoDialog_link_Please_read_0_this_tutorial_for_more_details_, new Object[] { Links.HOW_TO_DEBUG_BYTECODE_WITH_BYTECODE_VISUALIZER }); link = LinkFactory.createHttpPathLink(area, SWT.NONE); link.setText(msg); gd = new GridData(); gd.horizontalAlignment = SWT.FILL; gd.verticalAlignment = SWT.BEGINNING; gd.verticalIndent = IDialogConstants.VERTICAL_SPACING; link.setLayoutData(gd); return result; }
From source file:com.drgarbage.core.jface.ListPanel.java
License:Apache License
public ListPanel(Composite parent, int style, int itemStyle) { this(parent, style, itemStyle, IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); }
From source file:com.genuitec.eclipse.gerrit.tools.utils.MessageLinkDialog.java
License:Open Source License
/** * Returns the minimum message area width in pixels This determines the * minimum width of the dialog.// www . ja va 2s . c om * <p> * Subclasses may override. * </p> * * @return the minimum message area width (in pixels) */ protected int getMinimumMessageWidth() { return convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); }