Java 类org.eclipse.swt.SWT 实例源码

项目:pgcodekeeper    文件:DiffWizard.java   
@Override
public void createControl(Composite parent) {
    Composite container = new Composite(parent, SWT.NONE);
    container.setLayout(new GridLayout(2, true));

    new Label(container, SWT.NONE).setText(Messages.DiffWizard_source + ':');
    new Label(container, SWT.NONE).setText(Messages.DiffWizard_target + ':');
    lblSource = new Label(container, SWT.WRAP);
    lblTarget = new Label(container, SWT.WRAP);

    diffTable = new DiffTableViewer(container, false, null);
    GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1);
    gd.widthHint = 480;
    gd.heightHint = 360;
    diffTable.setLayoutData(gd);

    setControl(container);
}
项目:BiglyBT    文件:SpeedTestPanel.java   
@Override
public void handleEvent(Event event){

    if(encryptToggle.getSelection()){
        Messages.setLanguageText(encryptToggle,"SpeedTestWizard.test.panel.encrypted");
        originalColor = encryptToggle.getForeground();
        //Color highlightColor = ColorCache.getColor(display,178,78,127);
        Color highlightColor = Colors.getSystemColor(display, SWT.COLOR_DARK_YELLOW);
        encryptToggle.setBackground(highlightColor);
    }else{
        Messages.setLanguageText(encryptToggle,"SpeedTestWizard.test.panel.standard");
        if(originalColor!=null){
            encryptToggle.setBackground(originalColor);
        }
    }
}
项目:Hydrograph    文件:ParameterGridDialog.java   
/**
 * Create the dialog.
 * @param parentShell
 */
public ParameterGridDialog(Shell parentShell) {
    super(parentShell);
    setShellStyle(SWT.CLOSE | SWT.RESIZE | SWT.TITLE | SWT.WRAP | SWT.APPLICATION_MODAL);
    runGraph=false;


    lastRowLastColumnTraverseListener=new TraverseListener() {

        @Override
        public void keyTraversed(TraverseEvent e) {
            if(e.detail == SWT.TRAVERSE_TAB_NEXT)
                addRowToTextGrid();
        }
    };

}
项目:convertigo-eclipse    文件:JavelinAttributeEditorComposite.java   
/**
 * This method initializes groupDecoration  
 *
 */
private void createGroupDecoration() {
    GridData gridData1 = new org.eclipse.swt.layout.GridData();
    gridData1.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
    gridData1.horizontalSpan = 2;
    gridData1.verticalAlignment = org.eclipse.swt.layout.GridData.CENTER;
    groupDecoration = new Group(this, SWT.NONE);
    groupDecoration.setText("Decoration");
    createCompositeIntense();
    groupDecoration.setLayoutData(gridData1);
    createCompositeReverse();
    createCompositeUnderline();
    createCompositeBlink();


}
项目:BiglyBT    文件:SystemTraySWT.java   
/**
 * Creates the global upload limit context menu item
 * @param parent The system tray contextual menu
 */
private final void createUploadLimitMenu(final Menu parent) {
    if ( gm == null ){
        return;
    }
    final MenuItem uploadSpeedItem = new MenuItem(parent, SWT.CASCADE);
    uploadSpeedItem.setText(MessageText.getString("GeneralView.label.maxuploadspeed"));

    final Menu uploadSpeedMenu = new Menu(uiFunctions.getMainShell(),
            SWT.DROP_DOWN);

    uploadSpeedMenu.addListener(SWT.Show, new Listener() {
        @Override
        public void handleEvent(Event event) {
            SelectableSpeedMenu.generateMenuItems(uploadSpeedMenu, core, gm, true);
        }
    });

    uploadSpeedItem.setMenu(uploadSpeedMenu);
}
项目:n4js    文件:AbstractN4JSPreferencePage.java   
@Override
protected Control createContents(Composite parent) {
    Composite composite = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    composite.setLayout(layout);
    composite.setFont(parent.getFont());

    GridData data = new GridData(GridData.FILL, GridData.FILL, true, true);

    configurationBlockControl = super.createContents(composite);
    configurationBlockControl.setLayoutData(data);

    if (isProjectPreferencePage()) {
        boolean useProjectSpecificSettings = hasProjectSpecificOptions();
        enableProjectSpecificSettings(useProjectSpecificSettings);
    }

    Dialog.applyDialogFont(composite);
    return composite;
}
项目:Hydrograph    文件:ExcelFormattingDialog.java   
/**
 * Create contents of the dialog.
 * 
 * @param parent
 */
@Override
protected Control createDialogArea(Composite parent) {
    Composite container = (Composite) super.createDialogArea(parent);
    container.setLayout(new GridLayout(1, false));
    container.getShell().setText(this.windowLabel);

    Composite main_composite = new Composite(container, SWT.NONE);
    main_composite.setLayout(new GridLayout(1, false));
    main_composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

    createTopComposite(main_composite);

    createTableComposite(main_composite);

    populateWidget();

    return container;
}
项目:Hydrograph    文件:CustomAboutDialog.java   
void configureText(final Composite parent) {
    // Don't set caret to 'null' as this causes
    // https://bugs.eclipse.org/293263.
    // text.setCaret(null);
    Color background = JFaceColors.getBannerBackground(parent.getDisplay());
    Color foreground = JFaceColors.getBannerForeground(parent.getDisplay());

    text.setFont(parent.getFont());
    text.setText(item.getText());

    text.setBackground(background);
    text.setForeground(foreground);
    text.setMargins(TEXT_MARGIN, TEXT_MARGIN, TEXT_MARGIN, 0);

    GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
    text.setLayoutData(gd);

    aboutTextManager = new AboutTextManager(text);
    aboutTextManager.setItem(item);

    createTextMenu();

}
项目:gw4e.project    文件:GW4EPreferencePage.java   
private SWTBotShell showPreferenceDialogMAC() {
    final IWorkbench workbench = PlatformUI.getWorkbench();
    workbench.getDisplay().asyncExec(new Runnable() {
        public void run() {
            IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
            if (window != null) {
                Menu appMenu = workbench.getDisplay().getSystemMenu();
                for (MenuItem item : appMenu.getItems()) {
                    if (item.getText().startsWith("Preferences")) {
                        Event event = new Event();
                        event.time = (int) System.currentTimeMillis();
                        event.widget = item;
                        event.display = workbench.getDisplay();
                        item.setSelection(true);
                        item.notifyListeners(SWT.Selection, event);
                        break;
                    }
                }
            }
        }
    });
    return  getPreferenceDialog() ;
}
项目:neoscada    文件:PreviewEditorImpl.java   
private void updateSymbol ()
{
    if ( this.symbolArea == null )
    {
        // too early
        return;
    }

    this.loadedUris.clear ();

    if ( this.viewer != null )
    {
        this.viewer.dispose ();
        this.viewer = null;
    }

    final Symbol symbol = getSymbol ();
    if ( symbol != null )
    {
        final Map<String, String> properties = new HashMap<> ();
        final SymbolLoader symbolLoader = new StaticSymbolLoader ( symbol );
        final Map<String, Object> scriptObjects = new HashMap<> ();
        this.viewer = new VisualInterfaceViewer ( this.symbolArea, SWT.NONE, symbolLoader, scriptObjects, properties, this.factoryContext );
    }
    this.symbolArea.layout ();
}
项目:BiglyBT    文件:ProgressReporterWindow.java   
/**
 * When any <code>ProgressReporterPanel</code> in this window is expanded or collapsed
 * re-layout the controls and window appropriately
 */
@Override
public void isCollapsed(boolean value) {
    if (null != shell && !shell.isDisposed()) {
        scrollable.setRedraw(false);
        Rectangle r = scrollable.getClientArea();
        scrollable.setMinSize(scrollChild.computeSize(r.width, SWT.DEFAULT));

        /*
         * Resizing to fit the panel if there is only one
         */
        if (pReporters.length == 1) {
            Point p = shell.computeSize(defaultShellWidth, SWT.DEFAULT);
            if (shell.getSize().y != p.y) {
                p.x = shell.getSize().x;
                shell.setSize(p);
            }
        }

        scrollable.layout();
        scrollable.setRedraw(true);
    }
}
项目:convertigo-eclipse    文件:SequenceEditor.java   
public void createPartControl(Composite parent) {
    try {
        parent.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
        GridLayout gridLayout = new GridLayout();
        parent.setLayout(gridLayout);
        gridLayout.horizontalSpacing = 0;
        gridLayout.marginWidth = 0;
        gridLayout.marginHeight = 0;
        gridLayout.verticalSpacing = 0;

        GridData gridData = new GridData();
        gridData.horizontalAlignment = GridData.FILL;
        gridData.verticalAlignment = GridData.FILL;
        gridData.grabExcessHorizontalSpace = true;
        gridData.grabExcessVerticalSpace = true;

        SequenceEditorInput sequenceEditorInput = (SequenceEditorInput) getEditorInput();

        sequenceEditorPart = new SequenceEditorPart(this, sequenceEditorInput.sequence, parent, SWT.None);
        sequenceEditorPart.setLayoutData(gridData);
    }
    catch(Throwable e) {
        ConvertigoPlugin.logException(e, "Unable to create editor part");
    }
}
项目:BiglyBT    文件:MyTorrentsSubView.java   
private void updateButtonVisibility(final Tag[] tags) {
    Utils.execSWTThread(new AERunnable() {

        @Override
        public void runSupport() {
            if (btnAnyTags == null || btnAnyTags.isDisposed()) {
                return;
            }
            boolean show = tags != null && tags.length > 1;
            btnAnyTags.setVisible(show);
            FormData fd = Utils.getFilledFormData();
            fd.height = show ? SWT.DEFAULT : 0;
            btnAnyTags.setLayoutData(fd);
            Composite cTop = btnAnyTags.getParent();
            cTop.getParent().layout(true, true);
        }
    });
}
项目:n4js    文件:GraphCanvas.java   
protected void onClick(MouseEvent event) {
    // update selection
    final Node mNode = getNodeAt(event.x, event.y);
    final boolean shiftPressed = (event.stateMask & SWT.SHIFT) != 0;
    if (!shiftPressed) {
        if (mNode == null) {
            clearSelection();
        } else {
            setSelectedNodes(mNode);
        }
    } else {
        if (mNode == null) {
            // do nothing
        } else {
            toggleSelection(mNode);
        }
    }
}
项目:neoscada    文件:NativeTabProvider.java   
@Override
protected void show ()
{
    super.show ();

    final int tabIndex = findIndex ( this.index );

    if ( tabIndex < 0 )
    {
        this.item = new TabItem ( this.folder, SWT.NONE );
        this.item.setData ( "order", this.index );
    }
    else
    {
        this.item = new TabItem ( this.folder, SWT.NONE, tabIndex );
        this.item.setData ( "order", this.index );
    }

    this.item.setControl ( this.container );

    useItem ( this.item );
}
项目:convertigo-eclipse    文件:StatisticsDialog.java   
private void addStats() {

        for (String key : statsProject.keySet()) {
            if (key != project.getName()) {
                CLabel title = new CLabel(descriptifRight, SWT.BOLD);
                title.setText(key);
                title.setImage(new Image(display, getClass()
                        .getResourceAsStream(
                                "images/stats_"
                                        + key.replaceAll(" ", "_")
                                                .toLowerCase() + "_16x16.png")));
                title.setBackground(new Color(display, 255, 255, 255));
                title.setMargins(10, 10, 0, 0);

                FontData[] fd = title.getFont().getFontData();
                fd[0].setStyle(SWT.BOLD);
                title.setFont(new Font(title.getFont().getDevice(), fd));

                CLabel subText = new CLabel(descriptifRight, SWT.NONE);
                subText.setText(statsProject.get(key)
                        .replaceAll("<br/>", "\r\n").replaceAll("&nbsp;", " "));
                subText.setBackground(new Color(display, 255, 255, 255));
                subText.setMargins(30, 0, 0, 0);
            }
        }
    }
项目:pgsqlblocks    文件:DBProcessesFiltersView.java   
private void createQueryFilterView(GridData comboLayoutData, GridData textLayoutData) {
    Label label = new Label(group, SWT.NONE);
    label.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
    label.setText(resourceBundle.getString("query"));

    queryFilterCombo = new Combo(group, SWT.DROP_DOWN | SWT.READ_ONLY);
    queryFilterCombo.setLayoutData(comboLayoutData);
    fillCombo(queryFilterCombo, FilterValueType.STRING);
    queryFilterCombo.select(0);
    queryFilterCombo.addModifyListener(e -> {
        FilterCondition condition = FilterCondition.getFilterConditionFromConditionText(queryFilterCombo.getText());
        listeners.forEach(listener -> listener.processesFiltersViewQueryFilterConditionChanged(this, condition));
    });

    queryFilterText = new Text(group, SWT.NONE);
    queryFilterText.setLayoutData(textLayoutData);
    queryFilterText.addModifyListener(e -> {
        String text = queryFilterText.getText();
        final String result = text.isEmpty() ? null : text;
        listeners.forEach(listener -> listener.processesFiltersViewQueryFilterValueChanged(this, result));
    });
}
项目:Hydrograph    文件:ELTGraphicalEditor.java   
@Override
public void setInput(IEditorInput input) {
    if(input instanceof FileStoreEditorInput){
        MessageBox messageBox=new MessageBox(Display.getCurrent().getActiveShell(),SWT.ICON_WARNING);
        messageBox.setText(Messages.WARNING);
        messageBox.setMessage(Messages.JOB_OPENED_FROM_OUTSIDE_WORKSPACE_WARNING);
        messageBox.open();
    }   
    try {
        GenrateContainerData genrateContainerData = new GenrateContainerData();
        genrateContainerData.setEditorInput(input, this);
        if(StringUtils.equals(this.getJobName()+Messages.JOBEXTENSION, input.getName()) || StringUtils.equals(this.getJobName(), Messages.ELT_GRAPHICAL_EDITOR)){
            container = genrateContainerData.getContainerData();
        }else{
            this.setPartName(input.getName());
        }
        super.setInput(input);
    } catch (CoreException | IOException ce) {
        logger.error("Exception while setting input", ce);
        PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().dispose();
        MessageDialog.openError(new Shell(), "Error", "Exception occured while opening the graph -\n"+ce.getMessage());
    }
}
项目:AgentWorkbench    文件:ProjectNewOpen.java   
@Override
  protected void configureShell(Shell newShell) {
      super.configureShell(newShell);
      this.currentShell = newShell;
      this.currentShell.setText(this.title);
      this.currentShell.getDisplay().addFilter(SWT.Traverse, new Listener() {
    @Override
    public void handleEvent(Event event) {
        switch (event.detail) {
        case SWT.TRAVERSE_ESCAPE:
            event.doit = false;
            cancelPressed();
            break;

        default:
            break;
        }
    }
});
  }
项目:Hydrograph    文件:DebugDataViewer.java   
/**
 * 
 * Create unformatted view tab in data viewer tab folder
 * 
 */
public void createUnformattedViewTabItem() {
    if (isViewTabExist(Views.UNFORMATTED_VIEW_NAME)) {
        CTabItem item = getViewTabItem(Views.UNFORMATTED_VIEW_NAME);
        tabFolder.setSelection(item);
        dataViewLoader.reloadloadViews();
        return;
    }

    CTabItem tbtmUnformattedView = new CTabItem(tabFolder, SWT.CLOSE);
    tbtmUnformattedView.setData(Views.VIEW_NAME_KEY, Views.UNFORMATTED_VIEW_NAME);
    tbtmUnformattedView.setText(Views.UNFORMATTED_VIEW_DISPLAY_NAME);
    {
        Composite composite = new Composite(tabFolder, SWT.NONE);
        tbtmUnformattedView.setControl(composite);
        composite.setLayout(new GridLayout(1, false));
        {
            unformattedViewTextarea = new StyledText(composite, SWT.BORDER | SWT.READ_ONLY | SWT.V_SCROLL
                    | SWT.H_SCROLL);
            unformattedViewTextarea.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
        }
    }

    tabFolder.setSelection(tbtmUnformattedView);
    dataViewLoader.setUnformattedViewTextarea(unformattedViewTextarea);
    dataViewLoader.reloadloadViews();
    actionFactory.getAction(SelectColumnAction.class.getName()).setEnabled(false);
}
项目:Hydrograph    文件:PropertyDialogBuilder.java   
private CTabItem createTab(String groupName, CTabFolder tabFolder) {
    CTabItem tabItem = new CTabItem(tabFolder, SWT.NONE);

    if (OSValidator.isMac()) {
        tabItem.setText(" "+WordUtils.capitalize(groupName.replace("_", " ").toLowerCase(), null));
    }
    else {
        tabItem.setText(WordUtils.capitalize(groupName.replace("_", " ").toLowerCase(), null));         
    }
    return tabItem;
}
项目:time4sys    文件:TimingPropertiesEditionPartImpl.java   
/**
 * 
 */
protected Composite createTimingPropertiesGroup(Composite parent) {
    Group timingPropertiesGroup = new Group(parent, SWT.NONE);
    timingPropertiesGroup.setText(HrmMessages.TimingPropertiesEditionPart_TimingPropertiesGroupLabel);
    GridData timingPropertiesGroupData = new GridData(GridData.FILL_HORIZONTAL);
    timingPropertiesGroupData.horizontalSpan = 3;
    timingPropertiesGroup.setLayoutData(timingPropertiesGroupData);
    GridLayout timingPropertiesGroupLayout = new GridLayout();
    timingPropertiesGroupLayout.numColumns = 3;
    timingPropertiesGroup.setLayout(timingPropertiesGroupLayout);
    return timingPropertiesGroup;
}
项目:bdf2    文件:ColumnDialog.java   
private void createBasicControl(Composite container) {
    GridLayout layout = new GridLayout();
    container.setLayout(layout);
    layout.numColumns = 6;
    layout.verticalSpacing = 10;
    layout.marginTop = 10;
    layout.marginWidth = 10;
    createErrorLabel(container);
    createColumnInfoControl(container);
    final ISWTObservableValue observableValue = SWTObservables.observeText(errorLabel);
    errorLabel.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
    dataBindingContext.bindValue(observableValue, new AggregateValidationStatus(dataBindingContext.getBindings(),
            AggregateValidationStatus.MAX_SEVERITY), null, null);
    observableValue.addChangeListener(new IChangeListener() {
        public void handleChange(ChangeEvent event) {
            if (observableValue.getValue().equals("OK")) {
                errorLabel.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_BLACK));
                errorLabel.setText(DIALOG_MESSAGE);
                buttonOk.setEnabled(true);
            } else {
                errorLabel.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
                buttonOk.setEnabled(false);
            }
        }
    });

}
项目:BiglyBT    文件:TopBarView.java   
/**
 * @param view
 *
 * @since 3.0.1.1
 */
private void addTopBarView(UISWTViewCore view, Composite composite) {
    Composite parent = new Composite(composite, SWT.None);
    parent.setLayoutData(Utils.getFilledFormData());
    parent.setLayout(new FormLayout());

    view.initialize(parent);
    parent.setVisible(false);

    Control[] children = parent.getChildren();
    for (int i = 0; i < children.length; i++) {
        Control control = children[i];
        Object ld = control.getLayoutData();
        boolean useGridLayout = ld != null && (ld instanceof GridData);
        if (useGridLayout) {
            GridLayout gridLayout = new GridLayout();
            gridLayout.horizontalSpacing = 0;
            gridLayout.marginHeight = 0;
            gridLayout.marginWidth = 0;
            gridLayout.verticalSpacing = 0;
            parent.setLayout(gridLayout);
            break;
        } else if (ld == null) {
            control.setLayoutData(Utils.getFilledFormData());
        }
    }

    topbarViews.add(view);

    if ( listPlugins != null ){

        if ( isEnabled( view )){

            listPlugins.add( getViewName( view ));
        }
    }
}
项目:Hydrograph    文件:XmlFilePathModifyListener.java   
@Override
public Listener getListener(PropertyDialogButtonBar propertyDialogButtonBar, ListenerHelper helper, Widget... widgets) {
    final Widget[] widgetList = widgets;
    if (helper != null) {
        txtDecorator = (ControlDecoration) helper.get(HelperType.CONTROL_DECORATION);
    }

    Listener listener=new Listener() {

        @Override
        public void handleEvent(Event event) {
            IPath path = new Path(((Text) widgetList[0]).getText().trim());
            if (event.type == SWT.Modify ) {
                if (StringUtils.isNotBlank(path.segment(0))) {
                    if (path.lastSegment().endsWith(".xml")) {
                        txtDecorator.hide();
                        ((Text) widgetList[0]).setToolTipText("");
                        ((Text) widgetList[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 255));

                    }else{
                        txtDecorator.show();
                        txtDecorator.setDescriptionText("Select valid XML file");
                        ((Text) widgetList[0]).setToolTipText(txtDecorator.getDescriptionText());
                        ((Text) widgetList[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 204));
                    }
                }
            }
        }
    };

    return listener;
}
项目:ide-plugins    文件:PluginDialog.java   
protected Composite createBottomContent() {
    Composite bottom = new Composite(composite, SWT.NONE);
    bottom.setBackground(backColor);

    GridLayout layout = new GridLayout(2, true);
    layout.marginTop = 0;
    layout.marginLeft = 20;
    layout.marginRight = 20;
    bottom.setLayout(layout);
    bottom.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    return bottom;
}
项目:neoscada    文件:ConfigurationFormToolkit.java   
public void createStandardCheckbox ( final Composite parent, final String attributeName, final String label, final IObservableMap data, final Object valueType )
{
    final Button button = this.toolkit.createButton ( parent, label, SWT.CHECK );
    {
        final GridData gd = new GridData ( GridData.FILL_HORIZONTAL );
        gd.horizontalSpan = 3;
        button.setLayoutData ( gd );
        final IObservableValue value = Observables.observeMapEntry ( data, attributeName, valueType );
        this.dbc.bindValue ( WidgetProperties.selection ().observe ( button ), value );
    }
}
项目:gw4e.project    文件:FolderSelectionGroup.java   
private void fireEvent () {
    if (listener != null) {
        Event changeEvent = new Event();
        changeEvent.type = SWT.Selection;
        listener.handleEvent(changeEvent);
    }       
}
项目:n4js    文件:WorkspaceWizardPage.java   
/**
 * Adds the content proposal field decoration to a given control.
 *
 * @param control
 *            The control to decorate
 */
private ControlDecoration createContentProposalDecoration(Control control) {
    ControlDecoration decoration = new ControlDecoration(control, SWT.TOP | SWT.LEFT);
    decoration.setImage(contentProposalDecorationImage);
    decoration.setShowOnlyOnFocus(true);
    return decoration;
}
项目:neoscada    文件:WriteOperationWizardValuePage.java   
private void setValueText ( final String value, final boolean systemText )
{
    this.convertedValue.setText ( value );

    if ( systemText )
    {
        final Color color = this.convertedValue.getDisplay ().getSystemColor ( SWT.COLOR_RED );
        this.convertedValue.setForeground ( color );
    }
    else
    {
        this.convertedValue.setForeground ( this.defaultValueColor );
    }
}
项目:Hydrograph    文件:FTPOperationConfigUtility.java   
private void selectionListener(Button button, Text txt){
    button.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            FileDialog filedialog = new FileDialog(button.getShell(), SWT.None);
            txt.setText(filedialog.open());
        }
    });
}
项目:ide-plugins    文件:OptionsPage.java   
public OptionsPage() {
    super(GRID);
    setDescription("Gluon Settings");
    if (ProjectData.alreadyOptedIn()) {
        this.userEmail = PREFERENCES.get(ProjectConstants.PARAM_USER_EMAIL, "");
        this.userUptodate = PREFERENCES.getBoolean(ProjectConstants.PARAM_USER_UPTODATE, true);
        this.userMobileLicense = PREFERENCES.get(ProjectConstants.PARAM_USER_LICENSE_MOBILE, "");
        this.userDesktopLicense = PREFERENCES.get(ProjectConstants.PARAM_USER_LICENSE_DESKTOP, "");
    }
    color = Display.getCurrent().getSystemColor(SWT.COLOR_RED);
}
项目:gw4e.project    文件:GeneratorChoiceComposite.java   
private void createNewMode() {
    btnCreateNewRadioButton = new Button(this, SWT.RADIO);
    btnCreateNewRadioButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 12, 1));
    btnCreateNewRadioButton.setText(MessageUtil.getString("standalone_mode"));
    btnCreateNewRadioButton.setSelection(false);
    btnCreateNewRadioButton.addListener(SWT.Selection, new Listener() {
        public void handleEvent(Event e) {
            switch (e.type) {
            case SWT.Selection:
                updateUI();
                break;
            }
        }
    });
    btnCreateNewRadioButton.setData(GW4E_CONVERSION_WIDGET_ID, GW4E_NEWCLASS_CHECKBOX);

    Composite composite = new Composite(this, SWT.NONE);
    composite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 12, 1));
    composite.setLayout(new GridLayout(12, false));

    lblNewClassnameLabel = new Label(composite, SWT.NONE);
    lblNewClassnameLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 4, 1));
    lblNewClassnameLabel.setText("Class name");
    lblNewClassnameLabel.setEnabled(false);

    newClassnameText = new Text(composite, SWT.BORDER);
    newClassnameText.setEnabled(false);
    newClassnameText.addModifyListener(new ModifyListener() {
        public void modifyText(ModifyEvent event) {
            listener.handleEvent(null);
        }
    });
    newClassnameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 8, 1));
    newClassnameText.setEnabled(false);
    newClassnameText.setData(GW4E_CONVERSION_WIDGET_ID, GW4E_NEWCLASS_TEXT);
}
项目:BiglyBT    文件:SubscriptionWizard.java   
private Composite createCreateComposite(Composite parent) {
    Composite composite = new Composite(parent,SWT.NONE);

    FillLayout layout = new FillLayout();
    layout.marginHeight = 8;
    layout.marginWidth  = 8;

    composite.setLayout(layout);

    createTabFolder = new TabFolder(composite,SWT.NONE);
    createTabFolder.setFont(subTitleFont);

    createSearchTabItem = new TabItem(createTabFolder,SWT.NONE);
    createSearchTabItem.setText(MessageText.getString("Wizard.Subscription.create.search"));
    createSearchTabItem.setControl(createCreateSearchComposite(createTabFolder));

    createRSSTabItem = new TabItem(createTabFolder,SWT.NONE);
    createRSSTabItem.setText("  " + MessageText.getString("Wizard.Subscription.create.rss"));
    createRSSTabItem.setControl(createCreateRSSComposite(createTabFolder));

    createTabFolder.addListener(SWT.Selection, new Listener() {
        @Override
        public void handleEvent(Event event) {
            TabItem[] selectedItems = createTabFolder.getSelection();
            if(selectedItems.length != 1) {
                return;
            }
            TabItem selectedItem = selectedItems[0];
            if(selectedItem == createRSSTabItem) {
                setMode(MODE_CREATE_RSS);
            } else {
                setMode(MODE_CREATE_SEARCH);
            }
        }
    });

    return composite;
}
项目:time4sys    文件:GeneralPropertiesEditionPartForm.java   
protected Composite createIsProtectedCheckbox(FormToolkit widgetFactory, Composite parent) {
    isProtected = widgetFactory.createButton(parent,
            getDescription(SrmViewsRepository.General.Properties.isProtected,
                    SrmMessages.GeneralPropertiesEditionPart_IsProtectedLabel),
            SWT.CHECK);
    isProtected.addSelectionListener(new SelectionAdapter() {

        /**
         * {@inheritDoc}
         *
         * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
         * 
         */
        public void widgetSelected(SelectionEvent e) {
            if (propertiesEditionComponent != null)
                propertiesEditionComponent
                        .firePropertiesChanged(new PropertiesEditionEvent(GeneralPropertiesEditionPartForm.this,
                                SrmViewsRepository.General.Properties.isProtected, PropertiesEditionEvent.COMMIT,
                                PropertiesEditionEvent.SET, null, new Boolean(isProtected.getSelection())));
        }

    });
    GridData isProtectedData = new GridData(GridData.FILL_HORIZONTAL);
    isProtectedData.horizontalSpan = 2;
    isProtected.setLayoutData(isProtectedData);
    EditingUtils.setID(isProtected, SrmViewsRepository.General.Properties.isProtected);
    EditingUtils.setEEFtype(isProtected, "eef::Checkbox"); //$NON-NLS-1$
    FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent
            .getHelpContent(SrmViewsRepository.General.Properties.isProtected, SrmViewsRepository.FORM_KIND), null); // $NON-NLS-1$
    // Start of user code for createIsProtectedCheckbox

    // End of user code
    return parent;
}
项目:convertigo-eclipse    文件:MobileSmartSourceEditorComposite.java   
public MobileSmartSourceEditorComposite(Composite parent, int style, AbstractDialogCellEditor cellEditor) {
    super(parent, style, cellEditor);

    DatabaseObjectTreeObject dbto = cellEditor.databaseObjectTreeObject;
    String source = (String)cellEditor.getEditorData();

    this.setLayout(new GridLayout(1, false));

    mpc = new MobilePickerComposite(this, true);
    mpc.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
    mpc.setCurrentInput(dbto, source);
}
项目:Hydrograph    文件:ComponentTooltip.java   
/**
 * Create scrolled composite
 * @param parent
 * @return
 */
private ScrolledComposite createScrolledComposite(Composite parent) {
    ScrolledComposite scrolledComposite = new ScrolledComposite(parent, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
    scrolledComposite.setExpandHorizontal(true);
    scrolledComposite.setExpandVertical(true);

    logger.debug("ComponentTooltip.createScrolledComposite() - created scrolled composite " + scrolledComposite);

    return scrolledComposite;
}
项目:bdf2    文件:ImportFromDatabaseWizardPage.java   
@Override
public void createControl(Composite parent) {
    setPageComplete(false);
    Composite container = new Composite(parent, SWT.NULL);
    GridLayout layout = new GridLayout();
    container.setLayout(layout);
    layout.numColumns = 1;
    layout.verticalSpacing = 9;
    createTreeViewer(container);
    initTreeViewerData();
    addListeners();
    setControl(container);

}
项目:Hydrograph    文件:HiveInputExtractMetaStoreDialog.java   
/**
 * Create contents of the dialog.
 * @param parent
 */
@Override
protected Control createDialogArea(Composite parent) {

    getShell().setText("Credentials Required");

    Composite container = (Composite) super.createDialogArea(parent);
    container.getLayout();


    Composite composite = new Composite(container, SWT.NONE);
    composite.setLayout(new GridLayout(4, false));
    composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
    new Label(composite, SWT.NONE);
    new Label(composite, SWT.NONE);
    new Label(composite, SWT.NONE);
    new Label(composite, SWT.NONE);
    new Label(composite, SWT.NONE);

    Label lblUserName = new Label(composite, SWT.NONE);
    lblUserName.setText("User Name");
    new Label(composite, SWT.NONE);

    username = new Text(composite, SWT.BORDER);
    username.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    new Label(composite, SWT.NONE);

    Label lblPassword = new Label(composite, SWT.NONE);
    lblPassword.setText("Password");
    new Label(composite, SWT.NONE);

    password = new Text(composite, SWT.PASSWORD|SWT.BORDER);
    password.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));

    createErrorComposite(container);

    return container;
}
项目:convertigo-eclipse    文件:SmartTypeEditor.java   
@Override
protected Control createContents(Composite cell) {
    Text text = new Text(cell, SWT.NONE);
    text.setText("lol");
    Control control = super.createContents(cell);
    control.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_CYAN));
    return control;
}