Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » [Databinding] Not validate a form when it is first opened
[Databinding] Not validate a form when it is first opened [message #333919] Wed, 14 January 2009 00:19 Go to next message
Marcelo Alcantara is currently offline Marcelo AlcantaraFriend
Messages: 48
Registered: July 2009
Member
Hi,

There is a way to not validate a form at the first time it is opened?

The same behaviour as the plugin.xml edit form.

I am using the MessageManager integration.

Thanks,

Marcelo
Re: [Databinding] Not validate a form when it is first opened [message #333922 is a reply to message #333919] Wed, 14 January 2009 01:19 Go to previous messageGo to next message
Matthew Hall is currently offline Matthew HallFriend
Messages: 368
Registered: July 2009
Senior Member
Marcelo Alcantara wrote:
> Hi,
>
> There is a way to not validate a form at the first time it is opened?
>
> The same behaviour as the plugin.xml edit form.
>
> I am using the MessageManager integration.

See the code for DialogPageSupport to see how DataBinding does this
internally. (short version: don't show an error or cancel status
message until after a change event is fired from one of the target
observables of a binding in a DataBindingContext)

Could you point me to the relevant classes having to do with
MessageManager? I'm not sure what integration component you're talking
about.

Matthew
Re: [Databinding] Not validate a form when it is first opened [message #333995 is a reply to message #333922] Thu, 15 January 2009 13:39 Go to previous messageGo to next message
Marcelo Alcantara is currently offline Marcelo AlcantaraFriend
Messages: 48
Registered: July 2009
Member
Hi Matthew,

I verified your DialogPageSupport and verified the TitleAreaDialogSupport
also. But could not integrate them well with my code here.

I am posting the class I was having the problem. This class just have one
field, very simple. It returns to the caller null if cancel or dialog close
is pressed, or the filled string.

Could you please take a look? I used the message manager integration found
in bug 219661.

Thanks!

Marcelo

------------------------------

package br.com.griffo.ndf.ui.view.form.dialogs;

import org.eclipse.core.databinding.AggregateValidationStatus;
import org.eclipse.core.databinding.Binding;
import org.eclipse.core.databinding.DataBindingContext;
import org.eclipse.core.databinding.UpdateValueStrategy;
import org.eclipse.core.databinding.beans.BeansObservables;
import org.eclipse.core.databinding.observable.value.IObservableVal ue;
import org.eclipse.core.databinding.validation.IValidator;
import org.eclipse.core.databinding.validation.ValidationStatus;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.databinding.swt.SWTObservables;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.layout.RowData;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.forms.IMessageManager;
import org.eclipse.ui.forms.widgets.Form;
import org.eclipse.ui.forms.widgets.FormToolkit;

import br.com.griffo.hgrcp.common.ui.databinding.ValidationMessage;
import
br.com.griffo.hgrcp.common.ui.databinding.ValidationMessages ObservableValue;
import br.com.griffo.hgrcp.common.ui.databinding.model.AbstractMode lObject;
import br.com.griffo.ndf.ui.NDFUIPlugin;
import br.com.griffo.ndf.ui.model.dialog.TitleAreaDialogSupport;
import br.com.griffo.ndf.ui.util.MessageObservableValue;
import br.com.griffo.ndf.ui.view.form.validacao.ValidaTextoObrigato rio;

import com.swtdesigner.ResourceManager;
import com.swtdesigner.SWTResourceManager;

/**
* Dialog para se preencher uma observa
Re: [Databinding] Not validate a form when it is first opened [message #334095 is a reply to message #333995] Tue, 20 January 2009 12:31 Go to previous message
Marcelo Alcantara is currently offline Marcelo AlcantaraFriend
Messages: 48
Registered: July 2009
Member
Somebody can give some help on this issue?

Thanks in advance.

Marcelo

"Marcelo Alcantara" <marcelo.alcantara@cshg.com.br> escreveu na mensagem
news:gknea0$95e$1@build.eclipse.org...
> Hi Matthew,
>
> I verified your DialogPageSupport and verified the TitleAreaDialogSupport
> also. But could not integrate them well with my code here.
>
> I am posting the class I was having the problem. This class just have one
> field, very simple. It returns to the caller null if cancel or dialog
> close is pressed, or the filled string.
>
> Could you please take a look? I used the message manager integration found
> in bug 219661.
>
> Thanks!
>
> Marcelo
>
> ------------------------------
>
> package br.com.griffo.ndf.ui.view.form.dialogs;
>
> import org.eclipse.core.databinding.AggregateValidationStatus;
> import org.eclipse.core.databinding.Binding;
> import org.eclipse.core.databinding.DataBindingContext;
> import org.eclipse.core.databinding.UpdateValueStrategy;
> import org.eclipse.core.databinding.beans.BeansObservables;
> import org.eclipse.core.databinding.observable.value.IObservableVal ue;
> import org.eclipse.core.databinding.validation.IValidator;
> import org.eclipse.core.databinding.validation.ValidationStatus;
> import org.eclipse.core.runtime.IStatus;
> import org.eclipse.core.runtime.Status;
> import org.eclipse.jface.databinding.swt.SWTObservables;
> import org.eclipse.jface.dialogs.Dialog;
> import org.eclipse.jface.dialogs.IDialogConstants;
> import org.eclipse.jface.dialogs.IMessageProvider;
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.events.SelectionAdapter;
> import org.eclipse.swt.events.SelectionEvent;
> import org.eclipse.swt.graphics.Point;
> import org.eclipse.swt.layout.FillLayout;
> import org.eclipse.swt.layout.GridData;
> import org.eclipse.swt.layout.GridLayout;
> import org.eclipse.swt.layout.RowData;
> import org.eclipse.swt.layout.RowLayout;
> import org.eclipse.swt.widgets.Button;
> import org.eclipse.swt.widgets.Composite;
> import org.eclipse.swt.widgets.Control;
> import org.eclipse.swt.widgets.Display;
> import org.eclipse.swt.widgets.Label;
> import org.eclipse.swt.widgets.Shell;
> import org.eclipse.swt.widgets.Text;
> import org.eclipse.ui.forms.IMessageManager;
> import org.eclipse.ui.forms.widgets.Form;
> import org.eclipse.ui.forms.widgets.FormToolkit;
>
> import br.com.griffo.hgrcp.common.ui.databinding.ValidationMessage;
> import
> br.com.griffo.hgrcp.common.ui.databinding.ValidationMessages ObservableValue;
> import
> br.com.griffo.hgrcp.common.ui.databinding.model.AbstractMode lObject;
> import br.com.griffo.ndf.ui.NDFUIPlugin;
> import br.com.griffo.ndf.ui.model.dialog.TitleAreaDialogSupport;
> import br.com.griffo.ndf.ui.util.MessageObservableValue;
> import br.com.griffo.ndf.ui.view.form.validacao.ValidaTextoObrigato rio;
>
> import com.swtdesigner.ResourceManager;
> import com.swtdesigner.SWTResourceManager;
>
> /**
> * Dialog para se preencher uma observa
Previous Topic:Simple API/example for copying a File using FTP
Next Topic:Dynamically add context help in Eclipse 3.4
Goto Forum:
  


Current Time: Wed Apr 24 20:29:50 GMT 2024

Powered by FUDForum. Page generated in 0.03457 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top