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

The following are Jave code examples for showing how to use openQuestion() 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: scanning   File: ControlTreeViewer.java   Source Code and License Vote up 6 votes
private void removeNode() {
	final INamedNode selectedNode = getSelection();
	ControlTree controlTree = getControlTree();
	INamedNode parent = controlTree.getNode(selectedNode.getParentName());
	if (selectedNode.getChildren()==null || selectedNode.getChildren().length<1) {
		controlTree.delete(selectedNode);
	} else {
		boolean ok = MessageDialog.openQuestion(content.getShell(), "Confirm Delete", "The item '"+selectedNode.getName()+"' is a group.\n\nAre you sure you would like to delete it?");
		if (ok) controlTree.delete(selectedNode);
	}
	viewer.refresh();
	if (parent.hasChildren()) {
		setSelection(parent.getChildren()[parent.getChildren().length-1]);
	} else {
	    setSelection(parent);
	}
}
 
Example 2
Project: gemoc-studio   File: FsmEditor.java   Source Code and License Vote up 5 votes
/**
 * Shows a dialog that asks if conflicting changes should be discarded.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected boolean handleDirtyConflict() {
	return
		MessageDialog.openQuestion
			(getSite().getShell(),
			 getString("_UI_FileConflict_label"),
			 getString("_WARN_FileConflict"));
}
 
Example 3
Project: OCCI-Studio   File: PlatformEditor.java   Source Code and License Vote up 5 votes
/**
 * Shows a dialog that asks if conflicting changes should be discarded.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected boolean handleDirtyConflict() {
	return
		MessageDialog.openQuestion
			(getSite().getShell(),
			 getString("_UI_FileConflict_label"),
			 getString("_WARN_FileConflict"));
}
 
Example 4
Project: gemoc-studio-modeldebugging   File: TracingannotationsEditor.java   Source Code and License Vote up 5 votes
/**
 * Shows a dialog that asks if conflicting changes should be discarded.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected boolean handleDirtyConflict() {
	return
		MessageDialog.openQuestion
			(getSite().getShell(),
			 getString("_UI_FileConflict_label"),
			 getString("_WARN_FileConflict"));
}
 
Example 5
Project: time4sys   File: MappingEditor.java   Source Code and License Vote up 5 votes
/**
 * Shows a dialog that asks if conflicting changes should be discarded.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected boolean handleDirtyConflict() {
	return
		MessageDialog.openQuestion
			(getSite().getShell(),
			 getString("_UI_FileConflict_label"),
			 getString("_WARN_FileConflict"));
}
 
Example 6
Project: neoscada   File: DeleteConnection.java   Source Code and License Vote up 5 votes
@Override
public Object execute ( final ExecutionEvent event ) throws ExecutionException
{
    logger.info ( "Execute command: {}", event ); //$NON-NLS-1$

    final Collection<ConnectionHolder> connections = getConnections ();

    final boolean result = MessageDialog.openQuestion ( getWorkbenchWindow ().getShell (), Messages.DeleteConnection_MessageDialog_Title, MessageFormat.format ( Messages.DeleteConnection_MessageDialog_Message, connections.size () ) );
    if ( !result )
    {
        // user pressed "NO"
        return null;
    }

    final MultiStatus status = new MultiStatus ( Activator.PLUGIN_ID, 0, Messages.DeleteConnection_MultiStatus_Text, null );

    for ( final ConnectionHolder holder : connections )
    {
        final ConnectionStore store = AdapterHelper.adapt ( holder.getDiscoverer (), ConnectionStore.class );
        if ( store != null )
        {
            try
            {
                store.remove ( holder.getConnectionInformation () );
            }
            catch ( final CoreException e )
            {
                logger.info ( "Failed to remove connection", e ); //$NON-NLS-1$
                status.add ( e.getStatus () );
            }
        }
    }

    return null;
}
 
Example 7
Project: time4sys   File: Time4sysEditor.java   Source Code and License Vote up 5 votes
/**
 * Shows a dialog that asks if conflicting changes should be discarded.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected boolean handleDirtyConflict() {
	return
		MessageDialog.openQuestion
			(getSite().getShell(),
			 getString("_UI_FileConflict_label"),
			 getString("_WARN_FileConflict"));
}
 
Example 8
Project: scanning   File: RerunHandler.java   Source Code and License Vote up 5 votes
@Override
public boolean run(XcenBean copy) throws Exception {

       boolean ok = MessageDialog.openQuestion(Display.getCurrent().getActiveShell(), "Rerun '"+copy.getName()+"'",
                       "Would you like to rerun X-Ray Centering?\n\n"+
                       "The bean was:\n"+copy);
       if (ok) {
           ISubmitter<XcenBean> submitter = eventService.createSubmitter(conf.getUri(), conf.getSubmissionQueue());
           copy.setName("Copy of "+copy.getName());
           submitter.submit(copy, true);
           submitter.disconnect(); // Not really required for submitters.
       }
       return true; // We handled it
}
 
Example 9
Project: time4sys   File: GrmEditor.java   Source Code and License Vote up 5 votes
/**
 * Shows a dialog that asks if conflicting changes should be discarded.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected boolean handleDirtyConflict() {
	return
		MessageDialog.openQuestion
			(getSite().getShell(),
			 getString("_UI_FileConflict_label"),
			 getString("_WARN_FileConflict"));
}
 
Example 10
Project: time4sys   File: GqamEditor.java   Source Code and License Vote up 5 votes
/**
 * Shows a dialog that asks if conflicting changes should be discarded.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected boolean handleDirtyConflict() {
	return
		MessageDialog.openQuestion
			(getSite().getShell(),
			 getString("_UI_FileConflict_label"),
			 getString("_WARN_FileConflict"));
}
 
Example 11
Project: time4sys   File: AnalysisEditor.java   Source Code and License Vote up 5 votes
/**
 * Shows a dialog that asks if conflicting changes should be discarded.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected boolean handleDirtyConflict() {
	return
		MessageDialog.openQuestion
			(getSite().getShell(),
			 getString("_UI_FileConflict_label"),
			 getString("_WARN_FileConflict"));
}
 
Example 12
Project: time4sys   File: TraceEditor.java   Source Code and License Vote up 5 votes
/**
 * Shows a dialog that asks if conflicting changes should be discarded.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected boolean handleDirtyConflict() {
	return
		MessageDialog.openQuestion
			(getSite().getShell(),
			 getString("_UI_FileConflict_label"),
			 getString("_WARN_FileConflict"));
}
 
Example 13
Project: pgsqlblocks   File: ApplicationView.java   Source Code and License Vote up 5 votes
@Override
protected boolean canHandleShellCloseEvent() {
    if (settings.isConfirmExit() && !MessageDialog.openQuestion(getShell(), resourceBundle.getString("confirm_action"),
            resourceBundle.getString("exit_confirm_message"))) {
        return false;
    }
    if (viewListener != null) {
        viewListener.applicationViewWillDisappear();
    }
    return super.canHandleShellCloseEvent();
}
 
Example 14
Project: gemoc-studio   File: GexpressionsEditor.java   Source Code and License Vote up 5 votes
/**
 * Shows a dialog that asks if conflicting changes should be discarded.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected boolean handleDirtyConflict() {
	return
		MessageDialog.openQuestion
			(getSite().getShell(),
			 getString("_UI_FileConflict_label"),
			 getString("_WARN_FileConflict"));
}
 
Example 15
Project: scanning   File: DetectorView.java   Source Code and License Vote up 5 votes
protected void configure() {

		DeviceInformation<?> info = getSelection();
		if (info==null) return; // Nothing to configure

		boolean ok = MessageDialog.openQuestion(getViewSite().getShell(), "Confirm Configure", "Are you sure you want to configure '"+info.getName()+"' now?\n\n"+
		                                             "If the device is active or being used this will change its behaviour.");
		if (!ok) return;

		try {
			IRunnableDevice<Object> device = dservice.getRunnableDevice(info.getName());
			Object model = info.getModel();

			// Pass null to 'clear' the validation results view
			selectionProvider.fireSelection(new StructuredSelection(new ValidateResults(info.getName(), null)));

			Object validateReturn = device.validateWithReturn(model);

			ValidateResults validateResults = new ValidateResults(info.getName(), validateReturn);

			showValidationResultsView(validateResults);

			selectionProvider.fireSelection(new StructuredSelection(validateResults));

			device.configure(model);

		} catch (ScanningException|ValidationException ne) {
			ErrorDialog.openError(getViewSite().getShell(), "Configure Failed", "The configure of '"+info.getName()+"' failed",
                                            new Status(IStatus.ERROR, "org.eclipse.scanning.device.ui", ne.getMessage(), ne));
			logger.error("Cannot configure '"+info.getName()+"'", ne);
		}
	}
 
Example 16
Project: time4sys   File: NfpEditor.java   Source Code and License Vote up 5 votes
/**
 * Shows a dialog that asks if conflicting changes should be discarded.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected boolean handleDirtyConflict() {
	return
		MessageDialog.openQuestion
			(getSite().getShell(),
			 getString("_UI_FileConflict_label"),
			 getString("_WARN_FileConflict"));
}
 
Example 17
Project: OCCI-Studio   File: InfrastructureEditor.java   Source Code and License Vote up 5 votes
/**
 * Shows a dialog that asks if conflicting changes should be discarded.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected boolean handleDirtyConflict() {
	return
		MessageDialog.openQuestion
			(getSite().getShell(),
			 getString("_UI_FileConflict_label"),
			 getString("_WARN_FileConflict"));
}
 
Example 18
Project: neoscada   File: DeploymentEditor.java   Source Code and License Vote up 2 votes
/**
 * Shows a dialog that asks if conflicting changes should be discarded.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected boolean handleDirtyConflict ()
{
    return MessageDialog.openQuestion ( getSite ().getShell (), getString ( "_UI_FileConflict_label" ), //$NON-NLS-1$
    getString ( "_WARN_FileConflict" ) ); //$NON-NLS-1$
}
 
Example 19
Project: neoscada   File: OsgiEditor.java   Source Code and License Vote up 2 votes
/**
 * Shows a dialog that asks if conflicting changes should be discarded.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected boolean handleDirtyConflict ()
{
    return MessageDialog.openQuestion ( getSite ().getShell (), getString ( "_UI_FileConflict_label" ), //$NON-NLS-1$
    getString ( "_WARN_FileConflict" ) ); //$NON-NLS-1$
}
 
Example 20
Project: neoscada   File: WorldEditor.java   Source Code and License Vote up 2 votes
/**
 * Shows a dialog that asks if conflicting changes should be discarded.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected boolean handleDirtyConflict ()
{
    return MessageDialog.openQuestion ( getSite ().getShell (), getString ( "_UI_FileConflict_label" ), //$NON-NLS-1$
    getString ( "_WARN_FileConflict" ) ); //$NON-NLS-1$
}