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

The following are Jave code examples for showing how to use setVisible() 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: TransformDialog.java   View Source Code Vote up 6 votes
private void setErrorMessageIfMergeExpressionIsNotValid() {
	for(MappingSheetRow mappingSheetRow:transformMapping.getMappingSheetRows())
   	{	
   	if(mappingSheetRow.isActive()
   	   &&mappingSheetRow.isExpression()
   	   &&StringUtils.isNotBlank(mappingSheetRow.getMergeExpressionDataForGroupCombine().getExpression())
   	   &&!(mappingSheetRow.getMergeExpressionDataForGroupCombine().isValid())
       )
   		
   	{
   		errorLabel=new Label( errorTableViewer.getTable(), SWT.NONE);
		errorLabel.setVisible(true);
		errorLabel.setText(mappingSheetRow.getMergeExpressionDataForGroupCombine().getErrorMessage()+" for Merge Expression"+mappingSheetRow.getOperationID()); 
		errorLabelList.add(errorLabel);
   	}	
   	}
	
}
 
Example 2
Project: Hydrograph   File: TransformDialog.java   View Source Code Vote up 6 votes
private void setErrorMessageIfExpressionIsNotValid() 
   {
   	for(MappingSheetRow mappingSheetRow:transformMapping.getMappingSheetRows())
   	{	
   	if(mappingSheetRow.isActive()
   	   &&mappingSheetRow.isExpression()
   	   &&StringUtils.isNotBlank(mappingSheetRow.getExpressionEditorData().getExpression())
   	   &&!(mappingSheetRow.getExpressionEditorData().isValid())
       )
   		
   	{
   		errorLabel=new Label( errorTableViewer.getTable(), SWT.NONE);
		errorLabel.setVisible(true);
		errorLabel.setText(mappingSheetRow.getExpressionEditorData().getErrorMessage()+" for "+mappingSheetRow.getOperationID()); 
		errorLabelList.add(errorLabel);
   	}	
   	}
}
 
Example 3
Project: Hydrograph   File: TransformDialog.java   View Source Code Vote up 6 votes
private void setErrorMessageForInvalidMapFields(){
	List<String> inputFieldNames = new ArrayList<String>();
	for(InputField inputField:transformMapping.getInputFields()){
		inputFieldNames.add(inputField.getFieldName());
	}
	
	for(int i = 0 ;i< transformMapping.getMapAndPassthroughField().size();i++){
		if(!inputFieldNames.contains(transformMapping.getMapAndPassthroughField().get(i).getPropertyName())){
		    errorLabel=new Label( errorTableViewer.getTable(), SWT.NONE);
			errorLabel.setVisible(true);
			errorLabel.setText("Field '"+transformMapping.getMapAndPassthroughField().get(i).getPropertyName()+"' is not present in Input Fields"); 
			errorLabelList.add(errorLabel);
			outputFieldIndices.add(i);
		}
	}
	for(int indices=0 ; indices<mappingTableViewer.getTable().getItemCount();indices++){
		if(outputFieldIndices.contains(indices)){
			mappingTableViewer.getTable().getItem(indices).setForeground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255,0,0));
		}else{
			mappingTableViewer.getTable().getItem(indices).setForeground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 0, 0, 0));
		}
	}
}
 
Example 4
Project: Hydrograph   File: TransformDialog.java   View Source Code Vote up 6 votes
private void setErrorMessageForDuplicateInputField() {
	if(!duplicateOperationInputFieldMap.isEmpty())
   {
	   for(Map.Entry<String, List<String>> entry:duplicateOperationInputFieldMap.entrySet())
	   {
		   for(String f:entry.getValue())
		   {   
			   boolean logError=true;
			   errorLabel=new Label( errorTableViewer.getTable(), SWT.NONE);
			   errorLabel.setVisible(true); 
			   errorLabel.setText("Duplicate Operation Input Field"+" "+f +" "+"exist in"+" "+entry.getKey()); 
			   for(Label tempErrorLabel:errorLabelList) {
				   if(StringUtils.equalsIgnoreCase(errorLabel.getText(),tempErrorLabel.getText()))
				   logError=false;
			   }
			   if(logError)
			   errorLabelList.add(errorLabel);
		   }
	   }
   }
}
 
Example 5
Project: Hydrograph   File: TransformDialog.java   View Source Code Vote up 6 votes
private void setErrorMessageForDuplicateOutputField() {
	Map<String,List<String>> duplicateOutputFieldMap=getDuplicateOutputFieldMap(temporaryOutputFieldMap);
	   if(!duplicateOutputFieldMap.isEmpty())
	   {	for (Map.Entry<String,List<String>> entry: duplicateOutputFieldMap.entrySet()) 
		{
		   for(String f:entry.getValue())
		   {   
			   boolean logError=true;   
		    errorLabel=new Label( errorTableViewer.getTable(), SWT.NONE);
			errorLabel.setVisible(true);
			errorLabel.setText("Duplicate Output Field "+" "+f+" "+"exist in"+" "+entry.getKey()); 
			
			for(Label tempErrorLabel:errorLabelList) {
				   if(StringUtils.equalsIgnoreCase(errorLabel.getText(),tempErrorLabel.getText()))
				   logError=false;
			   }
			if(logError)
			errorLabelList.add(errorLabel);
		   }
	    }
	   }
}
 
Example 6
Project: Hydrograph   File: RuntimePropertyDialog.java   View Source Code Vote up 6 votes
private void addErrorLabel(Composite container) {
	Composite composite_3 = new Composite(container, SWT.NONE);
	ColumnLayout cl_coposite_3 = new ColumnLayout();
	cl_coposite_3.topMargin=0;
	composite_3.setLayout(cl_coposite_3);
	ColumnLayoutData cld_composite_3 = new ColumnLayoutData();
	cld_composite_3.heightHint = 19;
	composite_3.setLayoutData(cld_composite_3);

	lblPropertyError = new Label(composite_3, SWT.NONE);
	ColumnLayoutData cld_lblPropertyError = new ColumnLayoutData();
	cld_lblPropertyError.heightHint = 25;
	lblPropertyError.setLayoutData(cld_lblPropertyError);
	lblPropertyError.setVisible(false);
	lblPropertyError.setForeground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 0, 0));
}
 
Example 7
Project: ide-plugins   File: CodeSWT.java   View Source Code Vote up 5 votes
@Override
protected Control createButtonBar(Composite parent) {
    final Composite buttonBar = (Composite) super.createButtonBar(parent);

    errorLabel = new Label(buttonBar, SWT.LEFT);
    errorLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, true, 1, 1));
    errorLabel.setText("There are no defined remote functions");
    errorLabel.setForeground(display.getSystemColor(SWT.COLOR_RED));
    errorLabel.setVisible(false);
    errorLabel.setFont(topFont);
    errorLabel.moveAbove(super.buttonControl);

    return buttonBar;
}
 
Example 8
Project: ide-plugins   File: AccountSWT.java   View Source Code Vote up 5 votes
@Override
protected Control createButtonBar(Composite parent) {
    final Composite buttonBar = (Composite) super.createButtonBar(parent);

    errorLabel = new Label(buttonBar, SWT.LEFT);
    errorLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1));
    errorLabel.setText("The provided credentials are invalid");
    errorLabel.setForeground(display.getSystemColor(SWT.COLOR_RED));
    errorLabel.setVisible(false);
    errorLabel.setFont(topFont);
    errorLabel.moveAbove(super.buttonControl);
    
    return buttonBar;
}
 
Example 9
Project: Hydrograph   File: ParameterGridDialog.java   View Source Code Vote up 5 votes
private void attachNote(final Composite container) {
	Label lblParameterGridNote=new Label(container, SWT.NONE);
	FontData fontData = lblParameterGridNote.getFont().getFontData()[0];
	Font font = new Font(lblParameterGridNote.getDisplay(), new FontData(fontData.getName(), fontData
	    .getHeight(), SWT.ITALIC));
	lblParameterGridNote.setText("Note - New parameters will be visible only after you save the job.");
	lblParameterGridNote.setFont(font);
	
	if(!visibleParameterGirdNote)
		lblParameterGridNote.setVisible(false);
}
 
Example 10
Project: Hydrograph   File: HivePartitionKeyValueDialog.java   View Source Code Vote up 5 votes
/**
 * 	
 * @param container
 */
private void addErrorLabel(Composite container) {
		
	lblPropertyError = new Label(container, SWT.NONE);
	lblPropertyError.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,true,true,0,0));
	lblPropertyError.setForeground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 0, 0));
	lblPropertyError.setText(Messages.HIVE_FIELD_DIALOG_ERROR);
	lblPropertyError.setVisible(false);
	lblPropertyError.setData("Error", lblPropertyError);
	keyValueTableViewer.setData("Error", lblPropertyError);
}
 
Example 11
Project: Hydrograph   File: HiveFieldDialogCellModifier.java   View Source Code Vote up 5 votes
/**
    * Returns a boolean value
    * 
    * @param viewer
    * 
    * @param errorLabel
    * 
    * This method will always return a boolean value to the caller.
    * The viewer argument is the specific table viewer for which the user
    * wants to validate the data. The errorLabel is used just for checking the present status
    * like whether the calling class has already set its value or not.
    * 
    */
public static boolean validatePartitionKeyTable(Viewer viewer,Label errorLabel) {
	errorLabel.setVisible(false);
	for (HivePartitionFields row : (List<HivePartitionFields>) viewer.getInput()) {
		if (errorLabel.getVisible()) {
			return false;
		}
		for (int i = 0; i < row.getRowFields().size()- 1; i++) {
			List<FilterProperties> list=(List<FilterProperties> ) viewer.getData(Constants.PARTITION_KEYS);
			if (StringUtils.isBlank(row.getRowFields().get(0))) {
				errorLabel.setVisible(true);
				errorLabel.setText("Column " + list.get(i).getPropertyname() + " " + Messages.HIVE_FIELD_DIALOG_ERROR);
				break;
			} else {
				if ((StringUtils.isBlank(row.getRowFields().get(i)))
						&& (StringUtils.isNotBlank((row.getRowFields().get(i + 1))))) {
					errorLabel.setVisible(true);
					errorLabel.setText("Column " + list.get(i).getPropertyname()+ " " + Messages.HIVE_FIELD_DIALOG_ERROR);
					break;
				} else {
					errorLabel.setVisible(false);
				}
			}
		}
	}
	if (!errorLabel.getVisible()) {
		return true;
	}
	return false;
}
 
Example 12
Project: Hydrograph   File: ELTSaparater.java   View Source Code Vote up 5 votes
@Override
public void attachWidget(Composite container) {
	// TODO Auto-generated method stub
	label = new Label(container, SWT.SEPARATOR | SWT.HORIZONTAL);
	GridData gd_defaultELTLable = new GridData(SWT.LEFT, SWT.CENTER, grabExcessSpace, false, 1, 1);
	gd_defaultELTLable.widthHint = lableWidth;
	label.setLayoutData(gd_defaultELTLable);	
	label.setVisible(visible);
	
	widget = label;
}
 
Example 13
Project: Hydrograph   File: FieldDialog.java   View Source Code Vote up 5 votes
private void addErrorLabel(Composite container) {
	Composite composite_3 = new Composite(container, SWT.NONE);
	composite_3.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
	composite_3.setLayout(new GridLayout(1, false));
	
	lblPropertyError = new Label(composite_3, SWT.NONE);
	lblPropertyError.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
	lblPropertyError.setVisible(false);
	lblPropertyError.setForeground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 0, 0));
}
 
Example 14
Project: Hydrograph   File: HiveInputExtractMetaStoreDialog.java   View Source Code Vote up 5 votes
private void addErrorLabel(Composite container) {
	
	lblPropertyError = new Label(container, SWT.NONE);
	lblPropertyError.setForeground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 0, 0));
	lblPropertyError.setText(CREDENTIAL_BLANK_ERROR);
	lblPropertyError.setVisible(false);
	lblPropertyError.setData("Error", lblPropertyError);
	
}
 
Example 15
Project: Hydrograph   File: HiveOutputFieldDialog.java   View Source Code Vote up 5 votes
private void addErrorLabel(Composite container) {
	Composite composite_3 = new Composite(container, SWT.NONE);
	composite_3.setLayout(new ColumnLayout());
	ColumnLayoutData cld_composite_3 = new ColumnLayoutData();
	cld_composite_3.heightHint = 72;
	composite_3.setLayoutData(cld_composite_3);

	lblPropertyError = new Label(composite_3, SWT.NONE);
	ColumnLayoutData cld_lblPropertyError = new ColumnLayoutData();
	cld_lblPropertyError.heightHint = 24;
	lblPropertyError.setLayoutData(cld_lblPropertyError);
	lblPropertyError.setVisible(false);
	lblPropertyError.setForeground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 0, 0));
}
 
Example 16
Project: Hydrograph   File: SecondaryColumnKeysDialog.java   View Source Code Vote up 5 votes
private void addErrorLabel(Composite container) {
	Composite composite_3 = new Composite(container, SWT.NONE);
	composite_3.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
	composite_3.setLayout(new ColumnLayout());

	lblPropertyError = new Label(composite_3, SWT.NONE);
	lblPropertyError.setVisible(false);
	lblPropertyError.setForeground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 0, 0));
}
 
Example 17
Project: Hydrograph   File: TransformDialog.java   View Source Code Vote up 5 votes
private void updateErrorListOnOutOfSync(RuntimeException exception) {
	if(StringUtils.isNotBlank(exception.getMessage())){
	for(Label label:errorLabelList){
		if(StringUtils.equals(label.getText(), exception.getMessage())){
			return;
		}
	}
	errorLabel = new Label(errorTableViewer.getTable(), SWT.NONE);
	errorLabel.setVisible(true);
	errorLabel.setText(exception.getMessage());
	errorLabelList.add(errorLabel);
	errorTableViewer.refresh();
	}
}
 
Example 18
Project: Hydrograph   File: JdkPathDialog.java   View Source Code Vote up 5 votes
private void createErrorLabel(Composite parent) {
	Composite composite=new Composite(parent, SWT.NONE);
	composite.setLayout(new GridLayout(3,false));
	composite.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
	
	errorLbl = new Label(composite, SWT.NONE);
	errorLbl.setForeground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 250,0,0));
	errorLbl.setText("Invalid JDK  bin path");
	errorLbl.setVisible(false);
}
 
Example 19
Project: convertigo-eclipse   File: InteractiveSplashHandler.java   View Source Code Vote up 4 votes
/**
 * 
 */
private void createUILabelBlank() {
	Label label = new Label(fCompositeLogin, SWT.NONE);
	label.setVisible(false);
}
 
Example 20
Project: Hydrograph   File: ParameterGridDialog.java   View Source Code Vote up 4 votes
/**
 * Create contents of the dialog.
 * @param parent
 */
@Override
protected Control createDialogArea(Composite parent) {
	final Composite container = createBaseContainer(parent);
	logger.debug("Created base container");
	
	Composite composite = attachButtonContainer(container);
	logger.debug("attached button container");
	
	attachFileParameterFileBrowser(container);
	logger.debug("added file browser");
	
	attachTextGrid(container);
	logger.debug("attached TextGrid");

	Label separator1 = new Label(container, SWT.SEPARATOR | SWT.HORIZONTAL);
	separator1.setVisible(false);
	Label separator2 = new Label(container, SWT.SEPARATOR | SWT.HORIZONTAL);
	separator2.setVisible(false);
	
	attachNote(container);
	
	addGridHeader();
	logger.debug("attached Grid header");
	
	attachAddRowButton(composite);
	logger.debug("attached add row button");

	attachRemoveRowButton(composite);
	logger.debug("attached remove button");

	fetchParameterFilePath();
	logger.debug("Retrived parameter file path");

	loadGridData();
	logger.debug("loaded grid data");

	addBaseContainerListeners(container);
	logger.debug("added listeners to base container");
	
	if(textGrid.getLastAddedRow() != null){
		((Text)textGrid.getLastAddedRow().getChildren()[2]).addTraverseListener(lastRowLastColumnTraverseListener);
	}
	
	return container;
}