Java Code Examples for org.eclipse.swt.widgets.Text.isDisposed()

The following are Jave code examples for showing how to use isDisposed() of the org.eclipse.swt.widgets.Text class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: eZooKeeper   File: ZooKeeperServerNewWizardPage1.java   Source Code and License Vote up 6 votes
@Override
public boolean canFlipToNextPage() {

    ZooKeeperServerNewWizardPage2 jmxPage = (ZooKeeperServerNewWizardPage2) getNextPage();

    if (jmxPage != null) {
        GridComposite jmxPageGridComposite = jmxPage.getGridComposite();

        if (jmxPageGridComposite != null) {

            String hostPortString = getHost() + ":" + String.valueOf(ZooKeeperServerDescriptor.DEFAULT_JMX_PORT);
            String defaultJmxServiceUrlString = "service:jmx:rmi:///jndi/rmi://" + hostPortString + "/jmxrmi";

            Text jmxUrlText = (Text) jmxPageGridComposite
                    .getControl(ZooKeeperServerNewWizardPage2.CONTROL_NAME_JMX_URL_TEXT);
            
            if (jmxUrlText != null && !jmxUrlText.isDisposed()) {
                jmxUrlText.setText(defaultJmxServiceUrlString);
            }
        }
    }

    return super.canFlipToNextPage();
}
 
Example 2
Project: eZooKeeper   File: ZnodeAclComposite.java   Source Code and License Vote up 5 votes
private void setId() {

        SetDigestIdDialog dialog = new SetDigestIdDialog(getShell());
        dialog.setBlockOnOpen(true);
        if (dialog.open() == SetDigestIdDialog.OK) {
            Text idEditor = (Text) _IdTableEditor.getEditor();
            if (idEditor != null && !idEditor.isDisposed()) {
                idEditor.setText(dialog.getDigestId());
                idEditor.forceFocus();
            }
        }

    }
 
Example 3
Project: Hydrograph   File: FTPProtocolWidget.java   Source Code and License Vote up 5 votes
private void addModifyListener(Text text){
	if(text != null && !text.isDisposed()){
		text.addModifyListener(new ModifyListener() {
			@Override
			public void modifyText(ModifyEvent e) {
				Utils.INSTANCE.addMouseMoveListener(text, cursor);	
			}
		});
	}
}
 
Example 4
Project: Hydrograph   File: FTPAuthenticEditorDialog.java   Source Code and License Vote up 5 votes
private void addModifyListener(Text text){
	if(text != null && !text.isDisposed()){
		text.addModifyListener(new ModifyListener() {
			@Override
			public void modifyText(ModifyEvent e) {
				Utils.INSTANCE.addMouseMoveListener(text, cursor);	
			}
		});
	}
}
 
Example 5
Project: Hydrograph   File: FTPOperationConfigDialog.java   Source Code and License Vote up 5 votes
private void addModifyListener(Text text){
	if(text != null && !text.isDisposed()){
		text.addModifyListener(new ModifyListener() {
			@Override
			public void modifyText(ModifyEvent e) {
				Utils.INSTANCE.addMouseMoveListener(text, cursor);	
			}
		});
	}
}
 
Example 6
Project: Hydrograph   File: FTPAuthenticEditorDialog.java   Source Code and License Vote up 4 votes
/**
 * @param container
 * @return
 */
private Control addIdKeyComposite(Composite container) {
	Composite keyFileComposite = new Composite(container, SWT.BORDER);
	keyFileComposite.setLayout(new GridLayout(3, false));
	keyFileComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
	
	FTPWidgetUtility ftpWidgetUtility = new FTPWidgetUtility();
	if(!StringUtils.equalsIgnoreCase(protocolText, "AWS S3 HTTPS")){
		Label userIdLbl = (Label) ftpWidgetUtility.createLabel(keyFileComposite, "User ID");
		text1 = (Text) ftpWidgetUtility.createText(keyFileComposite, "", SWT.BORDER);
		new Button(keyFileComposite, SWT.NONE).setVisible(false);
	}
	
	String label2Text = null;
	if(StringUtils.equalsIgnoreCase(protocolText, "AWS S3 HTTPS")){
		label2Text = "Porperty File";
	}else{
		label2Text = "Private Key";
	}
	
	Label privateKeyLbl = (Label) ftpWidgetUtility.createLabel(keyFileComposite, label2Text);
	setPropertyHelpText(privateKeyLbl, "Used to provide the value for authentication");
	privateKeyLbl.setCursor(new Cursor(privateKeyLbl.getDisplay(), SWT.CURSOR_HELP));
	text2 = (Text) ftpWidgetUtility.createText(keyFileComposite, "", SWT.BORDER);
	Utils.INSTANCE.addMouseMoveListener(text2, cursor);
	Button keyFileBrwsBtn = new Button(keyFileComposite, SWT.NONE);
	keyFileBrwsBtn.setText("...");
	
	selectionListener(keyFileBrwsBtn, text2);
	
	ControlDecoration text2ControlDecoration = WidgetUtility.addDecorator(text2,Messages.EMPTYFIELDMESSAGE);
	
	FTPWidgetUtility widgetUtility = new FTPWidgetUtility();
	if(text1 != null && !text1.isDisposed()){
		ControlDecoration text1ControlDecoration = WidgetUtility.addDecorator(text1,Messages.EMPTYFIELDMESSAGE);
		widgetUtility.validateWidgetText(text1, propertyDialogButtonBar, cursor, text1ControlDecoration);
	}
	widgetUtility.validateEmptyWidgetText(text2, propertyDialogButtonBar, cursor, text2ControlDecoration);
	
	if(text1!=null){
		addModifyListener(text1);
	}
	addModifyListener(text2);
	
	return keyFileComposite;
}