Java Code Examples for org.eclipse.swt.widgets.Label.setEnabled()

The following are Jave code examples for showing how to use setEnabled() of the org.eclipse.swt.widgets.Label class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: Hydrograph   File: CategoriesDialogTargetComposite.java   View Source Code Vote up 6 votes
private void createMiddleLayer() {
	Composite middleComposite = new Composite(this, SWT.NONE);
	middleComposite.setLayout(new GridLayout(1, false));
	middleComposite.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, true, 1, 1));
	
	addAllSelectedPackagesLabel = new Label(middleComposite, SWT.NONE);
	addAllSelectedPackagesLabel.setBounds(6, 70, 25, 25);
	addAllSelectedPackagesLabel.setImage(ImagePathConstant.SELECT_ALL_ICON.getImageFromRegistry());
	addAllSelectedPackagesLabel.setToolTipText("Add all packages");
	addListenerToSelectAllLable(addAllSelectedPackagesLabel);
	addAllSelectedPackagesLabel.setEnabled(false);
	
	Label dummyLabel = new Label(middleComposite, SWT.NONE);
	
	addSelectedPackagesLabel = new Label(middleComposite, SWT.NONE);
	addSelectedPackagesLabel.setBounds(6, 110, 25, 25);
	addSelectedPackagesLabel.setImage(ImagePathConstant.SELECT_ICON.getImageFromRegistry());
	addSelectedPackagesLabel.setToolTipText("Add selected packages");
	addListenerToSelectLable(addSelectedPackagesLabel);
	addSelectedPackagesLabel.setEnabled(false);
}
 
Example 2
Project: gw4e.project   File: GeneratorChoiceComposite.java   View Source Code Vote up 5 votes
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);
}
 
Example 3
Project: Hydrograph   File: HiveOutputFieldDialog.java   View Source Code Vote up 5 votes
protected Composite addButtonPanel(Composite container) {
	Composite composite_1 = new Composite(container, SWT.NONE);
	composite_1.setLayout(new GridLayout(5, false));
	ColumnLayoutData cld_composite_1 = new ColumnLayoutData();
	cld_composite_1.horizontalAlignment = ColumnLayoutData.RIGHT;
	cld_composite_1.heightHint = 28;
	composite_1.setLayoutData(cld_composite_1);

	Label addButton = new Label(composite_1, SWT.NONE);
	addButton.setToolTipText(Messages.ADD_KEY_SHORTCUT_TOOLTIP);
	addButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
	addButton.setImage(ImagePathConstant.ADD_BUTTON.getImageFromRegistry());
	attachAddButtonListern(addButton);

	deleteButton = new Label(composite_1, SWT.NONE);
	deleteButton.setToolTipText(Messages.DELETE_KEY_SHORTCUT_TOOLTIP);
	deleteButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
	deleteButton.setImage(ImagePathConstant.DELETE_BUTTON.getImageFromRegistry());
	attachDeleteButtonListener(deleteButton);

	upButton = new Label(composite_1, SWT.NONE);
	upButton.setToolTipText(Messages.MOVE_UP_KEY_SHORTCUT_TOOLTIP);
	upButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
	upButton.setImage(ImagePathConstant.MOVEUP_BUTTON.getImageFromRegistry());
	attachUpButtonListener(upButton);

	downButton = new Label(composite_1, SWT.NONE);
	downButton.setToolTipText(Messages.MOVE_DOWN_KEY_SHORTCUT_TOOLTIP);
	downButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
	downButton.setImage(ImagePathConstant.MOVEDOWN_BUTTON.getImageFromRegistry());
	attachDownButtonListerner(downButton);
	deleteButton.setEnabled(false);
	upButton.setEnabled(false);
	downButton.setEnabled(false);
	return composite_1;
}
 
Example 4
Project: gw4e.project   File: GeneratorChoiceComposite.java   View Source Code Vote up 4 votes
private void createExtendMode() {
	btnExtendRadioButton = new Button(this, SWT.RADIO);
	btnExtendRadioButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 12, 1));
	btnExtendRadioButton.setText(MessageUtil.getString("extending_class"));
	btnExtendRadioButton.setSelection(false);
	btnExtendRadioButton.addListener(SWT.Selection, new Listener() {
		public void handleEvent(Event e) {
			switch (e.type) {
			case SWT.Selection:
				updateUI();
				break;
			}
		}
	});
	btnExtendRadioButton.setData(GW4E_CONVERSION_WIDGET_ID, GW4E_EXTEND_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));

	lblExtendedLabel = new Label(composite, SWT.NONE);
	lblExtendedLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 4, 1));
	lblExtendedLabel.setText(MessageUtil.getString("class_extended"));
	lblExtendedLabel.setEnabled(false);

	comboExtendedClassnameViewer = new AncestorViewer(composite);
	comboExtendedClassnameViewer.initialize(GW4E_CONVERSION_COMBO_ANCESTOR_EXTEND_TEST, false);
	comboExtendedClassnameViewer.getCombo().setData(GW4E_CONVERSION_WIDGET_ID, GW4E_CONVERSION_COMBO_ANCESTOR_EXTEND_TEST);
	
	Combo combo = comboExtendedClassnameViewer.getCombo();
	combo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 8, 1));
	combo.setEnabled(false);

	lblExtendingLabel = new Label(composite, SWT.NONE);
	lblExtendingLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 4, 1));
	lblExtendingLabel.setText(MessageUtil.getString("classname"));
	lblExtendingLabel.setEnabled(false);

	extendingClassnameText = new Text(composite, SWT.BORDER);
	extendingClassnameText.setEnabled(false);
	extendingClassnameText.addModifyListener(new ModifyListener() {
		public void modifyText(ModifyEvent event) {
			listener.handleEvent(null);
		}
	});
	extendingClassnameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 8, 1));
	extendingClassnameText.setEnabled(false);
	extendingClassnameText.setData(GW4E_CONVERSION_WIDGET_ID, GW4E_EXTEND_CLASS_TEXT);
}
 
Example 5
Project: Hydrograph   File: FTPOperationConfigDialog.java   View Source Code Vote up 4 votes
private Control S3GetPutFile(Composite control){
	Composite composite = new Composite(control, SWT.BORDER);
	composite.setLayout(new GridLayout(3, false));
	composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
	
	FTPWidgetUtility ftpWidgetUtility = new FTPWidgetUtility();
	Label localLbl = (Label) ftpWidgetUtility.createLabel(composite, Messages.LOCAL_PATH);
	setPropertyHelpText(localLbl, "Used to provide local path");
	text1 = (Text) ftpWidgetUtility.createText(composite, "", SWT.BORDER);
	Button localPathBrwsBtn = new Button(composite, SWT.NONE);
	localPathBrwsBtn.setText("...");
	selectionListener(localPathBrwsBtn, text1);
	
	Label bucket = (Label) ftpWidgetUtility.createLabel(composite, Messages.S3_BUCKET);
	setPropertyHelpText(bucket, "Used to provide Bucket Value");
	text2 = (Text) ftpWidgetUtility.createText(composite, "", SWT.BORDER);
	new Button(composite, SWT.NONE).setVisible(false);
	
	Label filepathLbl = (Label) ftpWidgetUtility.createLabel(composite, Messages.S3_FILE_PATH);
	setPropertyHelpText(filepathLbl, "Used to provide File Path");
	text3 = (Text) ftpWidgetUtility.createText(composite, "", SWT.BORDER);
	new Button(composite, SWT.NONE).setVisible(false);
	
	Label regionLbl = (Label) ftpWidgetUtility.createLabel(composite, Messages.AWS_REGION);
	setPropertyHelpText(regionLbl, "Used to provide AWS Region");
	text4 = (Text) ftpWidgetUtility.createText(composite, "", SWT.BORDER);
	new Button(composite, SWT.NONE).setVisible(false);
	
	overWriteLabel = (Label) ftpWidgetUtility.createLabel(composite, Messages.WRITE_MODE);
	setPropertyHelpText(overWriteLabel, "Used to select OverWrite value");
	overwriteCombo = (Combo) ftpWidgetUtility.CreateCombo(composite, new String[]{Messages.OVERWRITE_IF_EXISTS, Messages.FAIL_IF_EXISTS});
	overWriteLabel.setEnabled(true);
	overwriteCombo.setEnabled(true);
	
	text1ControlDecoration = WidgetUtility.addDecorator(text1, Messages.EMPTYFIELDMESSAGE);
	text2ControlDecoration = WidgetUtility.addDecorator(text2, Messages.EMPTYFIELDMESSAGE);
	text4ControlDecoration = WidgetUtility.addDecorator(text4, Messages.EMPTYFIELDMESSAGE);
	
	FTPWidgetUtility widgetUtility = new FTPWidgetUtility();
	widgetUtility.validateEmptyWidgetText(text1, propertyDialogButtonBar, cursor, text1ControlDecoration);
	widgetUtility.validateEmptyWidgetText(text2, propertyDialogButtonBar, cursor, text2ControlDecoration);
	widgetUtility.validateEmptyWidgetText(text4, propertyDialogButtonBar, cursor, text4ControlDecoration);
	
	if(authenticationModeCombo.getSelectionIndex() != 1 || StringUtils
			.equalsIgnoreCase(authenticationModeCombo.getText(), Constants.PUT_FILE_S3)){
		text3ControlDecoration = WidgetUtility.addDecorator(text3, Messages.EMPTYFIELDMESSAGE);
		widgetUtility.validateEmptyWidgetText(text3, propertyDialogButtonBar, cursor, text3ControlDecoration);
	}
	
	text3.addModifyListener(new ModifyListener() {
		@Override
		public void modifyText(ModifyEvent event) {
			if(authenticationModeCombo.getSelectionIndex() == 1){
				text3ControlDecoration.hide();
				text3.setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 255));
			}
		}
	});
	
	
	return composite;
}