Java 类org.eclipse.swt.widgets.Widget 实例源码

项目:pgcodekeeper    文件:CheckedTreeViewer.java   
@Override
public Object[] getCheckedElements() {
    Object[] checked = super.getCheckedElements();
    // add all items that are children of a checked node but not created yet
    ArrayList<Object> result = new ArrayList<>();
    for (int i = 0; i < checked.length; i++) {
        Object curr = checked[i];
        result.add(curr);
        Widget item = findItem(curr);
        if (item != null) {
            Item[] children = getChildren(item);
            // check if contains the dummy node
            if (children.length == 1 && children[0].getData() == null) {
                // not yet created
                collectChildren(curr, result);
            }
        }
    }
    return result.toArray();
}
项目:Hydrograph    文件:LoadTypeConfigurationDialog.java   
/**
 * The Function will call to disable the widgets
 * @param textbox1
 * @param textbox2
 * @param buttonWidgets
 * @return Selection Adapter
 */
private SelectionAdapter buttonSelectionListener( Text textbox2,Widget... buttonWidgets){
    Supplier<Stream<Widget>> streamSupplier = () -> Stream.of(buttonWidgets);
    SelectionAdapter adapter = new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent event) {
            newTableRadioButton.setSelection(false);
            textbox2.setEnabled(false);
            streamSupplier.get().forEach((Widget widgets) ->{((Button)widgets).setEnabled(false);});
            if(OSValidator.isMac()){
                ((Button)event.getSource()).setFocus();
            }
            propertyDialogButtonBar.enableApplyButton(true);
        }
    };
    return adapter;
}
项目:Hydrograph    文件:ELTSchemaDialogSelectionListener.java   
@Override
public Listener getListener(final PropertyDialogButtonBar propertyDialogButtonBar,
        ListenerHelper helpers, final Widget... widgets) {
    final Button button = ((Button)widgets[0]);
    button.getShell();
    if(helpers != null){
        txtDecorator = (ControlDecoration) helpers.get(HelperType.CONTROL_DECORATION);
        file_extension=(String)helpers.get(HelperType.FILE_EXTENSION);
    }

    Listener listener=new Listener() {
        @Override
        public void handleEvent(Event event) {
            if(event.type==SWT.Selection){
                FilterOperationClassUtility.INSTANCE.browseFile(file_extension,((Text) widgets[0]));
                    propertyDialogButtonBar.enableApplyButton(true);
                    txtDecorator.hide();
            }
        }
    };
    return listener;
}
项目:Hydrograph    文件:ELTVerifySequenceFieldName.java   
@Override
public Listener getListener(PropertyDialogButtonBar propertyDialogButtonBar, ListenerHelper helper,
        Widget... widgets) {
    if (helper != null) {
        txtDecorator = (ControlDecoration) helper.get(HelperType.CONTROL_DECORATION);
    }
    Listener listener = new Listener() {

        @Override
        public void handleEvent(Event event) {
            String string = event.text;
            Matcher matchs = Pattern.compile(Constants.REGEX).matcher(string);
            LOGGER.debug("Verifying text format");
            if (!matchs.matches()) {
                txtDecorator.setDescriptionText(Messages.CHARACTERSET);
                txtDecorator.show();
                event.doit = false;

            } else
                txtDecorator.hide();

        }
    };
    return listener;
}
项目:Hydrograph    文件:ELTTransformDeleteSelectionListener.java   
@Override
    public void selectionListenerAction(
            PropertyDialogButtonBar propertyDialogButtonBar,
            ListenerHelper helpers, Widget... widgets) {

        ELTGridDetails gridDetails = (ELTGridDetails) helpers.get(HelperType.SCHEMA_GRID);
        Table table =gridDetails.getTableViewer().getTable();
        int temp = table.getSelectionIndex();
        int[] indexs=table.getSelectionIndices();
        if (temp == -1) {
            WidgetUtility.errorMessage("Please Select row to delete");
        } else {
            table.remove(indexs);
            ArrayList tempList= new ArrayList();
            for (int index :indexs) { 
//              PropertyField test =(PropertyField) gridDetails.getGrids().get(index);
//              tempList.add(test);
            }
             gridDetails.getGrids().removeAll(tempList); 

        }       
    }
项目:Hydrograph    文件:ELTGridAddSelectionListener.java   
@Override
public void selectionListenerAction(PropertyDialogButtonBar propertyDialogButtonBar, ListenerHelper helpers, Widget... widgets) {
    propertyDialogButtonBar.enableApplyButton(true);
    table=(Table)widgets[0];
    table.getParent().getShell().setFocus();
    ((Button) widgets[1]).setEnabled(true);
    ELTGridDetails eltGridDetails = (ELTGridDetails)helpers.get(HelperType.SCHEMA_GRID);
    if (eltGridDetails.getGrids().size() >= 1) {
        ((Button) widgets[2]).setEnabled(true);
        ((Button) widgets[3]).setEnabled(true);
    }
    GridWidgetCommonBuilder gridCommonBuilder = eltGridDetails.getGridWidgetCommonBuilder();
    gridCommonBuilder.setRowSequence(rowSequence);
    gridCommonBuilder.createDefaultSchema(eltGridDetails.getGrids(), eltGridDetails.getTableViewer(), eltGridDetails.getLabel());
    rowSequence++;
    ((Component)helpers.get(HelperType.COMPONENT)).setLatestChangesInSchema(true);
}
项目:Hydrograph    文件:ELTShortcutKeyGridListener.java   
@Override
public void selectionListenerAction(final PropertyDialogButtonBar propertyDialogButtonBar, final ListenerHelper helpers, Widget... widget) {

    ELTGridDetails gridDetails = (ELTGridDetails) helpers.get(HelperType.SCHEMA_GRID);      
    final TableViewer tableViewer = gridDetails.getTableViewer();
    final int columns = tableViewer.getCellEditors().length;
    final Widget[] widgets = widget;        

    table=(Table)widgets[0];

    if (!isKeyListenerAttached){
        for (int i =0; i < columns; i++){
            attachShortcutKeyListener(tableViewer.getCellEditors()[i].getControl(), propertyDialogButtonBar, helpers, widgets);
        }               
        attachShortcutKeyListener(table, propertyDialogButtonBar, helpers, widgets);
    }
}
项目:Hydrograph    文件:ELTFocusGainedListener.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) {
            String charSet = ((Text) widgetList[0]).getText().trim();
            if (event.type == SWT.FocusIn) {
                ((Text) widgetList[0]).setText(charSet.replace("@{", "").replace("}", ""));
            }
        }
    };

    return listener;
}
项目:Hydrograph    文件:ELTSelectionListener.java   
@Override
public Listener getListener(final 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) {
            if (((Combo) widgetList[0]).getText().equals("Parameter") || ((Combo) widgetList[0]).getText().equals("Others")) {
                ((Text) widgetList[1]).setVisible(true);
                ((Text) widgetList[1]).setFocus();
                txtDecorator.hide();
            } else {
                ((Text) widgetList[1]).setVisible(false);
                txtDecorator.hide();
            }
            propertyDialogButtonBar.enableApplyButton(true);
        }
    };
    return listener;
}
项目:Hydrograph    文件:ELTCheckFileExtensionListener.java   
@Override
public Listener getListener(PropertyDialogButtonBar propertyDialogButtonBar,ListenerHelper helpers, Widget... widgets) {
    final Widget[] widgetList = widgets;

    Listener listener=new Listener() { 
        @Override
        public void handleEvent(Event event) {
            if(!((Button)widgetList[1]).getSelection()){
            ControlDecoration   fieldNameMustJava = WidgetUtility.addDecorator((Text)widgetList[0],Messages.INVALID_FILE);
            if(!WidgetUtility.isFileExtention((((Text)widgetList[0]).getText()).trim(), ".java") && !(((Text)widgetList[0]).getText().trim().isEmpty())){
                fieldNameMustJava.show();
            ((Text)widgetList[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255,
                    255, 204));
            }
                else  
                {   
                    ((Text)widgetList[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255,
                        255, 255));
                fieldNameMustJava.hide(); 
                }
            }
        } 
    };
    return listener;
}
项目:Hydrograph    文件:FocusInListener.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) {
            String charSet = ((Text) widgetList[0]).getText().trim();
            if(SWT.FocusIn == event.type) {
                if (StringUtils.isBlank(charSet)) {
                    txtDecorator.show();
                    ((Text) widgetList[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 255));
                    ((Text) widgetList[0]).setToolTipText(txtDecorator.getDescriptionText());
                } else {
                    txtDecorator.hide();
                }
            }
        }
    };
    return listener;
}
项目:Hydrograph    文件:ELTEventChangeListener.java   
@Override
public Listener getListener(
        final PropertyDialogButtonBar propertyDialogButtonBar,
        final ListenerHelper helpers, Widget... widgets) {
    final Widget[] wigetList = widgets;

    Listener listener = new Listener() {

        @Override
        public void handleEvent(Event event) {
            if (event.type == SWT.CHANGED) {
                propertyDialogButtonBar.enableApplyButton(true);
            }
        }
    };
    return listener;
}
项目:Hydrograph    文件:ELTCreateNewClassListener.java   
@Override
public Listener getListener(final PropertyDialogButtonBar propertyDialogButtonBar, final ListenerHelper helpers, Widget... widgets) {
    final Widget[] widgetList = widgets;

    if (helpers != null) {
        widgetConfig = (WidgetConfig) helpers.get(HelperType.WIDGET_CONFIG);
    }

     Listener listener=new Listener() {
        @Override
        public void handleEvent(Event event) {
            String comboValue = ((Combo) widgetList[0]).getText();
            if (comboValue.equals(Messages.CUSTOM)) {
                FilterOperationClassUtility.INSTANCE.createNewClassWizard((Text) widgetList[1], widgetConfig);
                if(helpers.get(HelperType.OPERATION_CLASS_DIALOG_OK_CONTROL) instanceof OperationClassDialog)
                {
                    OperationClassDialog operationClassDialog=(OperationClassDialog)helpers.get(HelperType.OPERATION_CLASS_DIALOG_OK_CONTROL);
                    operationClassDialog.getShell().setFocus();
                }

                propertyDialogButtonBar.enableApplyButton(true);
            }
        }
    };
    return listener;
}
项目:Hydrograph    文件:OverWriteWidgetSelectionListener.java   
@Override
public Listener getListener(final PropertyDialogButtonBar propertyDialogButtonBar, ListenerHelper helper,
        Widget... widgets) {
    final Widget[] widgetList = widgets;

    Listener listener = new Listener() {
        @Override
        public void handleEvent(Event event) {
            if (StringUtils.equalsIgnoreCase(((Combo) widgetList[0]).getText(), String.valueOf(Boolean.TRUE))) {
                MessageBox messageBox = new MessageBox(Display.getCurrent().getActiveShell(),
                        SWT.ICON_INFORMATION | SWT.OK);
                messageBox.setText(INFORMATION);
                messageBox.setMessage("All files at given location will be overwritten.");
                messageBox.open();
            }
        }
    };
    return listener;
}
项目:Hydrograph    文件:VerifyNumbericOrParameterFocusOutListener.java   
@Override
public Listener getListener(PropertyDialogButtonBar propertyDialogButtonBar, ListenerHelper helper,  Widget... widgets) {
    final Widget[] widgetList = widgets;
        Listener listener=new Listener() {
            @Override
            public void handleEvent(Event event) {
                String string=((Text) widgetList[0]).getText().trim();
                Matcher matcher=Pattern.compile("[\\d]*").matcher(string);
                if(!matcher.matches() && StringUtils.isNotBlank(string)){
                    ((Text) widgetList[0]).setText(string.replace("@{", "").replace("}", ""));
                    ((Text) widgetList[0]).setText("@{"+((Text) widgetList[0]).getText()+"}");
                    ((Text) widgetList[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 255));
                }
            }
        };
    return listener;
}
项目:Hydrograph    文件:ELTVerifyTextListener.java   
@Override
public Listener getListener(PropertyDialogButtonBar propertyDialogButtonBar, ListenerHelper helper,  Widget... widgets) {
        if (helper != null) {
            txtDecorator = (ControlDecoration) helper.get(HelperType.CONTROL_DECORATION);
        }
            Listener listener=new Listener() {

            @Override
            public void handleEvent(Event event) {
                String string=event.text;
                Matcher matchs=Pattern.compile(regex).matcher(string);
                logger.debug(this+"::ELTVerifyTextListener is called");
                if(!matchs.matches()){
                    txtDecorator.setDescriptionText(errorMessage);
                    txtDecorator.show();
                    event.doit=false;
                    logger.trace("Pattern does not matches !matchs.matches() with :" + string);
                }else{
                    txtDecorator.hide();
                    logger.trace("Pattern matches with :" + string);
                }
            }
        };
    return listener;
}
项目:n4js    文件:AbstractExportToSingleFileWizardPage.java   
/**
 * Handle all events and enablements for widgets in this page
 *
 * @param e
 *            Event
 */
@Override
public void handleEvent(Event e) {
    Widget source = e.widget;

    if (source == destinationBrowseButton) {
        handleDestinationBrowseButtonPressed();
    }

    updatePageCompletion();
}
项目:n4js    文件:ExportSelectionPage.java   
@Override
public void handleEvent(Event event) {
    Widget source = event.widget;

    if (source == destinationBrowseButton) {
        handleDestinationBrowseButtonPressed();
    }

    updatePageCompletion();

}
项目:eZooKeeper    文件:SwtThreadSafeDelegatingInvocationHandler.java   
/**
 * Returns the widget.
 * 
 * @return The widget
 */
public final Widget getWidget() {
    Object delegate = getDelegate();
    if (delegate instanceof IWidgetProvider) {
        return ((IWidgetProvider) delegate).getWidget();
    }
    return (Widget) delegate;
}
项目:RxSWT    文件:Preconditions.java   
public static boolean checkWidget(Observer<?> observer, Widget widget) {
    if (null == widget) {
        observer.onError(new NullPointerException("The given widget was null"));
        return false;
    } else if (widget.isDisposed()) {
        observer.onError(new IllegalStateException("The given widget is diposed"));
        return false;
    } else if (!(Thread.currentThread().equals(widget.getDisplay().getThread()))) {
        observer.onError(new IllegalStateException(
                "Expected to be called on the main thread but was " + Thread.currentThread().getName()));
        return false;
    }
    return true;
}
项目:xcalendar    文件:XCalendarDefaultEventHandler.java   
/**
 * 
 */
@Override
protected boolean accepts(Context context, Event event) {
    //
    final Widget widget = event.widget;
    if(calendar == null || calendar.isDisposed()) return false;

    //
    final Shell shell = calendar.getShell();
    if(widget != calendar && widget != shell) return false;
    return isMouseEvent(event) || event.type == SWT.Deactivate;
}
项目:gw4e.project    文件:AbstractRunner.java   
private   SWTBotView  waitForConsoleBeDisplayed () {
    getConsoleView(bot);
    Matcher<Widget> console = getConsoleMatcher () ;
    bot.waitUntil(Conditions.waitForWidget(console));
    SWTBotView consoleView = getConsoleView(bot);
    consoleView.setFocus();

    return consoleView;
}
项目:pgcodekeeper    文件:CheckedTreeViewer.java   
/**
 * Update element after a checkstate change.
 * @param element
 */
protected void doCheckStateChanged(Object element) {
    Widget item = findItem(element);
    if (item instanceof TreeItem) {
        TreeItem treeItem = (TreeItem) item;
        treeItem.setGrayed(false);
        updateChildrenItems(treeItem);
        updateParentItems(treeItem.getParentItem());
    }
}
项目:pgcodekeeper    文件:UiSync.java   
public static void exec(Widget w, Runnable r) {
    try {
        exec(w.getDisplay(), r);
    } catch (SWTException ex) {
        if (ex.code != SWT.ERROR_WIDGET_DISPOSED) {
            throw ex;
        }
        // do nothing: UI is already dead
    }
}
项目:Hydrograph    文件:FTPAuthenticEditorDialog.java   
private void updateWidgetsValue(Widget... widgets){
    if(optionList.length >1){
        for(int i = 0;  i <= widgets.length - 1; i++){
            if(widgets[i] != null && !widgets[i].isDisposed()){
                ((Text)widgets[i]).setText("");;
            }
        }
    }
}
项目:Hydrograph    文件:FTPWidgetUtility.java   
/**
 *  Create Label Widget
 * @param control
 * @param widgetName
 * @return
 */
public Widget createLabel(Composite control, String widgetName){
    Label label = new Label(control, SWT.NONE);
    GridData label_gridData = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    label.setLayoutData(label_gridData);
    label.setText(widgetName);
    return label;
}
项目:Hydrograph    文件:FTPWidgetUtility.java   
/**
 * Create Text Widget
 * @param control
 * @param widgetName
 * @return
 */
public Widget createText(Composite control, String widgetName, int style){
    Text text = new Text(control, style);
    GridData gd_text = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
    gd_text.horizontalIndent = 10;
    text.setLayoutData(gd_text);
    text.setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 204));
    return text;
}
项目:Hydrograph    文件:FTPWidgetUtility.java   
/**
 * Create Combo Widget
 * @param control
 * @param widgetName
 * @return
 */
public Widget CreateCombo(Composite control, String[] widgetName){
    Combo combo = new Combo(control, SWT.READ_ONLY);
    combo.setItems(widgetName);
    combo.select(0);
    GridData gd_partitionKeyButton = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
    gd_partitionKeyButton.horizontalIndent = 10;
    combo.setLayoutData(gd_partitionKeyButton);

    return combo;
}
项目:Hydrograph    文件:FTPOperationConfigDialog.java   
private void updateWidgetsValue(Widget... widgets){
        for(int i = 0;  i <= widgets.length - 1; i++){
            if(widgets[i] != null && !widgets[i].isDisposed()){
                ((Text)widgets[i]).setText("");;
            }
        }
}
项目:Hydrograph    文件:TransformDialog.java   
private void addButtonListener(final MappingSheetRow mappingSheetRow,
        final TableViewer operationalInputFieldTableViewer,Widget addButton) {
    addButton.addListener(SWT.MouseUp, new Listener(){

        @Override
        public void handleEvent(Event event) {
            operationInputTableAddButton(mappingSheetRow,
                    operationalInputFieldTableViewer);
            }
    });
}
项目:Hydrograph    文件:ELTSelectionTaskListener.java   
@Override
public Listener getListener(
        final PropertyDialogButtonBar propertyDialogButtonBar,
        final ListenerHelper helper, final Widget... widgets) {

    Listener listener = new Listener() {
        @Override
        public void handleEvent(Event event) {
            selectionListenerAction(propertyDialogButtonBar,helper, widgets);
        }
    };
    return listener;
}
项目:Hydrograph    文件:PortFocusOutListener.java   
@Override
public Listener getListener(PropertyDialogButtonBar propertyDialogButtonBar, ListenerHelper helpers,
        Widget... widgets) {
    if (helpers != null) {
        txtDecorator = (ControlDecoration) helpers.get(HelperType.CONTROL_DECORATION);
        txtDecorator.hide();
    }

    Listener listener = new Listener() {

        @Override
        public void handleEvent(Event event) {
            String charSet = ((Text) widgets[0]).getText().trim();
            if (SWT.FocusOut == event.type) {
                Matcher matchs=Pattern.compile(Constants.PORT_VALIDATION_REGEX).matcher(charSet);
                if (StringUtils.isBlank(charSet)){
                    txtDecorator.show();
                    ((Text) widgets[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 204));
                    ((Text) widgets[0]).setToolTipText(txtDecorator.getDescriptionText());
                } else if (matchs.matches()||ParameterUtil.isParameter(charSet)) {
                    txtDecorator.hide();
                }else{
                    txtDecorator.show();
                }
            } 
        }
    };
    return listener;
}
项目:Hydrograph    文件:DelimiterFocusOutListener.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);
        txtDecorator.hide();
    }

    Listener listener = new Listener() {

        @Override
        public void handleEvent(Event event) {
            String charSet = ((Text) widgetList[0]).getText();
            if (SWT.FocusOut == event.type) {
                if (StringUtils.isEmpty(charSet)){
                    txtDecorator.show();
                    ((Text) widgetList[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 204));
                    ((Text) widgetList[0]).setToolTipText(txtDecorator.getDescriptionText());
                } else {
                    txtDecorator.hide();
                }
            } 
        }
    };
    return listener;
}
项目: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;
}
项目:Hydrograph    文件:VerifyDigitLimitNumericListener.java   
@Override
public Listener getListener(
        PropertyDialogButtonBar propertyDialogButtonBar,
        ListenerHelper helpers, Widget... widgets) {
    final Widget[] widgetList = widgets;    
    if (helpers != null) {
        txtDecorator = (ControlDecoration) helpers.get(HelperType.CONTROL_DECORATION);
        characterLimit = (int) helpers.get(HelperType.CHARACTER_LIMIT);
    }


    Listener listener=new Listener() {
        @Override
        public void handleEvent(Event event) {
            Text text = (Text)widgetList[0];
            text.setTextLimit(characterLimit);
            String string=event.text;
            Matcher matchs=Pattern.compile("[\\d]*").matcher(string);
            if(!matchs.matches()){
                txtDecorator.setDescriptionText(Messages.FIELDBATCH);
                txtDecorator.show();
                event.doit=false;
        }else
            txtDecorator.hide();
        }
    };
return listener;
}
项目:Hydrograph    文件:ELTNormalFocusOutListener.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);
        txtDecorator.hide();
    }

    Listener listener = new Listener() {

        @Override
        public void handleEvent(Event event) {
            String charSet = ((Text) widgetList[0]).getText().trim();
            if (SWT.FocusOut == event.type) {
                if (StringUtils.isBlank(charSet)){
                    txtDecorator.show();
                    ((Text) widgetList[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 204));
                    ((Text) widgetList[0]).setToolTipText(txtDecorator.getDescriptionText());
                } else {
                    txtDecorator.hide();
                }
            } 
        }
    };
    return listener;
}
项目:Hydrograph    文件:OperationClassComboChangeListener.java   
@Override
public Listener getListener(final PropertyDialogButtonBar propertyDialogButtonBar, ListenerHelper helpers,
        Widget... widgets) {
    final Widget[] widgetList = widgets;

    Listener listener = new Listener() {
        @Override
        public void handleEvent(Event event) {
            String comboValue = ((Combo) widgetList[0]).getText();
            propertyDialogButtonBar.enableApplyButton(true);
            if (Messages.CUSTOM.equalsIgnoreCase(comboValue) && !FilterOperationClassUtility.INSTANCE.isCheckBoxSelected()) {
                ((Text) widgetList[1]).setText("");
                ((Text) widgetList[1]).setEnabled(true);
                FilterOperationClassUtility.INSTANCE.enableAndDisableButtons(true, false);
            } else {
                if(FilterOperationClassUtility.INSTANCE.isCheckBoxSelected())
                {
                    MessageBox messageBox = new MessageBox(new Shell(), SWT.ICON_ERROR | SWT.OK);
                    messageBox.setText(Messages.ERROR);
                    messageBox.setMessage(Messages.CHECKBOX_DISABLE_MESSAGE);
                    if (messageBox.open() == SWT.OK) {
                        ((Combo) widgetList[0]).setText(Messages.CUSTOM);
                    } 
                }
                else
                {
                    FilterOperationClassUtility.INSTANCE.setOperationClassNameInTextBox(comboValue, (Text)widgetList[1]);
                    ((Text) widgetList[1]).setEnabled(false);
                    FilterOperationClassUtility.INSTANCE.enableAndDisableButtons(false, false);
                    ((Button) widgetList[2]).setEnabled(false);
                }
            }
        } 
    };
    return listener;
}
项目:Hydrograph    文件:DisposeSchemaGridListener.java   
@Override
public void mouseAction(PropertyDialogButtonBar propertyDialogButtonBar,
        ListenerHelper helpers, Event event, Widget... widgets) {
       Table table=(Table)event.widget;
       Shell tip=(Shell) table.getData("tip");
       Label label=(Label) table.getData("label");
    if(tip!=null) 
    {
     tip.dispose();
        tip = null;
        label = null;
    }
}
项目:Hydrograph    文件:MouseExitSchemaGridListener.java   
@Override
public void mouseAction(PropertyDialogButtonBar propertyDialogButtonBar,
        ListenerHelper helpers, Event event, Widget... widgets) {
        Label label=(Label )event.widget;
        label.getShell().dispose();

}
项目:Hydrograph    文件:ELTGridDeleteAllSelectionListener.java   
@Override
public void selectionListenerAction(PropertyDialogButtonBar propertyDialogButtonBar, ListenerHelper helpers, Widget... widgets) {
    propertyDialogButtonBar.enableApplyButton(true);
    Table table = (Table) widgets[0];
    boolean userAns = WidgetUtility.eltConfirmMessage("Do you really want to delete all properties?");
    if (userAns) {
        ELTGridDetails gridDetails = (ELTGridDetails) helpers.get(HelperType.SCHEMA_GRID);
        gridDetails.getGrids().removeAll(gridDetails.getGrids());
        gridDetails.getTableViewer().refresh();
    }
}