Example usage for org.eclipse.jface.dialogs Dialog DLG_IMG_HELP

List of usage examples for org.eclipse.jface.dialogs Dialog DLG_IMG_HELP

Introduction

In this page you can find the example usage for org.eclipse.jface.dialogs Dialog DLG_IMG_HELP.

Prototype

String DLG_IMG_HELP

To view the source code for org.eclipse.jface.dialogs Dialog DLG_IMG_HELP.

Click Source Link

Document

Image registry key for help image (value "dialog_help_image").

Usage

From source file:com.bdaum.zoom.ui.preferences.AbstractPreferencePage.java

License:Open Source License

/**
 * Creates the help control button or link
 *
 * @param parent//from www . j a v a  2 s.  com
 *            - parent composite
 * @return - help button or link
 */
protected static Control createHelpControl(Composite parent) {
    Image helpImage = JFaceResources.getImage(Dialog.DLG_IMG_HELP);
    return (helpImage != null) ? createHelpImageButton(parent, helpImage) : createHelpLink(parent);
}

From source file:com.mindquarry.desktop.client.MindClient.java

License:Open Source License

private void initRegistries() {
    ImageRegistry reg = JFaceResources.getImageRegistry();

    Image img;/*  w w w  .  j ava2  s . c  o  m*/
    if (SVNFileUtil.isOSX) {
        img = new Image(Display.getCurrent(),
                MindClient.class.getResourceAsStream("/com/mindquarry/icons/128x128/logo/mindquarry-icon.png")); //$NON-NLS-1$
    } else {
        img = new Image(Display.getCurrent(),
                MindClient.class.getResourceAsStream("/com/mindquarry/icons/32x32/logo/mindquarry-icon.png")); //$NON-NLS-1$
    }
    reg.put(CLIENT_IMG_KEY, img);

    img = new Image(Display.getCurrent(), MindClient.class
            .getResourceAsStream("/org/tango-project/tango-icon-theme/16x16/apps/help-browser.png")); //$NON-NLS-1$
    reg.put(Dialog.DLG_IMG_HELP, img);

    Image trayImg = new Image(Display.getCurrent(),
            MindClient.class.getResourceAsStream("/com/mindquarry/icons/16x16/logo/mindquarry-icon.png")); //$NON-NLS-1$
    reg.put(CLIENT_TRAY_IMG_KEY, trayImg);

    FontRegistry fReg = JFaceResources.getFontRegistry();
    fReg.put(TASK_TITLE_FONT_KEY, getTaskFont());
    fReg.put(TASK_DESC_FONT_KEY, getTaskDescriptionFont());
    fReg.put(TEAM_NAME_FONT_KEY, getTeamFont());
}

From source file:com.nokia.s60tools.analyzetool.global.Util.java

License:Open Source License

public static ToolBar createHelpControl(Composite parent) {
    ToolBar toolBar = new ToolBar(parent, SWT.FLAT | SWT.NO_FOCUS);
    ((GridLayout) parent.getLayout()).numColumns++;
    toolBar.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER));
    final Cursor cursor = new Cursor(parent.getDisplay(), SWT.CURSOR_HAND);
    toolBar.setCursor(cursor);// ww w.j  a va2  s  .  c  o  m
    toolBar.addDisposeListener(new DisposeListener() {
        public void widgetDisposed(DisposeEvent e) {
            cursor.dispose();
        }
    });
    ToolItem item = new ToolItem(toolBar, SWT.NONE);
    item.setImage(JFaceResources.getImage(Dialog.DLG_IMG_HELP));
    item.setToolTipText(JFaceResources.getString("helpToolTip")); //$NON-NLS-1$
    item.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {
            PlatformUI.getWorkbench().getHelpSystem()
                    .displayHelp(AnalyzeToolHelpContextIDs.ANALYZE_TROUBLESHOOTING);
        }
    });
    return toolBar;
}

From source file:org.apache.directory.studio.ApplicationWorkbenchAdvisor.java

License:Apache License

/**
 * Performs arbitrary initialization before the workbench starts running.<br />
 * <br />//from  w  w  w .  ja  v a 2  s . co m
 * This method is called during workbench initialization prior to any windows 
 * being opened. Clients must not call this method directly (although super calls 
 * are okay). The default implementation does nothing. Subclasses may override. 
 * Typical clients will use the configurer passed in to tweak the workbench. If 
 * further tweaking is required in the future, the configurer may be obtained using 
 * getWorkbenchConfigurer
 */
public void initialize(IWorkbenchConfigurer configurer) {
    //enable the save/restore windows size & position feature
    configurer.setSaveAndRestore(true);

    //enable help button in dialogs 
    TrayDialog.setDialogHelpAvailable(true);
    ImageRegistry reg = JFaceResources.getImageRegistry();
    ImageDescriptor helpImage = PlatformUI.getWorkbench().getSharedImages()
            .getImageDescriptor(ISharedImages.IMG_LCL_LINKTO_HELP);
    reg.put(Dialog.DLG_IMG_HELP, helpImage);
}

From source file:org.bonitasoft.studio.common.properties.TogglePropertyHelpContributionItem.java

License:Open Source License

@Override
public void fill(final ToolBar toolbar, final int arg1) {
    final ToolItem toolItem = new ToolItem(toolbar, SWT.LEFT | SWT.PUSH | SWT.NO_FOCUS);
    toolItem.setToolTipText(Messages.toggleHelp);
    toolItem.setImage(JFaceResources.getImage(Dialog.DLG_IMG_HELP));
    toolItem.addSelectionListener(new SelectionAdapter() {

        @Override/*ww w.j a v a 2  s.co  m*/
        public void widgetSelected(final SelectionEvent e) {
            toggleHelp();
        }
    });
    if (propertySectionHistory.isDescriptionVisible()) {
        toggleHelp();
    }
}

From source file:org.bonitasoft.studio.expression.editor.viewer.PatternExpressionViewer.java

License:Open Source License

protected void createTextViewer() {
    viewer = createViewer(mc);/*from ww w  .  j a va  2s  .c  o m*/
    viewer.getControl().setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());
    configureTextViewer();

    helpDecoration = new ControlDecoration(viewer.getControl(), SWT.TOP | SWT.RIGHT, this);
    helpDecoration.setImage(JFaceResources.getImage(Dialog.DLG_IMG_HELP));
    helpDecoration.setDescriptionText(Messages.patternViewerHelp);
    helpDecoration.setMarginWidth(2);
    helpDecoration.hide();

    hintDecoration = new ControlDecoration(viewer.getControl(), SWT.TOP | SWT.LEFT, this);
    hintDecoration.setImage(Pics.getImage(PicsConstants.hint));
    hintDecoration.setMarginWidth(2);
    hintDecoration.setShowHover(true);
    hintDecoration.setShowOnlyOnFocus(true);
    hintDecoration.hide();

    viewer.addTextListener(new ITextListener() {

        @Override
        public void textChanged(TextEvent event) {
            viewer.getTextWidget().notifyListeners(SWT.Modify, new Event());
        }
    });

    contentAssisProcessor = new ExpressionContentAssistProcessor(viewer.getDocument());
    final ContentAssistant assistant = new ContentAssistant();
    assistant.setContentAssistProcessor(contentAssisProcessor, IDocument.DEFAULT_CONTENT_TYPE);
    assistant.setShowEmptyList(true);
    assistant.enableAutoActivation(true);
    assistant.install(viewer);

    viewer.getTextWidget().addKeyListener(new KeyAdapter() {
        @Override
        public void keyPressed(KeyEvent e) {

            switch (e.keyCode) {
            case SWT.F1:
                assistant.showPossibleCompletions();
                break;
            default:
                //ignore everything else
            }
        }

        @Override
        public void keyReleased(KeyEvent e) {
            if ((e.stateMask == SWT.CTRL || e.stateMask == SWT.COMMAND) && e.keyCode == SWT.SPACE) {
                assistant.showPossibleCompletions();
            }
        }
    });

    ISWTObservableValue observable = SWTObservables.observeDelayedValue(400,
            SWTObservables.observeText(getTextControl(), SWT.Modify));
    observable.addValueChangeListener(new IValueChangeListener() {

        @Override
        public void handleValueChange(ValueChangeEvent event) {
            if (!expressionMode()) {
                updateExpressionDependencies();
            }
        }
    });

    helpDecoration.show();
}

From source file:org.bonitasoft.studio.migration.ui.view.MigrationStatusView.java

License:Open Source License

private void createHelpButton(Composite bottomComposite) {
    ToolBar helpToolbar = new ToolBar(bottomComposite, SWT.NONE);
    helpToolbar.setLayoutData(/*ww w . jav  a 2 s.c  o  m*/
            GridDataFactory.swtDefaults().align(SWT.LEFT, SWT.CENTER).grab(false, false).create());
    ToolItem helpItem = new ToolItem(helpToolbar, SWT.PUSH);
    helpItem.setImage(JFaceResources.getImage(Dialog.DLG_IMG_HELP));
    helpItem.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            new WizardDialog(Display.getDefault().getActiveShell(), new MigrationWarningWizard()).open();
        }
    });
}

From source file:org.caleydo.core.gui.OpenOnlineHelpAction.java

License:Open Source License

public OpenOnlineHelpAction(String url, boolean useSmallIcon) {
    this.url = url;
    setText(LABEL);//  w ww. j a v a2  s .c om
    setToolTipText(LABEL);
    setImageDescriptor(ImageDescriptor.createFromImage(useSmallIcon
            ? GeneralManager.get().getResourceLoader().getImage(PlatformUI.getWorkbench().getDisplay(), ICON)
            : JFaceResources.getImage(Dialog.DLG_IMG_HELP)));
    setChecked(false);
}

From source file:org.eclipse.birt.chart.ui.swt.wizard.format.popup.AbstractPopupSheet.java

License:Open Source License

/**
 * Creates a new help control that provides access to context help.
 * <p>//www.  j  a v  a2s .  c  o  m
 * The <code>TrayDialog</code> implementation of this method creates the
 * control, registers it for selection events including selection, Note that
 * the parent's layout is assumed to be a <code>GridLayout</code> and the
 * number of columns in this layout is incremented. Subclasses may override.
 * </p>
 * 
 * @param parent
 *            the parent composite
 * @return the help control
 */
private Control createHelpControl(Composite parent) {
    Image helpImage = JFaceResources.getImage(Dialog.DLG_IMG_HELP);
    if (helpImage != null) {
        return createHelpImageButton(parent, helpImage);
    }
    return createHelpLink(parent);
}

From source file:org.eclipse.mylyn.tasks.tests.ui.TaskListServiceMessageControlTest.java

License:Open Source License

private void handleMessage(TestTaskListServiceMessageControl control, String id) {
    ServiceMessage message = new ServiceMessage("123");
    message.setTitle("Title");
    message.setDescription("Description");
    message.setImage(Dialog.DLG_IMG_HELP);
    message.setId(id);//w w  w  . j  a  v  a  2s  . com
    control.handleEvent(new ServiceMessageEvent(TasksUiPlugin.getDefault().getServiceMessageManager(),
            Kind.MESSAGE_UPDATE, ImmutableList.of(message)));
}