Java Code Examples for org.eclipse.jface.dialogs.MessageDialog.openInformation()

The following are Jave code examples for showing how to use openInformation() of the org.eclipse.jface.dialogs.MessageDialog 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: Hydrograph   File: ExternalOperationExpressionUtil.java   Source Code and License Vote up 6 votes
/**
 * Exports UI-operation data to external file
 * 
 * @param file
 * @param mappingSheetRow
 * @param showErrorMessage
 * @param list
 * @throws ExternalTransformException
 */
public void exportOperation(File file, MappingSheetRow mappingSheetRow ,boolean showErrorMessage,List<GridRow> list) throws ExternalTransformException {
	if (file!=null) {
		try{
			Object object=convertUIOperationToJaxb(mappingSheetRow, list);
			marshal(ExternalOperations.class, file, object);
		} catch (Exception exception) {
			LOGGER.warn("Error ", exception);
			if(showErrorMessage){
				MessageDialog.openError(Display.getCurrent().getActiveShell(), "Error", "Failed to export output fields - \n"+exception.getMessage());
			}
			return;
		}
		MessageDialog.openInformation(Display.getCurrent().getActiveShell(), "Information", "Operation exported sucessfully");
	}
}
 
Example 2
Project: Hydrograph   File: FilterLogicExternalOperationExpressionUtil.java   Source Code and License Vote up 6 votes
public ExpressionData importExpression(File file, ExpressionData expressionData,boolean showErrorMessage,
	 String componentName) {
	
	if (file!=null) {
		try (FileInputStream fileInputStream=new FileInputStream(file)){
			ExternalExpressions externalExpression = (ExternalExpressions) ExternalOperationExpressionUtil.INSTANCE.unmarshal(fileInputStream,ExternalExpressions.class);
			
			expressionData = convertToUIExpression(externalExpression.getExternalExpressions(),expressionData, componentName);
			if(showErrorMessage && expressionData!=null){
				MessageDialog.openInformation(Display.getCurrent().getActiveShell(), "Information", "Expression imported sucessfully");
			}
		} catch (Exception exception) {
			LOGGER.warn("Error ", exception);
			if(showErrorMessage){
				MessageDialog.openError(Display.getCurrent().getActiveShell(), "Error", "Failed to import expression - Invalid XML");
			}
		}
	}
	return expressionData;
}
 
Example 3
Project: Hydrograph   File: ExternalOperationExpressionUtil.java   Source Code and License Vote up 6 votes
/**
 * Exports UI-mapping data to external file
 * 
 * @param file
 * @param transformMapping
 * @param showErrorMessage
 * @param componentName
 * @throws ExternalTransformException
 */
public void exportOutputFields(File file, TransformMapping transformMapping ,boolean showErrorMessage,String componentName) throws ExternalTransformException {
	if (file!=null) {
		try{
			Object object=convertUiOutputFieldsToJaxb(transformMapping,componentName);
			marshal(ExternalMappings.class, file, object);
		} catch (Exception exception) {
			LOGGER.warn("Error ", exception);
			if(showErrorMessage){
				MessageDialog.openError(Display.getCurrent().getActiveShell(), "Error", "Failed to export output fields - \n"+exception.getMessage());
			}
			return;
		}
		MessageDialog.openInformation(Display.getCurrent().getActiveShell(), "Information", "Fields exported sucessfully");
	}
}
 
Example 4
Project: Hydrograph   File: FilterLogicExternalOperationExpressionUtil.java   Source Code and License Vote up 6 votes
public OperationClassData importOperation(File file, OperationClassData operationClassData ,boolean showErrorMessage,
		 String componentName) throws ExternalTransformException {
	if (file!=null) {
		try (FileInputStream fileInputStream=new FileInputStream(file)){
			ExternalOperations externalOperation=(ExternalOperations) ExternalOperationExpressionUtil.INSTANCE.unmarshal(fileInputStream,ExternalOperations.class);
			operationClassData=convertToUIOperation(operationClassData, externalOperation.getExternalOperations(), componentName);
			if(operationClassData!=null && showErrorMessage){
				MessageDialog.openInformation(Display.getCurrent().getActiveShell(), "Information", "Operation imported sucessfully");
			}
		} catch (Exception exception) {
			LOGGER.warn("Error ", exception);
			if(showErrorMessage){
				MessageDialog.openError(Display.getCurrent().getActiveShell(), "Error", "Failed to import operation - Invalid XML");
			}
		}
	}
	return operationClassData;
}
 
Example 5
Project: scanning   File: StatusQueueView.java   Source Code and License Vote up 6 votes
/**
 * Pushes any previous run back into the UI
 */
protected void openSelection() {

	final StatusBean [] beans = getSelection();
	if (beans.length == 0) {
		MessageDialog.openInformation(getViewSite().getShell(), "Please select a run", "Please select a run to open.");
		return;
	}

	// TODO FIXME Change to IScanBuilderService not selections so that it works with e4.
	// We fire a special object into the selection mechanism with the data for this run.
	// It is then up to parts to respond to this selection and update their contents.
	// We call fireSelection as the openRequest isn't in the table. This sets the workb
	for (StatusBean bean : beans) {
		selectionProvider.fireSelection(new StructuredSelection(new OpenRequest(bean)));
	}
}
 
Example 6
Project: Hydrograph   File: ExternalOperationExpressionUtil.java   Source Code and License Vote up 6 votes
/**
 * Imports UI-expression data from external file
 * 
 * @param file
 * @param mappingSheetRow
 * @param showErrorMessage
 * @param transformMapping
 * @param componentName
 * @return
 */
public MappingSheetRow importExpression(File file, MappingSheetRow mappingSheetRow, boolean showErrorMessage,
		TransformMapping transformMapping, String componentName) {
	if (file!=null) {
		try (FileInputStream fileInputStream=new FileInputStream(file)){
			ExternalExpressions externalExpression = (ExternalExpressions) unmarshal(fileInputStream,ExternalExpressions.class);
			mappingSheetRow = convertToUIExpression(mappingSheetRow, externalExpression.getExternalExpressions(),transformMapping, componentName);
			if(showErrorMessage && mappingSheetRow!=null){
				MessageDialog.openInformation(Display.getCurrent().getActiveShell(), "Information", "Expression imported sucessfully");
			}
		} catch (Exception exception) {
			LOGGER.warn("Error ", exception);
			if(showErrorMessage){
				MessageDialog.openError(Display.getCurrent().getActiveShell(), "Error", "Failed to import expression - Invalid XML");
			}
		}
	}
	return mappingSheetRow;
}
 
Example 7
Project: OCCI-Studio   File: DesignServices.java   Source Code and License Vote up 5 votes
/**
 * Update an OCCI entity.
 * @param entity the entity to update.
 */
public void updateEntity(Entity entity)
{
	Client jocciClient = getJocciClient(entity);
	if(jocciClient == null) {
		return;
	}

       // Create the jOCCI entity.
       cz.cesnet.cloud.occi.core.Entity jocciEntity = newJocciEntity(entity);
       if(jocciEntity == null) {
       	return;
       }
       try {
		jocciEntity.setId(entity.getId());
	} catch (InvalidAttributeValueException iave) {
		reportException(iave);
		return;
	}

       try {
       	// Update the OCCI resource.
       	boolean updated = jocciClient.update(jocciEntity);
       	if(updated) {
             MessageDialog.openInformation(Display.getCurrent().getActiveShell(), "Update OCCI Entity", "Entity " + getLocation(entity) + " updated");
       	} else {
             MessageDialog.openWarning(Display.getCurrent().getActiveShell(), "Update OCCI Entity", "Entity " + getLocation(entity) + " not updated");
       	}
       } catch (CommunicationException ce) {
       	reportException(ce);
       	return;
       }
}
 
Example 8
Project: visuflow-plugin   File: ToggleJimpleBreakpointsTarget.java   Source Code and License Vote up 5 votes
private void createJimpleBreakpoint() throws CoreException, BadLocationException {
	IDocument document = getDocument();
	IFile file = getFile();
	int lineNumber = getLineNumber();

	int offset = document.getLineOffset(lineNumber - 1);
	int length = document.getLineInformation(lineNumber - 1).getLength();
	int charStart = offset;
	int charEnd = offset + length;
	try {
		String unitFqn = getUnitFqn(lineNumber - 1, offset, length);

		IMarker m = file.createMarker(JIMPLE_BREAKPOINT_MARKER);
		m.setAttribute(IMarker.LINE_NUMBER, getLineNumber());
		m.setAttribute(IMarker.MESSAGE, "Unit breakpoint: " + file.getName() + " [Line "+getLineNumber()+"]");
		m.setAttribute("Jimple.file", file.getProjectRelativePath().toPortableString());
		m.setAttribute("Jimple.project", file.getProject().getName());
		m.setAttribute("Jimple.unit.charStart", charStart);
		m.setAttribute("Jimple.unit.charEnd", charEnd);
		m.setAttribute("Jimple.unit.fqn", unitFqn);

		JimpleBreakpointManager.getInstance().createBreakpoint(m);
	} catch(UnitNotFoundException e) {
		String msg = "The selected unit couldn't be found in our Jimple model. This might be a problem related to Jimple optimizations.";
		MessageDialog.openInformation(Display.getCurrent().getActiveShell(), "Breakpoint could not be placed", msg);
	}
}
 
Example 9
Project: Hydrograph   File: CustomMessageBox.java   Source Code and License Vote up 5 votes
public void open(){
	if(messageType==SWT.ERROR){
		MessageDialog.setDefaultOrientation(SWT.NONE);
		MessageDialog.openError(Display.getCurrent().getActiveShell(), title, message);
	}
	if(messageType==SWT.ICON_INFORMATION){
		MessageDialog.openInformation(Display.getCurrent().getActiveShell(), title, message);
	}
	if(messageType==SWT.ICON_WARNING){
		MessageDialog.openWarning(Display.getCurrent().getActiveShell(), title, message);
	}
}
 
Example 10
Project: Hydrograph   File: ELTLookupConfigGrid.java   Source Code and License Vote up 5 votes
@Override
protected void okPressed() {
	configProperty.setLookupKey(lookupKey);
	configProperty.setDriverKey(driverKey);
	if(!oldConfigProperty.equals(configProperty)){
		propertyDialogButtonBar.enableApplyButton(true);
		MessageDialog.openInformation(Display.getCurrent().getActiveShell(), Messages.INFORMATION, Messages.LOOKUP_PORT_CHANGE);
	}
	
	
	super.okPressed();
}
 
Example 11
Project: Open_Source_ECOA_Toolset_AS5   File: TypesEditorContributor.java   Source Code and License Vote up 5 votes
private void createActions() {
	sampleAction = new Action() {
		public void run() {
			MessageDialog.openInformation(null, "osets-eclipse-plugin", "Sample Action Executed");
		}
	};
	sampleAction.setText("Sample Action");
	sampleAction.setToolTipText("Sample Action tool tip");
	sampleAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(IDE.SharedImages.IMG_OBJS_TASK_TSK));
}
 
Example 12
Project: Open_Source_ECOA_Toolset_AS5   File: ServicesEditorContributor.java   Source Code and License Vote up 5 votes
private void createActions() {
	sampleAction = new Action() {
		public void run() {
			MessageDialog.openInformation(null, "osets-eclipse-plugin", "Sample Action Executed");
		}
	};
	sampleAction.setText("Sample Action");
	sampleAction.setToolTipText("Sample Action tool tip");
	sampleAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(IDE.SharedImages.IMG_OBJS_TASK_TSK));
}
 
Example 13
Project: eZooKeeper   File: BaseAction.java   Source Code and License Vote up 4 votes
protected final void openInformationMessageDialog(String title, String message) {
    MessageDialog.openInformation(getActiveShell(), title, message);
}
 
Example 14
Project: neoscada   File: AbstractChartView.java   Source Code and License Vote up 4 votes
public void print ()
{
    if ( Printer.getPrinterList ().length == 0 )
    {
        MessageDialog.openInformation ( this.shell, "No printer", "No installed printer could be found" );
        return;
    }

    final PrintDialog dlg = new PrintDialog ( this.shell, SWT.APPLICATION_MODAL );

    final PrinterData initialPd = Printer.getDefaultPrinterData ();
    initialPd.orientation = PrinterData.LANDSCAPE;
    dlg.setPrinterData ( initialPd );

    final PrinterData pd = dlg.open ();

    if ( pd != null )
    {
        final Printer printer = new Printer ( pd );
        final ResourceManager rm = new DeviceResourceManager ( printer );
        try
        {
            printer.startJob ( "Chart" );
            printer.startPage ();

            final GC gc = new GC ( printer );
            try
            {
                final SWTGraphics g = new SWTGraphics ( gc, rm );
                try
                {
                    this.viewer.getChartRenderer ().paint ( g );
                }
                finally
                {
                    g.dispose ();
                }
            }
            finally
            {
                gc.dispose ();
            }

            printer.endPage ();
            printer.endJob ();
        }
        finally
        {
            rm.dispose ();
            printer.dispose ();
        }
    }
}
 
Example 15
Project: neoscada   File: WriteableComposite.java   Source Code and License Vote up 4 votes
protected void makeWarnDialog ()
{
    final Shell shell = PlatformUI.getWorkbench ().getActiveWorkbenchWindow ().getShell ();
    MessageDialog.openInformation ( shell, Messages.WriteableComposite_wrongInput, String.format ( Messages.WriteableComposite_requiredInput, this.ceil, this.floor ) );
}
 
Example 16
Project: Tarski   File: CreateUserRequirementDocument.java   Source Code and License Vote up 4 votes
public void MessageDialogSuccessful(IWorkbenchWindow window) {
  MessageDialog.openInformation(window.getShell(), "ModelWriter Project Management",
      "The URD document has been created successfully");
}
 
Example 17
Project: Tarski   File: CreateSoftwareRequirementDocument.java   Source Code and License Vote up 4 votes
public void MessageDialogSuccessful(IWorkbenchWindow window) {
  MessageDialog.openInformation(window.getShell(), "ModelWriter Project Management",
      "The SRD document has been created successfully");
}
 
Example 18
Project: Tarski   File: CreateSoftwareRequirementReviewMeetingDocument.java   Source Code and License Vote up 4 votes
public void MessageDialogSuccessful(IWorkbenchWindow window) {
  MessageDialog.openInformation(window.getShell(), "ModelWriter Project Management",
      "The SRD document has been created successfully");
}
 
Example 19
Project: gw4e.project   File: DialogManager.java   Source Code and License Vote up 4 votes
/**
 * @param title
 * @param text
 */
public static void displayInformation(String title, String text) {
	if (isAutomatedMode ()) return;
	MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), title, text);
}
 
Example 20
Project: vertigo-chroma-kspplugin   File: UiUtils.java   Source Code and License Vote up 2 votes
/**
 * Affiche un message d'information dans une popup.
 * 
 * @param message Message à afficher.
 */
public static void showMessage(String message) {
	MessageDialog.openInformation(getShell(), "Vertigo Plugin Information", message);
}