Bound properties listeners sources javabeans

Hi all
I am working on an assignment for college, trying to learn Java etc,
Basically I need one object to react to events in another
Code is as follows
// Extra Panel
package myPackage1;
import java.awt.GridLayout;
import java.beans.PropertyChangeEvent;
import javax.swing.JPanel;
public class ExtraPanel extends JPanel implements
java.beans.PropertyChangeListener,
java.io.Serializable
private static final long serialVersionUID = 1L;
public JPanel thisPanel;
public JPanel ExtraPanelMethod()
thisPanel = new JPanel();
GridLayout grid = new GridLayout();
grid.setColumns(1);
grid.setHgap(10);
grid.setRows(6);
grid.setVgap(5);
thisPanel.setLayout(grid);
return thisPanel;
public void propertyChange(PropertyChangeEvent evt)
// The Slider Class
package myPackage1;
import java.awt.Color;
import java.awt.Component;
import java.awt.Font;
import java.awt.GridLayout;
import javax.swing.BorderFactory;
import javax.swing.JFormattedTextField;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JSlider;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.text.NumberFormatter;
public class TheSliderClass extends JPanel implements ChangeListener
private static final long serialVersionUID = 1L;
//Add a formatted text field to supplement the slider.
public JFormattedTextField textField,textField2;
JFormattedTextField newValue = null;
JFormattedTextField oldValue = null;
public String publicSliderName = "";
public int fps;
//And here's the slider.
public JSlider sliderParameterValue;
JPanel labelAndTextField,allTogether;
int TractiveEffort = 0;
public JPanel TheSliderClassMethod(String sliderName, int minimumValue, int maximumValue)
JPanel allTogether = new JPanel();
Font font = new Font("palatino linotype regular", Font.BOLD, 12);
int initialValue = ((minimumValue+maximumValue)/2);
int tickMarkValue = (maximumValue-minimumValue);
publicSliderName = sliderName;
//Create the label.
JLabel sliderLabel = new JLabel(sliderName,JLabel.CENTER);
sliderLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
sliderLabel.setFont(font);
sliderLabel.setForeground(Color.BLUE);
//Create the formatted text field and its formatter.
java.text.NumberFormat numberFormat =
java.text.NumberFormat.getIntegerInstance();
NumberFormatter formatter = new NumberFormatter(numberFormat);
formatter.setMinimum(new Integer(minimumValue));
formatter.setMaximum(new Integer(maximumValue));
textField = new JFormattedTextField(formatter);
textField.setValue(new Integer(initialValue));
textField.setColumns(3); //get some space
textField.setEditable(false);
textField.setForeground(Color.red);
textField2 = new JFormattedTextField(formatter);
textField2.setValue(new Integer(initialValue));
textField2.setColumns(3); //get some space
textField2.setEditable(false);
textField2.setForeground(Color.red);
//Create the slider.
sliderParameterValue = new JSlider(JSlider.HORIZONTAL,
minimumValue, maximumValue, initialValue);
sliderParameterValue.addChangeListener(this);
//Turn on labels at major tick marks.
sliderParameterValue.setMajorTickSpacing(tickMarkValue);
sliderParameterValue.setMinorTickSpacing(10);
sliderParameterValue.setPaintTicks(true);
sliderParameterValue.setPaintLabels(true);
sliderParameterValue.setBorder(
BorderFactory.createEmptyBorder(0,0,0,0));
sliderParameterValue.setBackground(Color.cyan);
//Create a subpanel for the label and text field.
JPanel labelAndTextField = new JPanel(); //use FlowLayout
labelAndTextField.setBackground(Color.cyan);
labelAndTextField.add(sliderLabel);
labelAndTextField.add(textField);
//Put everything together.
GridLayout gridThis = new GridLayout();
gridThis.setColumns(1);
gridThis.setRows(2);
allTogether.setLayout(gridThis);
allTogether.add(labelAndTextField);
allTogether.add(sliderParameterValue);
allTogether.setBorder(BorderFactory.createBevelBorder(1,Color.red,
Color.red));
return allTogether;
/** Listen to the slider. */
public void stateChanged(ChangeEvent e)
JSlider source = (JSlider)e.getSource();
fps = (int)source.getValue();
textField.setText(String.valueOf(fps));
textField2.setText(String.valueOf(fps));
How do I get Extra Panel to React to the slider in the Slider Class being moved?
Thanks all

PropertyChangeListener listener = new ExtraPanel();
Component component = new TheSliderClass();
component.addPropertyChangeListener( listener );

Similar Messages

  • Bound Properties and Listeners

    First i will explain what I'm trying to do: I have two different panels and I'm trying to get the JTextFields to communicate in such a way that whatever i type in one JTextField will show up in the JTextField of the other panel (not necessarily in real-time). I think my problem is more in the design of my program than anything else.
    First I have my interface (will i need to extend EventListener?)
    public interface BookI {
         public abstract void setName(String name);
    }I have a Book class (the bean) which implements the book interface. "name" is a bound property.
    public class Book implements BookI {
         private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this);
         public void addPropertyChangeListener(PropertyChangeListener l) {
         propertyChangeSupport.addPropertyChangeListener(l);
         public void removePropertyChangeListener(PropertyChangeListener l) {
         propertyChangeSupport.removePropertyChangeListener(l);
         public void setName(String name) {
                   String oldName = this.name;
                   this.name = name;
                   propertyChangeSupport.firePropertyChange("name",oldName,name);
    }Then i have my user interface which catches the event.
    public class BookUI extends JPanel {
         private JTextField nameText = new JTextField(10);
         static class MyNameChangeListener implements PropertyChangeListener {
             public void propertyChange(PropertyChangeEvent evnt) {
                if (evnt.getPropertyName().equals("name")) {
                                // this is where i try to set the new value
                                // the new value will be coming from another JTextField in another panel
                            // nameText.setText(evnt.getNewValue()));
         public BookUI() {
                     // I tried adding the listener something like this
                     // addPropertyChangeListener(new MyNameChangeListener());
         public void setName(String name) {
              nameText.setText(name);
    }I have another panel similar to BookUI that has a JTextField and whatever changes i make to it should affect BookUI, the listener.
    For example:
    public class AnotherBookUI extends JPanel {
         private JTextField nameText = new JTextField(10);
         public AnotherBookUI() {
    }Any ideas would help.

    I believe I should be able to do this with Listers.
    I think I would need to add listeners to my interface like so:
    public interface BookI {
         public abstract void setName(String name);
         public void addPropertyChangeListener(PropertyChangeListener l);
         public void removePropertyChangeListener(PropertyChangeListener l);
    }I created a new interface so my classes can communicate:
    public interface EntityPaneI {
         void displayObject(Object entity);
    }This is the UI that should receive the changes
    public class BookUI extends JPanel implements EntityPanel {
         private BookI currentBook;
         private JTextField nameText = new JTextField(10);
         class MyNameChangeListener implements PropertyChangeListener {
             public void propertyChange(PropertyChangeEvent evnt) {
                if (evnt.getPropertyName().equals("name")) {
    // not sure if this will work
                                 String newStringValue = evnt.getNewValue().toString();
                                nameText.setText(newStringValue);
         public BookUI() {
    // not sure if the will work
                  nameText.addPropertyChangeListener(new MyNameChangeListener());
         public void setName(String name) {
              nameText.setText(name);
         public void displayObject(Object e) {
              setCurrentBook((BookI)e);
              setName(currentBook.getName());
    }The above UI should listen to changes from another UI like this one (same thing basically):
    public class AnotherUI extends JPanel implements EntityPanel {
         private BookI currentBook;
         private JTextField nameText = new JTextField(10);
         public AnotherUI() {
         public void setName(String name) {
              nameText.setText(name);
         public void displayObject(Object e) {
              setCurrentBook((BookI)e);
              setName(currentBook.getName());
    }

  • Access log4j.properties outside source folder

    Hi,
    I have developed a standalone java application, for logging the application i have created a log4j.properties in the source folder.
    it is woring fine and the logs are created as specified in the properties file.
    Issue:
    i have created a jar which contains the complete source code and log4j.properties file.
    if i try to create a jar without log4j.properties since the properties file will change by customer frequantly, i need to keep the log4j.properties outside the source folder.
    but my jar is unable to access the log4j.properties when i try to run the appplication.
    Question:
    how do we access the log4j.properties from outside source folder?
    thanks,
    J R

    gimbal2 wrote:
    T.PD wrote:
    In addition what gimbal2 sad: Do you create a MANIFEST.MF file in your jar?
    If so you should add (or extend) the ClassPath entry to include the current directory ( *.* ) so you can have the log4j.properties file in the folder where you call your jar from:[...]This is very dangerous. It makes the path not relative to where the jar is, but to where you invoke the java command.The OP's request is to have the (log4j) properties file outside of the jar maybe for easier editing.
    Adding any known folder in the file system to the class path is the only way I know to achieve this (Do you know better?). Folliwing this you could try to guess paths to add hoping that they will exist on all Systems you will use and place the properties file(s) there. On the other hane the current working dir the java command is invoked in is perdictable. Usually it's the directory the jar itself is located...
    I agree that this solution can be dangerous and opens the possibility to access classes located in a valid package structure below current working dir . But if you add the ' *.* ' as the last entry in your classpath at least the classes from all your other jars are accessed first...
    bye
    TPD

  • Ldaprealm.properties:  more sources of userDN

    WLS 5.1 sp 6
    In order to perform authentication I use the ldap realm. To enable access
    to persons of the Sales and Office department I have added following
    line to the ldaprealm.properties files
    weblogic.security.ldaprealm.userDN=o=company.com,ou=Sales
    weblogic.security.ldaprealm.userDN=o=company.com,ou=Office
    WLS just accepts the second line (Office) and ignores the first one.
    What is the syntax to use more than one userDN source?
    Thanx for help in advance,
    Michael

    currently this isn't possible to list off multiple points in the LDAP tree
    to look. in a near-future version of LDAPRealm, we're moving to
    searching every time, so this won't be a problem.
    .paul
    Michael Saringer wrote:
    WLS 5.1 sp 6
    In order to perform authentication I use the ldap realm. To enable access
    to persons of the Sales and Office department I have added following
    line to the ldaprealm.properties files
    weblogic.security.ldaprealm.userDN=o=company.com,ou=Sales
    weblogic.security.ldaprealm.userDN=o=company.com,ou=Office
    WLS just accepts the second line (Office) and ignores the first one.
    What is the syntax to use more than one userDN source?
    Thanx for help in advance,
    Michael

  • WS Policies, Bound Properties and CRMOnDemand

    I've been trying to figure this problem out for about a week, and was hoping that someone here could assist.
    In CRMOnDemand, for a stateless connect, you drop this into your SOAP header:
    <soapenv:Header>
    <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    <wsse:UsernameToken wsu:Id="UsernameToken-1">
    <wsse:Username>USERNAME_HERE</wsse:Username>
    <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">PASSWORD_HERE</wsse:Password>
    <wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">q3rLryh0dfQ1BucKrtpagw==</wsse:Nonce>
    <wsu:Created>2012-11-26T20:38:56.682Z</wsu:Created>
    </wsse:UsernameToken>
    </wsse:Security>
    </soapenv:Header>
    However, there is no clear way to do this in JDeveloper. I think I've tried all combinations of WS Policy and bound attributes, and none of them seem to work.
    So, the question is, how do I configure my web-service in my composite application to provide a SOAP document with the above header?

    Create a variable and assign the Security Header XML fragment to it. Then open the Invoke activity and go to Headers tab. Select the variable .
    Cheers,
    Durga

  • New to Java (Bound Properties)

    Hi all
    I am working on an assignment for college, trying to learn Java etc,
    Basically I need one object to react to events in another
    Code is as follows
    // Extra Panel
    package myPackage1;
    import java.awt.GridLayout;
    import java.beans.PropertyChangeEvent;
    import javax.swing.JPanel;
    public class ExtraPanel extends JPanel implements
    java.beans.PropertyChangeListener,
    java.io.Serializable
    private static final long serialVersionUID = 1L;
    public JPanel thisPanel;
    public JPanel ExtraPanelMethod()
    thisPanel = new JPanel();
                 GridLayout grid = new GridLayout();
                 grid.setColumns(1);
                 grid.setHgap(10);
                 grid.setRows(6);
                 grid.setVgap(5);
                 thisPanel.setLayout(grid);
    return thisPanel;
    public void propertyChange(PropertyChangeEvent evt)
    // The Slider Class
    package myPackage1;
    import java.awt.Color;
    import java.awt.Component;
    import java.awt.Font;
    import java.awt.GridLayout;
    import javax.swing.BorderFactory;
    import javax.swing.JFormattedTextField;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JSlider;
    import javax.swing.event.ChangeEvent;
    import javax.swing.event.ChangeListener;
    import javax.swing.text.NumberFormatter;
    public class TheSliderClass extends JPanel implements ChangeListener
    private static final long serialVersionUID = 1L;
    //Add a formatted text field to supplement the slider.
    public JFormattedTextField textField,textField2;
    JFormattedTextField newValue = null;
    JFormattedTextField oldValue = null;
    public String publicSliderName = "";
    public int fps;
    //And here's the slider.
    public JSlider sliderParameterValue;
    JPanel labelAndTextField,allTogether;
    int TractiveEffort = 0;
    public JPanel TheSliderClassMethod(String sliderName, int minimumValue, int maximumValue)
    JPanel allTogether = new JPanel();
    Font font = new Font("palatino linotype regular", Font.BOLD, 12);
    int initialValue = ((minimumValue+maximumValue)/2);
    int tickMarkValue = (maximumValue-minimumValue);
    publicSliderName = sliderName;
    //Create the label.
    JLabel sliderLabel = new JLabel(sliderName,JLabel.CENTER);
    sliderLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
    sliderLabel.setFont(font);
    sliderLabel.setForeground(Color.BLUE);
    //Create the formatted text field and its formatter.
    java.text.NumberFormat numberFormat =
    java.text.NumberFormat.getIntegerInstance();
    NumberFormatter formatter = new NumberFormatter(numberFormat);
    formatter.setMinimum(new Integer(minimumValue));
    formatter.setMaximum(new Integer(maximumValue));
    textField = new JFormattedTextField(formatter);
    textField.setValue(new Integer(initialValue));
    textField.setColumns(3); //get some space
    textField.setEditable(false);
    textField.setForeground(Color.red);
    textField2 = new JFormattedTextField(formatter);
    textField2.setValue(new Integer(initialValue));
    textField2.setColumns(3); //get some space
    textField2.setEditable(false);
    textField2.setForeground(Color.red);
    //Create the slider.
    sliderParameterValue = new JSlider(JSlider.HORIZONTAL,
    minimumValue, maximumValue, initialValue);
    sliderParameterValue.addChangeListener(this);
    //Turn on labels at major tick marks.
    sliderParameterValue.setMajorTickSpacing(tickMarkValue);
    sliderParameterValue.setMinorTickSpacing(10);
    sliderParameterValue.setPaintTicks(true);
    sliderParameterValue.setPaintLabels(true);
    sliderParameterValue.setBorder(
    BorderFactory.createEmptyBorder(0,0,0,0));
    sliderParameterValue.setBackground(Color.cyan);
    //Create a subpanel for the label and text field.
    JPanel labelAndTextField = new JPanel(); //use FlowLayout
    labelAndTextField.setBackground(Color.cyan);
    labelAndTextField.add(sliderLabel);
    labelAndTextField.add(textField);
    //Put everything together.
    GridLayout gridThis = new GridLayout();
    gridThis.setColumns(1);
    gridThis.setRows(2);
    allTogether.setLayout(gridThis);
    allTogether.add(labelAndTextField);
    allTogether.add(sliderParameterValue);
    allTogether.setBorder(BorderFactory.createBevelBorder(1,Color.red,
    Color.red));
    return allTogether;
    /** Listen to the slider. */
    public void stateChanged(ChangeEvent e)
    JSlider source = (JSlider)e.getSource();
    fps = (int)source.getValue();
    textField.setText(String.valueOf(fps));
    textField2.setText(String.valueOf(fps));
    }How do I get a method in Extra Panel to multiple the values in textField2 to react to the slider in the Slider Class being moved?
    Thanks all
    Message was edited by:
    N_Gen_Steam_Dev
    Message was edited by:
    N_Gen_Steam_Dev

    The code now is
    // The Slider Class
    package myPackage1;
    import java.awt.Color;
    import java.awt.Component;
    import java.awt.Font;
    import java.awt.GridLayout;
    import javax.swing.BorderFactory;
    import javax.swing.JFormattedTextField;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JSlider;
    import javax.swing.event.ChangeEvent;
    import javax.swing.event.ChangeListener;
    import javax.swing.text.NumberFormatter;
    public class TheSliderClass extends JPanel implements ChangeListener
         private static final long serialVersionUID = 1L;
         //Add a formatted text field to supplement the slider.
         public JFormattedTextField textField,textField2;
         JFormattedTextField newValue = null;
         JFormattedTextField oldValue = null;
         public String publicSliderName = "";
         public int fps;
         //And here's the slider.
         public JSlider sliderParameterValue;
         JPanel labelAndTextField,allTogether;
         int TractiveEffort = 0;
         public JPanel TheSliderClassMethod(String sliderName, int minimumValue, int maximumValue)
              JPanel allTogether = new JPanel();
              Font font = new Font("palatino linotype regular", Font.BOLD, 12);
              int initialValue = ((minimumValue+maximumValue)/2);
              int tickMarkValue = (maximumValue-minimumValue);
              publicSliderName = sliderName;
              //Create the label.
              JLabel sliderLabel = new JLabel(sliderName,JLabel.CENTER);
              sliderLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
              sliderLabel.setFont(font);
              sliderLabel.setForeground(Color.BLUE);
              //Create the formatted text field and its formatter.
              java.text.NumberFormat numberFormat =
                   java.text.NumberFormat.getIntegerInstance();
              NumberFormatter formatter = new NumberFormatter(numberFormat);
              formatter.setMinimum(new Integer(minimumValue));
              formatter.setMaximum(new Integer(maximumValue));
              textField = new JFormattedTextField(formatter);
              textField.setValue(new Integer(initialValue));
              textField.setColumns(3); //get some space
              textField.setEditable(false);
              textField.setForeground(Color.red);
              textField2 = new JFormattedTextField(formatter);
              textField2.setValue(new Integer(initialValue));
              textField2.setColumns(3); //get some space
              textField2.setEditable(false);
              textField2.setForeground(Color.red);
              //Create the slider.
              sliderParameterValue = new JSlider(JSlider.HORIZONTAL,
              minimumValue, maximumValue, initialValue);
              sliderParameterValue.addPropertyChangeListener(new ExtraPanel());
              sliderParameterValue.addChangeListener(this);
              //Turn on labels at major tick marks.
              sliderParameterValue.setMajorTickSpacing(tickMarkValue);
              sliderParameterValue.setMinorTickSpacing(10);
              sliderParameterValue.setPaintTicks(true);
              sliderParameterValue.setPaintLabels(true);
              sliderParameterValue.setBorder(
              BorderFactory.createEmptyBorder(0,0,0,0));
                                                      sliderParameterValue.setBackground(Color.cyan);
              //Create a subpanel for the label and text field.
              JPanel labelAndTextField = new JPanel(); //use FlowLayout
              labelAndTextField.setBackground(Color.cyan);      
              labelAndTextField.add(sliderLabel);
              labelAndTextField.add(textField);
              //Put everything together.
              GridLayout gridThis = new GridLayout();
              gridThis.setColumns(1);
              gridThis.setRows(2);
              allTogether.setLayout(gridThis);
              allTogether.add(labelAndTextField);
              allTogether.add(sliderParameterValue);
              allTogether.setBorder(BorderFactory.createBevelBorder(1,Color.red,
                                                                                    Color.red));
              return allTogether;
         /** Listen to the slider. */
         public void stateChanged(ChangeEvent e)
              JSlider source = (JSlider)e.getSource();
              fps = (int)source.getValue();
              textField.setText(String.valueOf(fps));
              textField2.setText(String.valueOf(fps));
    }//Extra Class
    package myPackage1;
    import java.awt.GridLayout;
    import java.beans.PropertyChangeEvent;
    import java.beans.PropertyChangeListener;
    import javax.swing.JPanel;
    import javax.swing.JSlider;
    public class ExtraPanel extends JPanel implements
                                                           PropertyChangeListener
         private static final long serialVersionUID = 1L;
         public JPanel thisPanel;
         public TheSliderClass aPointer = new TheSliderClass();
         public JPanel ExtraPanelMethod()
              thisPanel = new JPanel();
              GridLayout grid = new GridLayout();
              grid.setColumns(1);
              grid.setHgap(10);
              grid.setRows(6);
              grid.setVgap(5);
              thisPanel.setLayout(grid);
              return thisPanel;
         public void propertyChange(PropertyChangeEvent e)
              JSlider source = (JSlider)e.getSource();
              int fps = (int)source.getValue();
              System.out.println("Here  "+ fps);
    }What i now does is that the method propertyChange is called but does not react to the slider being moved. It print "Here " + fps a number of times for each instance of the slider class, then it prints the initial values of fps and sits there even though the slider is being moved.
    Help again
    Thanks

  • Understanding ON Bounded/Unbounded XML source files...

    Hi,
    An ADF application can have multiple unbounded/bounded task files. But at runtime all unbounded task files become one single fat file.
    Is my understanding correct?
    Can any one please anwer me?
    Thank you in advance..
    Srinivas
    Edited by: Srinivas.b on May 6, 2010 12:16 PM

    Can we use more than one unbounded taskflow?: Yes, but why would you want to? General you only need one unbounded task flow to call multiple bounded task flows.
    Does ADF treat all of them as one file? At design time their separate, at runtime I believe it merges them into one "entity", but it doesn't actually create a new file, it's probably a single memory construct similar to what happens in JSF for multiple faces-config.xml files. See:
    http://one-size-doesnt-fit-all.blogspot.com/2007/01/using-multiple-faces-configxml-files-in.html
    CM.

  • Bound property problem

    Can the property binding in javabeans work if the bean doesnt have a "PropertyChange" method implemented in it. If yes, then how ?
    Similarly, how does a bean handle the case of multiple bound properties. This question arises because, there is only one "propertyChange" method in a bean and it recieves a PropertyChangeEvent parameter. In case of multiple bound properties how does a bean know which properties propertychange event has been fired?

    But this means that the property change listener has to be aware of the names of all the properties that it can bind, which is a severe limitation ! This is because , if I want to make a bean which has a property color , then it would be very difficult to make the bean so generic so that it can be bound to any bean containing a property representing a color. Unless and Until I know the name of the property of the source bean, I cannot make use of the propertyChange method of the destination bean to handle the change in property.
    The problem comes when a bean has multiple properties . In that case, in it's property change method, it has to filter based on the names which are not known until runtime.

  • JavaBean to JavaBean

    I have a jsp application that uses 2 non-visual JavaBeans. One is an application scope and the other is a session scope. The beans are in separate jars. I would like to have the session bean be able to have the application bean do some work. Is there a way to have the session bean call a method in the application bean or use events? I have been reading about events and bound properties but nothing appears to address how to do this across beans in different jars.
    Thannks in advance.
    Bruce.

    There's a library called Dozer that does bean-mapping. I don't know where it comes from, it's just one of our six squillion dependencies at work. Probably sourceforge.net
    If the properties on both beans match by name, it's laughably simple to perform the mapping. I'm guessing that you want something a bit more lazy or flexible than simply having one bean invoke the other bean's methods directly. What is the actual scenario, and what do you mean by "session bean"? An EJB?

  • How can I add a Website Project in a solution that should be excluded from source control?

    Using VS 2013 update 4
    I currently have a solution with a couple of Class Library Projects and Web Application Projects and all of these are bound to a source control (VS Online). Now I added an Existing Website Project in the same solution by choosing a Local IIS instance. However,
    I don't want this Website Project to be in source control.
    I have tried File > Source Control > Advanced > Change Source Control ... and then clicked on the website project and then clicked Unbind. By doing this, it seems that the project was unbound. However, as soon as I close the solution it asks me
    to save the .sln file and seems that it restored the Scc*** info in the file.
    I also tried editing the .sln file and set the SccProjectEnlistmentChoice* = 0 (of the website project, under GlobalSection) and then set the ProjectSection of the WebsiteProject to 
    SccProjectName = ""
    SccAuxPath = ""
    SccLocalPath = ""
    SccProvider = ""
    instead of "SAK". This actually worked for me but everytime I open the solution, Visual Studio alerts an error saying "Unspecified error". This is the closest I got into solving this.
    Is there a proper way of doing this? I think the proper way should be the "Unbind" method but it seems that it's not working as expected.
    Let me know of other solutions.
    Cheers!

    Hi Karlo Medallo,
    Since this issue is related to the VS Online, I am moving your thread into the
    Visual Studio Online
    Forum for dedicated support. Thanks for your understanding.
    Best Regards,
    Jack
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Error while creating jar from source folder

    Hi,
    i have source folder and i added log4j.properties
    i try to build for creating jar (sourcecode.jar) by ant build (build.xml)
    it is throwing error and saying that "package org.apache.log4j does not exist"
    i spend more time to resolve this error , but i could not find any solution.
    what is the error on this.. below the build.xml code which i try to build jar
    <project name="MyProject" default="dist" basedir=".">
        <description>
            simple example build file
        </description>
      <!-- set global properties for this build -->
      <property name="src" location="src"/>
      <property name="build" location="build"/>
      <property name="dist"  location="dist"/>
      <target name="init">
        <!-- Create the time stamp -->
        <tstamp/>
        <!-- Create the build directory structure used by compile -->
        <mkdir dir="${build}"/>
      </target>
         <path id="classpath">
                 <fileset dir="${src.dir}">
                 <include name="log4j-1.2.16.jar"/>
                 </fileset>
         </path>
         <target name="compile" depends="init"
            description="compile the source " >
        <!-- Compile the java code from ${src} into ${build} -->
        <javac srcdir="${src}" destdir="${build}"/>
      </target>
      <target name="dist" depends="compile"
            description="generate the distribution" >
        <!-- Create the distribution directory -->
        <mkdir dir="${dist}/lib"/>
        <!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
        <jar jarfile="${dist}/lib/EscapeIncontra.jar" basedir="${build}"/>
      </target>
      <target name="clean"
            description="clean up" >
        <!-- Delete the ${build} and ${dist} directory trees -->
        <delete dir="${build}"/>
        <delete dir="${dist}"/>
      </target>
    </project>i am using log4j.properties inside source folder also added in eclipse class path..
    Thanks
    Rosina

    user13836688 wrote:
         <path id="classpath">
                 <fileset dir="${src.dir}">
                 <include name="log4j-1.2.16.jar"/>
                 </fileset>
         </path>
    maybe you ment<path id="classpath">
                 <fileset dir="${src.dir}">
                 </fileset>
                 <pathelenemt path="${your_lib_folder_path}/log4j-1.2.16.jar"/>
         </path>bye
    TPD

  • Problem with setting Source Level in Sun Studio 2

    I've got problem with setting Source Level to 1.5 in Sun Studio 2. When I try to set it to 1.5 in Project properties and click Ok everything seem to go well, but when I open Project Properties again Source Level is set to 1.4. I need this to work cause I started to lear Java recently and I want to use foreach loop.
    Please help

    I'm just citing an example using Date().
    In fact, whether I use DateFormat or Calendar, it shows the same result.
    When I set the date to 1 Jan 1950 0 hours 0 minutes 0 seconds,
    jdk1.4.2 will always return me 1 Jan 1950 0 hours 10 minutes 0 seconds.
    It works correctly under jdk1.3.1

  • Automapper mapping properties on a condition

    Hi there,
    I appreciate if anyone could assist me please?
    I am using AutoMapper but i am finding it difficult to map the contents depending on a condition.
    e.g
    I have a parameter called includeOptional which can be either null or 1 .
    If it is null I do not want to map the additional properties to the destination. The properties in the destination are nullable.
    if the value is 1 I would like to map the additional elements.
    Currently i am mapping everything from the source to destination as i am finding it difficult to map.
    I will share some of my code:
    IEnumerable<CustomersDAO> customers = databaseProvider.GetCustomersById(CustId);
    //additional processing..
    var result = null;
    if(includeOptional == null)
    result = Mapper.Map<List<CustomerDAO>, Customer[]>(customers);
    else
    result = Mapper.Map<List<CustomerDAO>, Customer[]>(customers);
    How would i go about mapping the properties from source to destination for each of the customers in the collection if the condition is met.
    I have the following but i cannot seem to get it work.
    configuration.CreateMap<CustomerDAO, Customer>()
    ForMember(dto => dto.StartDate, opt => opt.MapFrom(src => src.StartDate))
    .ForMember(dto => dto.Name, opt => opt.MapFrom(src => src.Name))
    .ForMember(dto => dto.Category, opt => opt.MapFrom(src => src.Category));

    Hello IndusKing,
    From your description, it seems that your issue is related the usage of the Automapper, for this, I suggest that you could post Automapper related issues to the Automapper specific forum:
    https://github.com/AutoMapper/AutoMapper/issues
    The current forum is used for Entity Framework.
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How can I relay Events to other Listeners?

    Hello,
    I'm writing an application consisting of one JFrame that holds 2 JPanels, a Panel with my "Tools" and a Panel that works as "Worksheet". I implented the feature, that you can drag a Tool from the Tools-Panel to the Worksheet-Panel.
    Now, additionally, I want to implement the feature in the Worksheet-Panel that you can replace an element by mouseDragged(..). I tried to implement this by using the GlasPane from the JFrame ...
    My Problem: The GlassPane seems to catch all events from both Panels and now the Drag&Drop feature from the Tools-Panel don't work any more.
    My Question: How can I relay the Mouse-Events catched by the GlassPane to all other MouseEvent-Listeners?
    Here my Worksheet-Panel, it add itself to the GlasPane-MouseListener List
    public class Worksheet_Panel extends javax.swing.JPanel implements WorksheetInterface {
        public Worksheet_Panel(Component GlasPane) {
             GlasPane.addMouseListener(listener);
             GlasPane.setVisible(true);
        public void mousePressed(MouseEvent e) {
        }Thanks for any help
    Edited by: AddForumListener on Feb 10, 2008 4:06 AM

    AddForumListener wrote:
    thanks. it's an interest method.
    but i think that don't work for my situation because the Class where the event is handled don't know which other components has an interest on that event.
    I think I will try to create an own glasspane which covers my worksheet-panel and its components.
    greetingsI do not know if this will be useful because I did not understand what you are trying to achieve since I did not see your code fully. However you can reach the other components which are interested in listening the mouse events of the source component that created the mouse event. What I mean is you can add the following in the mousePressed method of your glasspane component for instance:
    public void mousePressed(MouseEvent e)
         Component source = (Component) e.getSource();
         MouseListener[] listeners = source.getMouseListeners();
         // Iterate through the mouse listeners, determine to which listener
         // you would like to relay the mouse event and relay it as I mentioned above.
         for (int i = 0; i < listeners.length; i++)
    } Anyway, good luck!!!

  • Source editor preferences.

    empty

    ...And we kept the promise. Even though there is no UI for the source editor
    preferences yet, you can modify the properties "editor.source.maxLineLen",
    "editor.source.indentChar" and "editor.source.indentCount" in the properties
    file located at:
    {Workspace
    directory}\.metadata\.plugins\org.eclipse.core.runtime\.settings\com.m7.nitr
    ox.prefs
    Here is a description and the default value for each of these properties
    Note that you only need to have a property in the file mentioned above only
    if its value is different than the default value.
    #The maximum number of characters in a source code line, after which
    #the line is wrapped.
    #This is only used for the source code generated by NitroX.
    editor.source.maxLineLen=80
    #The character used for indentation in the source code.
    #Allowed values are "space" and "tab".
    #This is only used for the source code generated by NitroX.
    editor.source.indentChar=space
    #The number of characters used for source code indentation.
    #The character used for indentation is specified by the
    "editor.source.indentChar" property.
    #This is only used for the source code generated by NitroX.
    editor.source.indentCount=2
    M7 Support
    "DanBar" <[email protected]> wrote in message news:413811b4$[email protected]..
    What about source editor preferences?You've promised it will be provided in 1.1 final release... (see
    news://newsgroups.m7.com:119/[email protected]).
    Regards,
    DanBar

Maybe you are looking for