Example usage for org.eclipse.jface.resource JFaceResources DIALOG_FONT

List of usage examples for org.eclipse.jface.resource JFaceResources DIALOG_FONT

Introduction

In this page you can find the example usage for org.eclipse.jface.resource JFaceResources DIALOG_FONT.

Prototype

String DIALOG_FONT

To view the source code for org.eclipse.jface.resource JFaceResources DIALOG_FONT.

Click Source Link

Document

The symbolic font name for the dialog font (value "org.eclipse.jface.dialogfont").

Usage

From source file:net.tourbook.preferences.PrefPageStatisticTourFrequency.java

License:Open Source License

private void createFieldsAltitude(final Composite parent) {

    Label label;/*from w w w  .j  a v a2  s .  com*/
    GridData gridData;

    // title
    label = new Label(parent, SWT.NONE);
    label.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT));
    gridData = new GridData();
    label.setLayoutData(gridData);
    label.setText(Messages.Pref_Statistic_Label_altitude);

    // altitude example
    _lblAltitudeExampleLabel = new Label(parent, SWT.NONE);
    GridDataFactory.fillDefaults()//
            .grab(true, false)
            //            .hint(200, SWT.DEFAULT)
            .applyTo(_lblAltitudeExampleLabel);

    // low value
    _editorAltitudeLowValue = new IntegerFieldEditor(ITourbookPreferences.STAT_ALTITUDE_LOW_VALUE,
            Messages.Pref_Statistic_Label_altitude_low_value, parent, 4);
    UI.setFieldWidth(parent, _editorAltitudeLowValue, UI.DEFAULT_FIELD_WIDTH);
    addField(_editorAltitudeLowValue);

    // interval
    _editorAltitudeInterval = new IntegerFieldEditor(ITourbookPreferences.STAT_ALTITUDE_INTERVAL,
            Messages.Pref_Statistic_Label_interval, parent, 4);
    UI.setFieldWidth(parent, _editorAltitudeInterval, UI.DEFAULT_FIELD_WIDTH);
    addField(_editorAltitudeInterval);

    // numbers
    _editorAltitudeNumbers = new IntegerFieldEditor(ITourbookPreferences.STAT_ALTITUDE_NUMBERS,
            Messages.Pref_Statistic_Label_altitude_quantity, parent, 2);
    _editorAltitudeNumbers.setValidRange(2, 99);
    UI.setFieldWidth(parent, _editorAltitudeNumbers, UI.DEFAULT_FIELD_WIDTH);
    addField(_editorAltitudeNumbers);

    _editorAltitudeLowValue.setPropertyChangeListener(this);
    _editorAltitudeInterval.setPropertyChangeListener(this);
    _editorAltitudeNumbers.setPropertyChangeListener(this);
}

From source file:net.tourbook.preferences.PrefPageStatisticTourFrequency.java

License:Open Source License

private void createFieldsDistance(final Composite parent) {

    Label label;//from ww w . j a v  a 2 s. co m

    // title
    label = new Label(parent, SWT.NONE);
    label.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT));
    label.setText(Messages.Pref_Statistic_Label_distance);

    // distance example
    _lblDistanceExampleLabel = new Label(parent, SWT.NONE);
    GridDataFactory.fillDefaults()//
            .grab(true, false)
            //            .hint(200, SWT.DEFAULT)
            .applyTo(_lblDistanceExampleLabel);

    // low value
    _editorDistanceLowValue = new IntegerFieldEditor(ITourbookPreferences.STAT_DISTANCE_LOW_VALUE,
            Messages.Pref_Statistic_Label_distance_low_value, parent, 4);
    UI.setFieldWidth(parent, _editorDistanceLowValue, UI.DEFAULT_FIELD_WIDTH);
    addField(_editorDistanceLowValue);

    // interval
    _editorDistanceInterval = new IntegerFieldEditor(ITourbookPreferences.STAT_DISTANCE_INTERVAL,
            Messages.Pref_Statistic_Label_interval, parent, 4);
    UI.setFieldWidth(parent, _editorDistanceInterval, UI.DEFAULT_FIELD_WIDTH);
    addField(_editorDistanceInterval);

    // numbers
    _editorDistanceNumbers = new IntegerFieldEditor(ITourbookPreferences.STAT_DISTANCE_NUMBERS,
            Messages.Pref_Statistic_Label_distance_quantity, parent, 2);
    UI.setFieldWidth(parent, _editorDistanceNumbers, UI.DEFAULT_FIELD_WIDTH);
    addField(_editorDistanceNumbers);

    _editorDistanceLowValue.setPropertyChangeListener(this);
    _editorDistanceInterval.setPropertyChangeListener(this);
    _editorDistanceNumbers.setPropertyChangeListener(this);
}

From source file:net.tourbook.preferences.PrefPageStatisticTourFrequency.java

License:Open Source License

private void createFieldsDuration(final Composite parent) {

    Label label;/*from   w  ww . j  ava  2s.c  o  m*/
    GridData gridData;

    // title
    label = new Label(parent, SWT.NONE);
    label.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT));
    gridData = new GridData();
    label.setLayoutData(gridData);
    label.setText(Messages.Pref_Statistic_Label_duration);

    // duration example
    _lblDurationExampleLabel = new Label(parent, SWT.NONE);
    GridDataFactory.fillDefaults()//
            .grab(true, false)
            //            .hint(200, SWT.DEFAULT)
            .applyTo(_lblDurationExampleLabel);

    // low value
    _editorDurationLowValue = new IntegerFieldEditor(ITourbookPreferences.STAT_DURATION_LOW_VALUE,
            Messages.Pref_Statistic_Label_duration_low_value, parent, 4);
    UI.setFieldWidth(parent, _editorDurationLowValue, UI.DEFAULT_FIELD_WIDTH);
    addField(_editorDurationLowValue);

    // interval
    _editorDurationInterval = new IntegerFieldEditor(ITourbookPreferences.STAT_DURATION_INTERVAL,
            Messages.Pref_Statistic_Label_duration_interval, parent, 4);
    UI.setFieldWidth(parent, _editorDurationInterval, UI.DEFAULT_FIELD_WIDTH);
    addField(_editorDurationInterval);

    // numbers
    _editorDurationNumbers = new IntegerFieldEditor(ITourbookPreferences.STAT_DURATION_NUMBERS,
            Messages.Pref_Statistic_Label_duration_quantity, parent, 2);
    UI.setFieldWidth(parent, _editorDurationNumbers, UI.DEFAULT_FIELD_WIDTH);
    addField(_editorDurationNumbers);

    _editorDurationLowValue.setPropertyChangeListener(this);
    _editorDurationInterval.setPropertyChangeListener(this);
    _editorDurationNumbers.setPropertyChangeListener(this);
}

From source file:net.tourbook.tour.TourInfoUI.java

License:Open Source License

public Composite createContentArea(final Composite parent, final TourData tourData,
        final IToolTipProvider tourToolTipProvider, final ITourProvider tourProvider) {

    _tourData = tourData;//ww  w  .  j a  v  a2s.  c  o  m
    _tourToolTipProvider = tourToolTipProvider;
    _tourProvider = tourProvider;

    final Display display = parent.getDisplay();

    _bgColor = display.getSystemColor(SWT.COLOR_INFO_BACKGROUND);
    _fgColor = display.getSystemColor(SWT.COLOR_INFO_FOREGROUND);
    _boldFont = JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT);

    final Set<TourTag> tourTags = _tourData.getTourTags();
    final String tourDescription = _tourData.getTourDescription();

    // date/time created/modified
    _uiDtCreated = _tourData.getDateTimeCreated();
    _uiDtModified = _tourData.getDateTimeModified();

    final TourType tourType = _tourData.getTourType();
    _uiTourTypeName = tourType == null ? //
            null : TourDatabase.getTourTypeName(tourType.getTypeId());

    _hasTags = tourTags != null && tourTags.size() > 0;
    _hasTourType = tourType != null;
    _hasDescription = tourDescription != null && tourDescription.length() > 0;
    _hasWeather = _tourData.getWeather().length() > 0;
    _hasGears = _tourData.getFrontShiftCount() > 0 || _tourData.getRearShiftCount() > 0;

    final Composite container = createUI(parent);

    //      _ttContainer.setRedraw(false);

    updateUI();
    updateUI_Layout();

    enableControls();

    //      _ttContainer.setRedraw(true);

    return container;
}

From source file:net.tourbook.training.TrainingView.java

License:Open Source License

private void initUI(final Composite parent) {

    _pc = new PixelConverter(parent);
    _tk = new FormToolkit(parent.getDisplay());
    _fontItalic = JFaceResources.getFontRegistry().getItalic(JFaceResources.DIALOG_FONT);

    _defaultSpinnerModifyListener = new ModifyListener() {
        @Override//from   w  ww .j  a  v  a  2s  .c o  m
        public void modifyText(final ModifyEvent e) {
            if (_isUpdateUI) {
                return;
            }
            onModifyHrBorder();
        }
    };

    _defaultSpinnerSelectionListener = new SelectionAdapter() {
        @Override
        public void widgetSelected(final SelectionEvent e) {
            if (_isUpdateUI) {
                return;
            }
            onModifyHrBorder();
        }
    };

    _defaultSpinnerMouseWheelListener = new MouseWheelListener() {
        @Override
        public void mouseScrolled(final MouseEvent event) {
            Util.adjustSpinnerValueOnMouseScroll(event);
            if (_isUpdateUI) {
                return;
            }
            onModifyHrBorder();
        }
    };

}

From source file:net.tourbook.ui.tourChart.ChartMarkerToolTip.java

License:Open Source License

private void initUI(final Composite parent) {

    final Display display = parent.getDisplay();

    _pc = new PixelConverter(parent);
    _defaultTextWidth = _pc.convertWidthInCharsToPixels(DEFAULT_TEXT_WIDTH);
    _defaultTextHeight = _pc.convertHeightInCharsToPixels(DEFAULT_TEXT_HEIGHT);

    _colorCache = new ColorCache();
    _boldFont = JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT);
    _fgBorder = display.getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW);
    _titleColor = _colorCache.getColor(new RGB(0x50, 0x50, 0x50));
}

From source file:net.tourbook.ui.tourChart.TourSegmenterTooltip.java

License:Open Source License

@Override
protected Composite createToolTipContentArea(final Composite shell) {

    if (_hoveredSegment == null) {
        return null;
    }//from  w ww  .ja v  a  2 s .com

    final Display display = shell.getDisplay();

    _bgColor = display.getSystemColor(SWT.COLOR_INFO_BACKGROUND);
    _fgColor = display.getSystemColor(SWT.COLOR_INFO_FOREGROUND);
    _boldFont = JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT);

    return createUI(shell);
}

From source file:net.tourbook.ui.views.TourChartAnalyzerView.java

License:Open Source License

private void initUI(final Composite parent) {

    _pc = new PixelConverter(parent);

    _bgColorHeader = Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND);
    _fontBold = JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT);
}

From source file:net.tourbook.ui.views.tourMarker.SlideoutTourMarkerFilter.java

License:Open Source License

private void initUI(final Composite parent) {

    //      _pc = new PixelConverter(parent);
    _boldFont = JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT);
}

From source file:net.tourbook.ui.views.tourMarker.TourMarkerView.java

License:Open Source License

@Override
public void createPartControl(final Composite parent) {

    _pc = new PixelConverter(parent);
    _boldFont = JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT);

    // define all columns for the viewer
    _columnManager = new ColumnManager(this, _state);
    _columnManager.setIsCategoryAvailable(true);
    defineAllColumns();//  w  w w.  j ava  2 s. c  o  m

    createUI(parent);

    addSelectionListener();
    addTourEventListener();
    addPrefListener();
    addPartListener();

    createActions();
    fillToolbar();

    // this part is a selection provider
    getSite().setSelectionProvider(_postSelectionProvider = new PostSelectionProvider(ID));

    // show default page
    _pageBook.showPage(_pageNoData);

    // show marker from last selection
    onSelectionChanged(getSite().getWorkbenchWindow().getSelectionService().getSelection());

    if (_tourData == null) {
        showTourFromTourProvider();
    }
}