Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [ve-dev] Beans.isDesignTime


Hi,

Ah you are talking about when you are editing a class, and not USING the class. When editing code, none of the code is actually executed, it is only interpreted. It is only executed when use the class on another class. In that case it will be executed as true java code and so the isDesignTime is found and recognized. But during editing we don't interpret if statements. We look at the "if" clause as just regular code that could have property settings in it.

In that case just change your code to:

if (false)
  ;
else
 ulcButton.setBackground(Color.red);

We do not interpret the "else" clause.

Rich


"Janak Mulani" <janak.mulani@xxxxxxxxx>
Sent by: ve-dev-bounces@xxxxxxxxxxx

08/10/2006 09:34 AM

Please respond to
Discussions people developing code for the Visual Editor project <ve-dev@xxxxxxxxxxx>

To
"Discussions people developing code for the Visual Editor project" <ve-dev@xxxxxxxxxxx>
cc
Subject
RE: [ve-dev] Beans.isDesignTime





Hi Rich,
 
Is there another way to prevent code from getting executed in the Target VM?
 
In the following code snippets, even if I am setting the background color under !isDesignTime, the background is set in the target VM and shown in the model and property sheet:
 
 private ULCButton getUlcButton() {
 if (ulcButton == null) {
  ulcButton = new ULCButton();
  ulcButton.setText("ULCButton");
   if(!Beans.isDesignTime()){
    ulcButton.setBackground(Color.red);
   }

 
  }
 return ulcButton;
}

----------------------------------------------------------------------------------
private JButton getJButton() {
 if (jButton == null) {
  jButton = new JButton();
  jButton.setText("JButton");
  if (!Beans.isDesignTime()) {
   jButton.setBackground(Color.red);
  }
 
 }
 return jButton;
}

 
Why is setBackground being executed?
 
Thanks and regards,
 
Janak
 
 
 
-----Original Message-----
From:
ve-dev-bounces@xxxxxxxxxxx [mailto:ve-dev-bounces@xxxxxxxxxxx]On Behalf Of Rich Kulp
Sent:
Thursday, August 10, 2006 6:39 PM
To:
Discussions people developing code for the Visual Editor project
Subject:
Re: [ve-dev] Beans.isDesignTime


Hi,


The code should not execute because you said only execute if NOT design time. The target VM will be marked as design time.


Rich


"Janak Mulani" <janak.mulani@xxxxxxxxx>
Sent by: ve-dev-bounces@xxxxxxxxxxx

08/10/2006 08:12 AM

Please respond to
Discussions people developing code for the Visual Editor project <ve-dev@xxxxxxxxxxx>


To
"ve-Dev@Eclipse. Org" <ve-dev@xxxxxxxxxxx>
cc
Subject
[ve-dev] Beans.isDesignTime







Hi,

In VE, If I put a piece of code under the condition:

if (!Beans.isDesignTime()) {
               code
}

Will the code be executed in the Target VM?

Is there a way to suppress code from being executed in the Target VM?

Thanks and regards,

Janak
_______________________________________________
ve-dev mailing list
ve-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ve-dev

_______________________________________________
ve-dev mailing list
ve-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ve-dev


Back to the top