Change Table property in JTextEditor
I have next problem:
I write HTML editor and I have to insert and edit tables.
To date I can insert and edit it but then I cange table attributies (For example, backgroud color or size) table view doesn't change.
Then I show Document dump then I see that document was change.
Can you help my?
I uses next code to add attribute to Table element:
public void addAttributes(Element e, AttributeSet a) {
if ( (e != null) && (a != null)) {
try {
writeLock();
int start = e.getStartOffset();
DefaultDocumentEvent changes = new DefaultDocumentEvent(start,
e.getEndOffset() - start, DocumentEvent.EventType.CHANGE);
AttributeSet sCopy = a.copyAttributes();
MutableAttributeSet attr = (MutableAttributeSet) e.getAttributes();
changes.addEdit(new AttributeUndoableEdit(e, sCopy, false));
attr.addAttributes(a);
changes.end();
fireChangedUpdate(changes);
fireUndoableEditUpdate(new UndoableEditEvent(this, changes));
finally {
writeUnlock();
}Here Element e - Table element
and AttributeSet a - new attributies
Use the trinidad table component instead of the ADF Rich Client Components table.
Similar Messages
-
Hello,
I am using the last version of the JRC runtimes from CR4E to switch the datasources to JNDI. at run time It is working well, except by the fact of the queries taking the old (design-time configured) table prefixes. Looking at the report in designer, I can see that those prefixes are indicated in the u201COwneru201D table property for each table. No matter how I switch the sources (looping through the tables or using the replaceConnection method) those properties are not altered and then the queries end up pointing to the wrong schema.
Can anybody point me to how should I change the Owner property for all the tables?
Thanks in advance
JuanTry changing the qualified name of the table: Table.setQualifiedName(<owner.tablename>)
-
How I can change visible property of an af:table with an af:selectOneRadio?
How I can change visible property of an af:table with an af:selectOneRadio? Anyone can help me with a tutorial, example or link?
Thanks in advance.After you add the required libraries to your classpath
you can do your use case as explained in this sample
page source
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<f:view xmlns:f="http://java.sun.com/jsf/core" xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
<af:document title="untitled2.jsf" id="d1">
<af:messages id="m1"/>
<af:form id="f1">
<af:selectOneRadio label="radio" id="sor1" autoSubmit="true"
valueChangeListener="#{ControlVisibilty.onRadioSelected}">
<af:selectItem label="0" value="0" id="si1"/>
<af:selectItem label="1" value="1" id="si2"/>
</af:selectOneRadio>
<af:table value="#{bindings.DepartmentsView1.collectionModel}" var="row"
rows="#{bindings.DepartmentsView1.rangeSize}"
emptyText="#{bindings.DepartmentsView1.viewable ? 'No data to display.' : 'Access Denied.'}"
fetchSize="#{bindings.DepartmentsView1.rangeSize}" rowBandingInterval="0"
selectedRowKeys="#{bindings.DepartmentsView1.collectionModel.selectedRow}"
selectionListener="#{bindings.DepartmentsView1.collectionModel.makeCurrent}" rowSelection="single"
id="t1" partialTriggers="::sor1" visible="#{ControlVisibilty.table}">
<af:column sortProperty="#{bindings.DepartmentsView1.hints.DepartmentId.name}" sortable="false"
headerText="#{bindings.DepartmentsView1.hints.DepartmentId.label}" id="c1">
<af:inputText value="#{row.bindings.DepartmentId.inputValue}"
label="#{bindings.DepartmentsView1.hints.DepartmentId.label}"
required="#{bindings.DepartmentsView1.hints.DepartmentId.mandatory}"
columns="#{bindings.DepartmentsView1.hints.DepartmentId.displayWidth}"
maximumLength="#{bindings.DepartmentsView1.hints.DepartmentId.precision}"
shortDesc="#{bindings.DepartmentsView1.hints.DepartmentId.tooltip}" id="it1">
<f:validator binding="#{row.bindings.DepartmentId.validator}"/>
<af:convertNumber groupingUsed="false"
pattern="#{bindings.DepartmentsView1.hints.DepartmentId.format}"/>
</af:inputText>
</af:column>
<af:column sortProperty="#{bindings.DepartmentsView1.hints.DepartmentName.name}" sortable="false"
headerText="#{bindings.DepartmentsView1.hints.DepartmentName.label}" id="c2">
<af:inputText value="#{row.bindings.DepartmentName.inputValue}"
label="#{bindings.DepartmentsView1.hints.DepartmentName.label}"
required="#{bindings.DepartmentsView1.hints.DepartmentName.mandatory}"
columns="#{bindings.DepartmentsView1.hints.DepartmentName.displayWidth}"
maximumLength="#{bindings.DepartmentsView1.hints.DepartmentName.precision}"
shortDesc="#{bindings.DepartmentsView1.hints.DepartmentName.tooltip}" id="it2">
<f:validator binding="#{row.bindings.DepartmentName.validator}"/>
</af:inputText>
</af:column>
<af:column sortProperty="#{bindings.DepartmentsView1.hints.ManagerId.name}" sortable="false"
headerText="#{bindings.DepartmentsView1.hints.ManagerId.label}" id="c3">
<af:inputText value="#{row.bindings.ManagerId.inputValue}"
label="#{bindings.DepartmentsView1.hints.ManagerId.label}"
required="#{bindings.DepartmentsView1.hints.ManagerId.mandatory}"
columns="#{bindings.DepartmentsView1.hints.ManagerId.displayWidth}"
maximumLength="#{bindings.DepartmentsView1.hints.ManagerId.precision}"
shortDesc="#{bindings.DepartmentsView1.hints.ManagerId.tooltip}" id="it3">
<f:validator binding="#{row.bindings.ManagerId.validator}"/>
<af:convertNumber groupingUsed="false"
pattern="#{bindings.DepartmentsView1.hints.ManagerId.format}"/>
</af:inputText>
</af:column>
<af:column sortProperty="#{bindings.DepartmentsView1.hints.LocationId.name}" sortable="false"
headerText="#{bindings.DepartmentsView1.hints.LocationId.label}" id="c4">
<af:inputText value="#{row.bindings.LocationId.inputValue}"
label="#{bindings.DepartmentsView1.hints.LocationId.label}"
required="#{bindings.DepartmentsView1.hints.LocationId.mandatory}"
columns="#{bindings.DepartmentsView1.hints.LocationId.displayWidth}"
maximumLength="#{bindings.DepartmentsView1.hints.LocationId.precision}"
shortDesc="#{bindings.DepartmentsView1.hints.LocationId.tooltip}" id="it4">
<f:validator binding="#{row.bindings.LocationId.validator}"/>
<af:convertNumber groupingUsed="false"
pattern="#{bindings.DepartmentsView1.hints.LocationId.format}"/>
</af:inputText>
</af:column>
</af:table>
</af:form>
</af:document>
</f:view>The managed bean code is
import javax.faces.event.ValueChangeEvent;
public class ControlVisibilty {
private boolean table;
public ControlVisibilty() {
setTable(false);
public void onRadioSelected(ValueChangeEvent valueChangeEvent) {
// Add event code here...
if(valueChangeEvent.getNewValue().toString().equals("1"))
setTable(true);
else
setTable(false);
public void setTable(boolean table) {
this.table = table;
public boolean isTable() {
return table;
} -
How to change a property programmatically
Hello,
How can I change a property during runtime? Like, change the label of a button, or change the header text of a table.
regards,
arnoldHi Arnold,
You need to get an instance of the UI element at runtime. You can get this only in WDDoModifyView
IWDLabel lab = (IWDLabel)view.getElement(<labelID>);
lab.set<property>(<value>);
Warm Regards,
Murtuza -
Hello all,
Can we change the property of the elements of an array. For example:
I have an array of combo-boxes. Can i have such a scenario that different combo-boxes of the array will have different items to select an item.
I am able to set the different "values" in different combo-boxes bu using "to be more specific class" property node.
But i could not set the different item list in different combo-boxes.
Please give me the solution.Thanks a million dave!!!!!
I have learnt a very new and innovative thing...
I just wanna ask you one more question in the above context.
Can i have listbox or combo-box in a table just like in an excel sheet where we can have listbox by using "data validation" property for different cells having different list.Can i have this in labview. Because for this i have to super-impose the combo-boxes on the table and treat them separately.
We have to take those combo-box values and put in table and then store it.I have attached one VI to show the scenario.
And this is the alternative solution of the array problem which u have already given. So please suggest me between the two or any alternative solution.
Thanks,
Ankit Madaan
Attachments:
Recording _Table.vi 19 KB -
External Table : property name="oracle.kv.parentKey"
Hi,
Base on external table example in version 2.0.23, I have major key + minor key as follow:
/user/user<i>@example.com/-/info/
When I changed the property oracle.kv.parentKey in the config file to be full majorKey instead of one part of the major key, there is no results
For example:
when the value of this property is: /user (the default in the example) - I got all KV pairs starting with /user prefix
but when I configure it to: /user/[email protected] which is the full majorKey I didn't get answers at all (although the KV exists).
Does this property support only first part of majorKey or may I misunderstand the concept?
Thanks in advanced,
YosiKHi YosiK,
The parentKey value in this context is treated the same as parentKey argument to the KVStore.storeIterator() methods. As described in the javadoc for those API calls:
parentKey - the parent key whose "child" KV pairs are to be fetched. It may be null to fetch all keys in the store. If non-null, the major key path must be a partial path and the minor key path must be empty.
So, in fact, the parentKey MUST NOT be a complete major key - it must be partial. There must be majorKey components following the parentKey that is specified. The subRange argument does interacts with this though. In the example, if you leave parentKey as "/user" but add a subRange parameter with value
"I/[email protected]/[email protected]/I" you would achieve the result that I think you originally anticipated.
- Mark -
How do with change table cells from staticText1 to button1 in run time?
I have two question:
first: I think change table's cells from staticText to button in run time?
how do?
second: I think change table column's order in run time?how do?
ex:
=============change before===========
name age
wtu 22
=============chnage after=============
age name
22 wtu
thanksTry something like this:
1. Drop a Table. By default it has three columns.
2. Drop a button inside the third column. Set its id property to buttonInColumn3, and set its rendered property to false.
3. Drop another button, this time outside the table. Set its id property to buttonOutsideTable.
4. Double-click the buttonOutsideTable and make the method look as follows:
public String buttonOutsideTable_action() {
//switch the first two columns
List cols = tableRowGroup1.getChildren();
Object col = cols.remove(0);
cols.add(1, col);
//toggle between showing staticText3 and buttonInColumn3 (in the third column)
staticText3.setRendered(!staticText3.isRendered());
buttonInColumn3.setRendered(!buttonInColumn3.isRendered());
return null;
5. Run the application and click the button outside the table several times. -
To change table data runtime when dropdown item is changed
Hi,
I have two ui elements(Dropdown by index and table) in single view .
I need to display table as per drondown index item selection. Means i have to change table data runtime when dropdown item is changed.Please help me in that .Please provide code for same.
Regards,
gurprit BhatiaHello gurprit Bhatia,
On the view create a new action. Fill only the Name and Text and leave the other items default.
In this event you can populate the table fields.
Bound this newly created action (event) to the onSelect property of the 'DropDownByIndex'.
Regards,
Patrick Willems -
Hello,
This is pretty much a reposting of my last 2 questions...
In DW 5, trying to change Table default settings to
- Normal font (right now default is Bold)
- Vertical Alignment to Top (current default is middle) (so that text and lists will start at the top and fill down, like an ordinary document or table in Word)
I have multiple columns across the screen, different categories of events, news, resources, that I will be updating over time.
Ideally I would like to be able to 'simply' type and update the listings as needed (including bolding, indenting, the occasional image), just like in a document. I know this will involve tables, especially when it comes to 'indenting' text under a heading.
Updating a website. My in-progress work-up is here - http://www.wnytrauma.org/index33.html - (I know the coding is probably a mess, but I'm an old dog and this is a new trick).
Thank you,
Lawrence Congdon
(@LC_Sun)If you can't find a stylesheet named outline-table-cells.css, it might be a name inserted by my Firebug.
In any case, try adding a rule with these properties in any css that your page uses:
table td, table th {
font-weight: normal;
vertical-align: top;
Note: The default font weight for a table cell (td) is normal
The default font weight for a table header cell (th) is bold.
If you were to use td instead of th you would not need the font-weight: normal property to override the default -
Advice for custom transformation script to change table FK Associations
Hello,
I am attempting to write a transformation script that will cycle through tables in a large model and modify some
FK associations to change the remote table in the FK. As an aside, the reason for this is that our logical model
has logical entities that represent many small lookup code domains. However our relational/physical model has a
single utility code repository physical table which contains all these code domains. So part of the transformation
from our logical model to relational model is to swing all the FK associations for these lookup code domains
into the common code table. Then the tables representing the lookup domains can be hard deleted.
In any case, I'm looking at the
oracle.dbtools.crest.model.design.relational.FKIndexAssociation
or the
oracle.dbtools.crest.model.design.relational.Index
to see if one of these can be manipulated to perform the transformation I want to accomplish.
When I perform the equivalent process manually via property sheets there are several ways of accomplishing this.
a) The neatest method seems to be to modify the existing FK in place by clicking on the FK in the relational diagram and then changing
the property called 'PK / UK Index'. Change that to the PK of the utility code repository table that is replacing the original
table (representing the lookup domain). A side effect of this results in the mapping of the FK
columns being nulled out. So they need to be remapped to the original columns (which are retained).
So in two steps the existing FK is detached from the original table, reattached to the new table and then
the FK columns are reused in place for the new FK mapping.
b) The brute force method is to delete the original FK and then create an entirely new FK to the new table. There are
multiple dialogs which allow you to retain the original FK columns and reuse them in the new FK.
I realize this is a somewhat complex transformation but I'd appreciate some algorithmic advice on which path to take
to try to accomplish this. In particular, is there a scripting equivalent to the first process above?
I don't even know if the FK that is represented on the relational diagram is represented by the FKIndexAssociation or Index
class in the scripting object model. In other words, as I loop through the tables in the relational model what would be my
starting point:
fks = table.getFKAssociationsList();
or
fkIndexes = table.getAllInds_FKeyInds();
or something else. The names of the properties in the user interface don't always match with the scripting properties so
it's a little tricky to figure this stuff out.
Once I get access to the object that is equivalent to the FK in the diagram/property sheet, what
is the best way to manipulate it via scripting. How can I change the parent/remote end of the FK to point to the new table.
Or if I have to delete the original FK and then recreate it - is there a way to save the original FK columns and reuse them
while creating the new FK?
One other question. What is the best way to delete tables from a relational model. I note that there is an undocumented (?) remove()
method that is available on Table. It is probably on a superclass so other things can be removed as well.
When I try to use this method in a loop the script throws up dialogs similar to the dialogs that appear while performing a delete
manually via the UI. Is there any way to intercept and respond to the dialogs programmatically?
So for instance if I get a dialog popup like
Do you want to delete generated FK columns 'FOO' in table 'BAR'?
is there a way to intercept that dialog in the script and then answer Yes or No to it via the script?
If it turns out to be too difficult to perform this type of transformation via scripting the fallback
is to perform the transformation on the generated DDL file. But it would be cleaner to be able
to perform the transformation in the DM Relational model if possible.
Any advice appreciated.
Rgds, BPPhilip,
This is good info. I was able to get a rough version of my transformation script to work.
However I'd like to clean it up a bit.
In your notes it is not clear how the FKIndexAssociation and associated Index are related.
Is there a getter on FKIndexAssociation that references the associated Index?
It looks like the method fk.changeKeyObject() takes an Index object as its first parameter.
What would be the cleanest way to extract the PK Index from the Code table that I want
to point to? I used something like:
cdTable = model.getTableSet().getByName("CD_REPOSITORY");
cdPkIndex = cdTable.getIndexByName("CD_REPOSITORY_PK");
I used the latter method because it's the only one that returns an object of type Index
which is required as input to FKIndexAssociation.changeKeyObject(). However this method
requires the name of the index. That's fine but I'd like to just grab the PK's supporting index
directly if possible (without knowing the name).
I'm curious if there is a getter on Table or FKIndexAssociation that can just grab the index of the PK of
a table directly?
I don't see such a getter on FKIndexAssocation. On the Table class there are many getters that might be
of some use but the only one I could get to work was getIndexByName() as shown above.
I tried to use getIndexes() and then use isPk() on the result of that in a loop but that didn't return any result.
It looks like getters getIndexes(), getPKs(), getUKeys() return collections of DesignObject which are just the
superclass of FKIndexAssociation which is not what I need (i.e. which IS the actual underlying Index object).
So I guess the general question is what is the best way to get access to the Index objects in two scenarios.
First for the PK and UKs (typically on the 'parent-referenced' table) and secondly for FKs (typically on the 'child-referencing' table).
If I were imagining how this would work I would imagine getters on the Table for the former and a getter
on the FKIndexAssociation for the latter. But that's not how it works.
Also, as an aside - this 'Index' is somewhat confusing since these seem to be 'potential indexes' and not true database indexes.
These 'indexes' seem to be more closely related to database constraints and not actual indexes. I know that Primary Keys are
implemented in Oracle via a unique index but I'd like to confirm that the class
oracle.dbtools.crest.model.design.relational.Index
is not the same thing as a DDL database Index.
Secondary question. I notice when I run the script which loops through all the tables and redirects the FKs - the
diagram does not refresh. I had to save the model and then reload it for the graphical representation
of the FKs to change and redirect to the new table.
Is there a way to force the refresh to occur right away?
I've noticed that other transformation scripts I've written HAVE resulted in the diagram being refreshed
right away (even while the script is running). In this case it does not.
Rgds, BP -
How can I change element property.
Hi experts,
I have two tables and while I set the first table's property is visible , second table's property is invisible.When the screen is loaded, I want to make the first table visible and second table invisible. When I click any row in the table, I want to open q new table below first table.How can I do?How can I change the property of the table? Can anyone share with me the sample code for this.Hi Mehmet,
Create 3 context attributes with type WDUI_VISIBILITY
and in the Layout bind these with the Corresponding TABLE Controls
VISIBLE property.
and set these in WDDOINIT()
wd_context->set_attribute( name = 'FIRST_TABLE_VISIBLE' value = if_wdl_core=>visibility_visible ).
and table SELECT event.
wd_context->set_attribute( name = 'FIRST_TABLE_VISIBLE' value = if_wdl_core=>visibility_visible ).
Regards
Abhimanyu L -
Why is AE creating unwanted keyframes whenever i change a property?
Hi all...
Just hoping someone can maybe shed some light on this - every time i go to change a property of a layer, AE (CS5.5) creates a keyframe which i don't want, even though i haven't clicked the stopwatch button. Any thoughts? Is this happening to anyone else?
Example: I have a comp containing a PNG sequence on a layer above some video footage. I want to move the comp over to the right a ways, so i select the layer, and move it to the right. Suddenly the stopwatch icon activates (without me clicking it) and a keyframe appears on the layer's timeline where the playhead is. Very befuddling, and quite irritating - if i miss one, forget to delete the key and then later try to animate the layer, it messes up the animation and i have to go hunting for the rogue key.
Anyways, hopefully someone out there has an idea of what's going wrong, and even more hopefully, how to fix it. I have a horrible suspicion it's some setting that i've accidentally changed...
Thanks all!
p.Hi everyone.
Scratch the above - just spotted the massive big red "auto-keyframe properties when modified" button at the top of the timeline. D'oh!
Thanks all,
p. -
Error while creating publisher change tables in CDC
Hi,
I am implementing Change Data Capture. I got getting following error while creating publisher change tables in Staging database. My database version is 10.2.0.2.0 .
I appreciate your help.
ERROR at line 1:
ORA-29540: class oracle/CDC/PublishApi does not exist
ORA-06512: at "SYS.DBMS_CDC_PUBLISH", line 611
ORA-06512: at line 2
Thanks,
Venkat.This problem got fixed when I ran below script!!
@$ORACLE_HOME/rdbms/admin/initcdc.sql; -
How to change autocommit property in Oracle 8.1.6 server
Can anybody tell me how to change autocommit property in Oracle 8.1.6 server?
Thanks in advance.
Matthew
nullHi,
SET AUTOCOMMIT OFF
thanks,
Boby Jose Thekkanath,
Consultant,CWO,
NSW-AUS. -
How can I change the property of a graph running in another VI ?
I know how to set a control value in another VI using the invoke node but what should I do to change the property of a control?
Hi Zumdal,
you can make a reference of your graph, copy it in a global variable that can be handled in a remote vi to change the property of the graph.
I attach a sample LLB that contains a graph.vi and a property.vi.
From the property.vi you can control the property of the graph.
Good luck,
Alberto
Attachments:
graph_property.llb 27 KB
Maybe you are looking for
-
Hi, I added a list view web part into a SharePoint 2013 page and it is working as expected, except for one thing. I have enabled the option for the user to change the view for the web part. However when the user changes it, the user is redirected aw
-
MODELB5SJ. IF I KEEP MOVING THE MOUSE IT DOES NOT OCCUR. IF I IMMEDIATELY MOVE THE MOUSE WHEN I GO BACK TO THE LOG IN SCREEN I CAN RETURN WITHOUT HAVING TO LOG IN. IF I WAIT MORE THAN 4 SECONDS I HAVE TO LOG IN AGAIN. UPGRADED TO LATEST F/F YESTERDAY
-
Trying to understand text encodings between windows clients and oracle DB
I am focusing on a "maybe bad configured" oracle windows xp client connecting into a well configured oracle db server (10g for example). Instead of just keep the correct client settings to make it work I would prefer to understand what is really doin
-
Hi gurus, Its urgent can any one tell me how to see the KE30 report day wise. Regards Dinaker.
-
Desktop picture cannot be set - changes back to Imac default
I've had a new 27" Imac for two weeks, initially I could set the desktop pic and it would stay until I changed it. However in the last two days the pic keeps reverting to the default mac star sky pic after about 4 minutes. I have spoken with Apple ca